Instructions to use inference-optimization/Inkling-0.6B-A0.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inference-optimization/Inkling-0.6B-A0.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="inference-optimization/Inkling-0.6B-A0.6B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("inference-optimization/Inkling-0.6B-A0.6B") model = AutoModelForMultimodalLM.from_pretrained("inference-optimization/Inkling-0.6B-A0.6B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inference-optimization/Inkling-0.6B-A0.6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inference-optimization/Inkling-0.6B-A0.6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/Inkling-0.6B-A0.6B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/inference-optimization/Inkling-0.6B-A0.6B
- SGLang
How to use inference-optimization/Inkling-0.6B-A0.6B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "inference-optimization/Inkling-0.6B-A0.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/Inkling-0.6B-A0.6B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "inference-optimization/Inkling-0.6B-A0.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/Inkling-0.6B-A0.6B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use inference-optimization/Inkling-0.6B-A0.6B with Docker Model Runner:
docker model run hf.co/inference-optimization/Inkling-0.6B-A0.6B
| license: mit | |
| base_model: | |
| - thinkingmachines/Inkling | |
| library_name: transformers | |
| # Inkling-0.6B-A0.6B | |
| This is a tiny version of [thinkingmachines/Inkling](https://huggingface.co/thinkingmachines/Inkling) created for testing and development. | |
| ## Model Details | |
| - **Base Model**: thinkingmachines/Inkling | |
| - **Architecture**: inkling_mm_model (InklingForConditionalGeneration) | |
| - **Total Parameters**: 0.644B | |
| - **Activated Parameters**: 0.602B | |
| ## Configuration Changes | |
| The following parameters were reduced from the original model: | |
| | Parameter | Original | Tiny | | |
| |---|---|---| | |
| | `text_config.num_hidden_layers` | 66 | 12 | | |
| | `text_config.hidden_size` | 6144 | 1024 | | |
| | `text_config.intermediate_size` | 24576 | 4096 | | |
| | `text_config.num_attention_heads` | 64 | 8 | | |
| | `text_config.num_key_value_heads` | 8 | 2 | | |
| | `text_config.swa_num_attention_heads` | 64 | 8 | | |
| | `text_config.swa_num_key_value_heads` | 16 | 4 | | |
| | `text_config.n_routed_experts` | 256 | 8 | | |
| | `text_config.num_experts_per_tok` | 6 | 4 | | |
| | `text_config.moe_intermediate_size` | 3072 | 512 | | |
| | `text_config.num_mtp_layers` | 8 | 1 | | |
| | `vision_config.n_layers` | 4 | 1 | | |
| | `vision_config.hidden_size` | 1024 | 256 | | |
| | `vision_config.decoder_dmodel` | 6144 | 1024 | | |
| | `audio_config.decoder_dmodel` | 6144 | 1024 | | |
| Layer type patterns are preserved: 2 repetitions of [5× `hybrid_sliding` + 1× `hybrid`], with the first 2 MLP layers as `dense` and the rest as `sparse` (MoE). | |
| ## Checkpoint Structure | |
| Single safetensors file (`model.safetensors`). Key naming matches the original checkpoint format (`model.llm.*`, `model.audio.*`, `model.visual.*`). | |
| ## Usage | |
| ```python | |
| from transformers.models.inkling import InklingForConditionalGeneration | |
| from transformers import AutoTokenizer | |
| model = InklingForConditionalGeneration.from_pretrained("inference-optimization/Inkling-0.6B-A0.6B", device_map="auto") | |
| tokenizer = AutoTokenizer.from_pretrained("inference-optimization/Inkling-0.6B-A0.6B") | |
| input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device) | |
| output = model.generate(input_ids, max_new_tokens=20) | |
| print(tokenizer.decode(output[0])) | |
| ``` | |
| ## Creation Process | |
| This model was created using the llm-compressor `create-tiny-model` claude skill. | |
| 1. Config inspected via `inspect_config.py` | |
| 2. Tiny model created via modified `save_tiny_model.py` — all-zero params fixed post `init_weights` | |
| 3. Fine-tuned on copypasta dataset; reached perplexity 1.45 (target: ≤3.0) at lr=5e-4 | |
| 4. Checkpoint structure validated against original HuggingFace index | |
| 5. Inference validated via `validate_tiny_model.py` | |
| ## Notes | |
| - The `embed_tokens` weights require explicit re-initialization after `init_weights()` (they initialize to zero in this architecture). The save script applies a fixup: any all-zero, non-finite, or extreme-valued parameter is re-initialized with kaiming_uniform / normal / ones as appropriate. | |
| - MTP (Multi-Token Prediction) layers present in the original checkpoint (`model.mtp.*`) are not included, as `InklingForConditionalGeneration` does not expose them through its standard interface. | |
| - Validation output: `Success: 1.4451 <= 10.0` | |