Image-Text-to-Text
MLX
Safetensors
inkling2_loop
quantized
4-bit precision
affine
inkling
conversational
Run this model with HF Jobs
Run ukisai/Swift-Inkling-2-Mini-MLX-4bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use ukisai/Swift-Inkling-2-Mini-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use ukisai/Swift-Inkling-2-Mini-MLX-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("ukisai/Swift-Inkling-2-Mini-MLX-4bit") config = load_config("ukisai/Swift-Inkling-2-Mini-MLX-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use ukisai/Swift-Inkling-2-Mini-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ukisai/Swift-Inkling-2-Mini-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ukisai/Swift-Inkling-2-Mini-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use ukisai/Swift-Inkling-2-Mini-MLX-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ukisai/Swift-Inkling-2-Mini-MLX-4bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default ukisai/Swift-Inkling-2-Mini-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ukisai/Swift-Inkling-2-Mini-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ukisai/Swift-Inkling-2-Mini-MLX-4bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "ukisai/Swift-Inkling-2-Mini-MLX-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
|
Download README.md from ukisai/Swift-Inkling-2-Mini-MLX-4bit: direct link, hf CLI and curl.
- Browser
- Download file 22.1 kB
-
https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/resolve/main/README.md
- Command line
-
hf download hf://ukisai/Swift-Inkling-2-Mini-MLX-4bit/README.md
-
curl -L -o README.md https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/resolve/main/README.md
22.1 kB
| license: apache-2.0 | |
| license_link: https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/blob/main/LICENSE | |
| base_model: ukisai/Swift-Inkling-2-Mini | |
| base_model_relation: quantized | |
| library_name: mlx | |
| pipeline_tag: image-text-to-text | |
| tags: | |
| - mlx | |
| - quantized | |
| - 4-bit | |
| - affine | |
| - inkling | |
| <div align="center"> | |
| <a href="https://ukisai.com"><img src="ukisai-banner.png" alt="UkisAI" style="width:100%;max-width:100%;height:auto;display:block;margin-bottom:0.6em;" /></a> | |
| <div style="display:flex;flex-wrap:wrap;justify-content:center;gap:0.6em;margin-bottom:1em;"> | |
| <a href="https://ukisai.com"><strong>Website</strong></a> • | |
| <a href="https://ukisai.com/products/swift"><strong>Learn more</strong></a> • | |
| <a href="https://huggingface.co/ukisai/Swift-Inkling-2-Mini"><strong>Safetensors</strong></a> • | |
| <a href="https://huggingface.co/ukisai/Swift-Inkling-2-Mini-GGUF"><strong>GGUF</strong></a> • | |
| <a href="https://huggingface.co/ukisai/Swift-Inkling-2-GSQ-RCO-GGUF"><strong>GSQ-RCO</strong></a> • | |
| <a href="#license-and-access"><strong>License</strong></a> | |
| </div> | |
| </div> | |
| # Swift Inkling 2 Mini | |
| **Apple MLX 4-bit affine quantization.** This is Swift Inkling 2 Mini in native MLX format, with 4-bit affine non-expert weights (group size 64). | |
| Swift Inkling 2 Mini is UkisAI's reasoning-efficient derivative of [Inkling 2 Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini), | |
| using **58.6% fewer thinking tokens** while maintaining near-identical performance | |
| (**<1% loss**) and as a result getting a **x2.4 speed-up** on several tasks. | |
| <video controls autoplay muted loop playsinline style="width:100%;max-width:100%;height:auto;display:block;border-radius:12px;margin:0.8em 0 1.4em;" src="https://huggingface.co/ukisai/Swift-Inkling-2-Mini/resolve/main/swift-inkling-2-demo.mp4"></video> | |
| <p align="center" style="font-size:13px;color:#8C94A8;margin:-0.6em 0 1.4em;">The prompt is a sample from LiveCodeBench v6</p> | |
| ## Training approach | |
| We made Swift Inkling 2 Mini efficient by **figuring out which tokens were linked to pathological overthinking** and penalizing them **without** rewarding shorter reasoning length directly. We trained a model with this premise, then used it as the teacher for **contextual on-policy distillation**, leading to "compressed" token usage while maintaining accuracy. | |
| Swift Inkling 2 Mini produces shorter reasoning traces. In our testing, we also observe fewer overthinking errors (reasoning loops without exit). | |
| ## Evaluation scope | |
| > All results below compare the Inkling 2 Mini base with Swift Inkling 2 Mini. Both models use the same saved [evaluation protocols](https://github.com/UkisAI/Benchmark_configs), and all scores are averages over five seeds (0–4) per model. | |
| The main table reports BF16 results. Quantized results are in [Quantized models](#quantized-models). | |
| ## Benchmarks | |
| <style> | |
| .swift15-table { width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; overflow:hidden; border:1px solid #27344A; border-radius:20px; background:#0D111B; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; font-size:14px; color:#BFBDBD; } | |
| .swift15-table th { padding:8px 8px; text-align:center; font-weight:700; color:#AEB5C7; background:#0D111B; border-right:1px solid #27344A; border-bottom:1px solid #27344A; } | |
| .swift15-table td { padding:8px 8px; text-align:center; color:#BFBDBD; background:#0D111B; border-right:1px solid #27344A; border-bottom:1px solid #27344A; vertical-align:middle; overflow-wrap:break-word; } | |
| .swift15-table tr > :last-child { border-right:0; } | |
| .swift15-table tbody tr:last-child td { border-bottom:0; } | |
| .swift15-table .benchmark-heading { color:#B7BDCD; background:#0D111B; border-bottom:3px solid #7D45B5; } | |
| .swift15-table .score-heading { color:#F0C5FF; background:#52239E; border-bottom:3px solid #7D45B5; } | |
| .swift15-table .tokens-heading, .swift15-table .median-heading { color:#D4E8FF; background:#304FC2; border-bottom:3px solid #5687E6; } | |
| .swift15-table .change-heading { color:#61B9FF; background:#101D2D; border-bottom:3px solid #5687E6; } | |
| .swift15-table .change { color:#61B9FF; background:#101D2D; font-weight:700; } | |
| .swift15-table .gain { color:#DDA8FF; background:#171127; font-weight:700; } | |
| .swift15-table .model { padding-left:18px; text-align:left; color:#FFFFFF; font-weight:600; } | |
| .swift15-table strong { color:#FFFFFF; } | |
| .swift15-table .section { padding:8px 18px; text-align:left; color:#B489FF; background:#2A2541; font-weight:700; letter-spacing:.08em; text-transform:uppercase; border-top:1px solid #3A3159; border-bottom:1px solid #3A3159; } | |
| .swift15-table .swift15 { background:#171127; } | |
| .swift15-table thead tr:nth-child(2) .swift15 { color:#D3A0FF; } | |
| .swift15-table .detail { color:#8C94A8; font-size:12px; font-weight:500; } | |
| .swift15-table.swift15-compact { display:table !important; width:100% !important; table-layout:fixed !important; } | |
| @media (max-width: 640px) { | |
| .swift15-table { display:block !important; width:100% !important; max-width:100%; overflow-x:auto !important; -webkit-overflow-scrolling:touch; table-layout:auto !important; } | |
| .swift15-table th, .swift15-table td { min-width:104px; } | |
| .swift15-table th:first-child, .swift15-table td:first-child { min-width:170px; } | |
| } | |
| </style> | |
| <table class="swift15-table"> | |
| <thead> | |
| <tr> | |
| <th class="benchmark-heading" rowspan="2" style="width:32%;text-align:left;padding-left:18px;vertical-align:bottom;">Benchmark</th> | |
| <th class="score-heading" colspan="2">Score</th> | |
| <th class="tokens-heading" colspan="3">Mean tokens</th> | |
| <th class="median-heading">Median tokens</th> | |
| </tr> | |
| <tr> | |
| <th>Base</th> | |
| <th class="swift15">Swift</th> | |
| <th>Base</th> | |
| <th class="swift15">Swift</th> | |
| <th class="change-heading">Reduction</th> | |
| <th class="change-heading">Reduction</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <tr><td class="section" colspan="7">General reasoning</td></tr> | |
| <tr><td class="model">GPQA-Diamond</td><td><strong>86.67%</strong></td><td class="swift15">85.45%</td><td>16,571</td><td class="swift15">9,455</td><td class="change">↓ 42.9%</td><td class="change">↓ 56.6%</td></tr> | |
| <tr><td class="model">MMLU-Pro</td><td><strong>83.19%</strong></td><td class="swift15">82.41%</td><td>5,471</td><td class="swift15">2,521</td><td class="change">↓ 53.9%</td><td class="change">↓ 58.6%</td></tr> | |
| <tr><td class="model">C-Eval</td><td>82.15%</td><td class="swift15"><strong>84.40%</strong></td><td>3,317</td><td class="swift15">1,611</td><td class="change">↓ 51.4%</td><td class="change">↓ 52.4%</td></tr> | |
| <tr><td class="model">IFBench</td><td><strong>76.07%</strong></td><td class="swift15">73.73%</td><td>5,596</td><td class="swift15">2,247</td><td class="change">↓ 59.8%</td><td class="change">↓ 53.5%</td></tr> | |
| <tr><td class="section" colspan="7">Mathematics</td></tr> | |
| <tr><td class="model">AIME 2024–2026</td><td><strong>99.33%</strong></td><td class="swift15">97.11%</td><td>16,972</td><td class="swift15">10,137</td><td class="change">↓ 40.3%</td><td class="change">↓ 44.0%</td></tr> | |
| <tr><td class="model">HMMT (Nov 2025)</td><td><strong>66.67%</strong></td><td class="swift15">64.67%</td><td>20,715</td><td class="swift15">15,282</td><td class="change">↓ 26.2%</td><td class="change">↓ 40.1%</td></tr> | |
| <tr><td class="section" colspan="7">Multimodal</td></tr> | |
| <tr><td class="model">ERQA</td><td><strong>63.25%</strong></td><td class="swift15">61.50%</td><td>4,134</td><td class="swift15">1,653</td><td class="change">↓ 60.0%</td><td class="change">↓ 58.6%</td></tr> | |
| <tr><td class="section" colspan="7">Coding</td></tr> | |
| <tr><td class="model">LiveCodeBench v6</td><td><strong>86.41%</strong></td><td class="swift15">85.99%</td><td>15,990</td><td class="swift15">11,140</td><td class="change">↓ 30.3%</td><td class="change">↓ 33.7%</td></tr> | |
| <tr><td class="section" colspan="7">Agentic coding</td></tr> | |
| <tr><td class="model">Terminal-Bench 2.1*</td><td><strong>57.98%</strong></td><td class="swift15">57.75%</td><td>36,720</td><td class="swift15">27,454</td><td class="change">↓ 25.2%</td><td class="change">↓ 57.0%</td></tr> | |
| <tr><td class="model">DeepSWE v1.1*</td><td>28.32%</td><td class="swift15"><strong>36.58%</strong></td><td>80,594</td><td class="swift15">49,883</td><td class="change">↓ 38.1%</td><td class="change">↓ 41.1%</td></tr> | |
| </tbody> | |
| </table> | |
| <p><strong>* Note:</strong> Thinking Machines benchmarked Inkling 2 Mini on agent tasks with its full 1M-token context window. We consider that unrealistic for local use, so we ran both models at context sizes most people can actually run: 131,072 tokens for Terminal-Bench 2.1 and 262,144 tokens for DeepSWE v1.1.</p> | |
| <details> | |
| <summary><strong>How to reproduce</strong></summary> | |
| <p style="font-size:13px;line-height:1.5;margin:8px 0;"><strong>Serving:</strong> native mixed precision (BF16 attention, NVFP4/MXFP8 experts) · vLLM (<code>vllm/vllm-openai:inkling-2-mini</code> image) · data-parallel across 2 GPUs · context 262,144 · thinking on (<code>enable_thinking=True</code>, <code>reasoning_effort="max"</code>).<br> | |
| <strong>Sampling:</strong> temperature 1.0 · top_p 0.95 · top_k 20 · min_p 0.0 · no repeat penalty.<br> | |
| <strong>Benchmarks:</strong> every benchmark averaged over five seeds (0–4) per model, same caps and scorer for base and Swift.</p> | |
| <table style="display:table;width:100%;border-collapse:collapse;font-size:13px;line-height:1.3;margin:8px 0;"> | |
| <thead><tr><th style="padding:4px 8px;text-align:left;">Benchmark</th><th style="padding:4px 8px;text-align:right;">Runs</th><th style="padding:4px 8px;text-align:right;">Output cap</th></tr></thead> | |
| <tbody> | |
| <tr><td style="padding:3px 8px;">GPQA-Diamond</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">100,000</td></tr> | |
| <tr><td style="padding:3px 8px;">MMLU-Pro</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">100,000</td></tr> | |
| <tr><td style="padding:3px 8px;">C-Eval</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">16,384</td></tr> | |
| <tr><td style="padding:3px 8px;">IFBench</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">81,920</td></tr> | |
| <tr><td style="padding:3px 8px;">AIME 2024–2026</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">250,000</td></tr> | |
| <tr><td style="padding:3px 8px;">HMMT Nov 2025</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">250,000</td></tr> | |
| <tr><td style="padding:3px 8px;">ERQA</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">100,000</td></tr> | |
| <tr><td style="padding:3px 8px;">LiveCodeBench v6</td><td style="padding:3px 8px;text-align:right;">5</td><td style="padding:3px 8px;text-align:right;">100,000</td></tr> | |
| <tr><td style="padding:3px 8px;">Terminal-Bench 2.1</td><td style="padding:3px 8px;text-align:right;">5 per task</td><td style="padding:3px 8px;text-align:right;">agent limit 5 h per task, context 131,072, Harbor 0.20.0 + Terminus 2; thinking tokens per trial (all agent turns)</td></tr> | |
| <tr><td style="padding:3px 8px;">DeepSWE v1.1</td><td style="padding:3px 8px;text-align:right;">3 per task</td><td style="padding:3px 8px;text-align:right;">mini-swe-agent 2.4.6, task time limits; thinking tokens per trial (all agent turns)</td></tr> | |
| </tbody> | |
| </table> | |
| </details> | |
| ## Efficiency across reasoning efforts | |
| Swift Inkling 2 Mini was benchmarked, trained and made to be used at "max" reasoning effort. The Swift version of the model | |
| at "max" uses **30.1% fewer tokens** even when compared to the base model at the default "high" reasoning effort. | |
| Inkling 2 Mini's reasoning effort setting lets users choose how much the model thinks. | |
| For Swift Inkling 2 Mini to be useful across these settings, it needs to reduce thinking while | |
| keeping accuracy close to the base. | |
| <table class="swift15-table"> | |
| <thead> | |
| <tr> | |
| <th class="benchmark-heading" rowspan="2" style="width:32%;text-align:left;padding-left:18px;vertical-align:bottom;">Reasoning effort</th> | |
| <th class="score-heading" colspan="2">Score</th> | |
| <th class="tokens-heading" colspan="3">Mean thinking tokens</th> | |
| <th class="median-heading">Median thinking tokens</th> | |
| </tr> | |
| <tr> | |
| <th>Base</th> | |
| <th class="swift15">Swift</th> | |
| <th>Base</th> | |
| <th class="swift15">Swift</th> | |
| <th class="change-heading">Reduction</th> | |
| <th class="change-heading">Reduction</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <tr><td class="section" colspan="7">GPQA-Diamond</td></tr> | |
| <tr><td class="model">Max</td><td><strong>86.67%</strong></td><td class="swift15">85.45%</td><td>16,571</td><td class="swift15">9,455</td><td class="change">↓ 42.9%</td><td class="change">↓ 56.6%</td></tr> | |
| <tr><td class="model">High</td><td><strong>86.46%</strong></td><td class="swift15">84.44%</td><td>13,523</td><td class="swift15">6,618</td><td class="change">↓ 51.1%</td><td class="change">↓ 60.1%</td></tr> | |
| <tr><td class="model">Medium</td><td><strong>84.75%</strong></td><td class="swift15">80.20%</td><td>5,844</td><td class="swift15">3,027</td><td class="change">↓ 48.2%</td><td class="change">↓ 35.1%</td></tr> | |
| <tr><td class="model">Low</td><td><strong>79.19%</strong></td><td class="swift15">76.77%</td><td>1,940</td><td class="swift15">1,400</td><td class="change">↓ 27.8%</td><td class="change">↓ 17.5%</td></tr> | |
| </tbody> | |
| </table> | |
| ## MTP speculative decoding | |
| The [BF16 weights](https://huggingface.co/ukisai/Swift-Inkling-2-Mini) include the base model's MTP head. These results evaluate its acceptance rate on **GPQA-Diamond (32 questions)**, served with llama.cpp. | |
| <table class="swift15-table swift15-compact"> | |
| <thead><tr> | |
| <th class="benchmark-heading" style="width:40%;text-align:left;padding-left:18px;">Benchmark</th> | |
| <th class="score-heading" style="width:30%;">Base<br>MTP acceptance</th> | |
| <th class="score-heading" style="width:30%;">Swift<br>MTP acceptance</th> | |
| </tr></thead> | |
| <tbody> | |
| <tr><td class="model">GPQA-Diamond<br><span class="detail">BF16 GGUF</span></td><td>48.7%</td><td class="swift15"><strong>49.4%</strong></td></tr> | |
| </tbody> | |
| </table> | |
| Swift keeps the base model's MTP acceptance with the same, unchanged MTP head. | |
| ## Quantized models | |
| Quantized deployment is the intended use for Swift: lower-memory weights paired with | |
| shorter reasoning. The GGUF evaluations below retain token savings on GPQA-Diamond, and Swift | |
| reduces output-cap failures by **59–94%**. | |
| <table class="swift15-table" style="display:table;width:100%;table-layout:fixed;"> | |
| <thead><tr> | |
| <th class="benchmark-heading" style="width:32%;text-align:left;padding-left:18px;white-space:normal;">Benchmark / quantization</th> | |
| <th class="score-heading" style="width:16%;white-space:normal;">Base accuracy</th> | |
| <th class="score-heading" style="width:16%;white-space:normal;">Swift accuracy</th> | |
| <th class="tokens-heading" style="width:18%;white-space:normal;">Mean token reduction</th> | |
| <th class="median-heading" style="width:18%;white-space:normal;">Median token reduction</th> | |
| </tr></thead> | |
| <tbody> | |
| <tr><td class="model">GPQA-Diamond<br><span class="detail">GGUF Q4_K_M · completion tokens</span></td><td>85.45%</td><td class="swift15">85.15%</td><td class="change">↓ 40.4%</td><td class="change">↓ 55.9%</td></tr> | |
| <tr><td class="model">GPQA-Diamond<br><span class="detail">BF16 · thinking tokens</span></td><td>86.67%</td><td class="swift15">85.45%</td><td class="change">↓ 42.9%</td><td class="change">↓ 56.6%</td></tr> | |
| </tbody> | |
| </table> | |
| <details> | |
| <summary><strong>Quantized evaluation settings</strong></summary> | |
| Each row compares the same quantized base with and without the Swift post-training. | |
| GPQA uses five seeds. Output cap: GPQA 100,000. Truncated answers count as incorrect. | |
| Base quantization: a Q4_K_M with the same per-tensor types as Swift's, served with llama.cpp. | |
| The BF16 row is the same run as the BF16 table. | |
| </details> | |
| ## How to use | |
| Download the **whole repository from its root**: | |
| ```bash | |
| hf download ukisai/Swift-Inkling-2-Mini-MLX-4bit --local-dir Swift-Inkling-2-Mini-MLX-4bit | |
| ``` | |
| The full checkpoint is **17.31 GB** and requires all 4 files: | |
| | Weight shard | Size | | |
| |---|---:| | |
| | [model-00001-of-00004.safetensors](https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/resolve/main/model-00001-of-00004.safetensors?download=true) | 5,333,674,701 bytes | | |
| | [model-00002-of-00004.safetensors](https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/resolve/main/model-00002-of-00004.safetensors?download=true) | 5,031,794,018 bytes | | |
| | [model-00003-of-00004.safetensors](https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/resolve/main/model-00003-of-00004.safetensors?download=true) | 4,978,917,256 bytes | | |
| | [model-00004-of-00004.safetensors](https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/resolve/main/model-00004-of-00004.safetensors?download=true) | 1,963,940,606 bytes | | |
| You also need the root config, index, tokenizer and model code files; the command above | |
| downloads them together. | |
| The package is self-contained and uses MLX-LM's `model_file` mechanism. It has been load-validated with MLX-LM 0.32.2. Apple Silicon GPU execution is required for the native NVFP4/MXFP8 expert path; a CPU-only environment is not a supported inference target. | |
| ```bash | |
| pip install -U "mlx-lm>=0.32.2" pillow | |
| ``` | |
| `trust_remote_code=True` is required because `inkling2_loop` is not registered in the released MLX-LM model registry. The repository ships the implementation through `inkling2_loop.py` using MLX-LM's `model_file` hook. | |
| ### Text generation | |
| ```python | |
| from mlx_lm.generate import stream_generate | |
| from mlx_lm.sample_utils import make_sampler | |
| from mlx_lm.utils import load | |
| model, tokenizer = load("ukisai/Swift-Inkling-2-Mini-MLX-4bit", trust_remote_code=True) | |
| messages = [ | |
| {"role": "user", "content": "Summarize the trade-offs between CPU and GPU inference."}, | |
| ] | |
| prompt = tokenizer.apply_chat_template( | |
| messages, | |
| add_generation_prompt=True, | |
| reasoning_effort="max", | |
| tokenize=False, | |
| ) | |
| sampler = make_sampler(temp=1.0, top_p=0.95, top_k=20) | |
| for response in stream_generate(model, tokenizer, prompt, max_tokens=1024, sampler=sampler): | |
| print(response.text, end="", flush=True) | |
| ``` | |
| Supported reasoning-effort values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Sampling parameters may be adjusted for a specific workload. | |
| ### Image input | |
| The repository includes `inkling2_processor.py`, which expands the Inkling image token into the number of tokens required by the vision encoder. | |
| ```python | |
| import json | |
| import os | |
| import sys | |
| import mlx.core as mx | |
| from huggingface_hub import snapshot_download | |
| from mlx_lm.generate import stream_generate | |
| from mlx_lm.sample_utils import make_sampler | |
| from mlx_lm.utils import load | |
| model_path = snapshot_download("ukisai/Swift-Inkling-2-Mini-MLX-4bit") | |
| sys.path.insert(0, model_path) | |
| from inkling2_processor import Processor | |
| model, tokenizer = load(model_path, trust_remote_code=True) | |
| with open(os.path.join(model_path, "config.json")) as file: | |
| config = json.load(file) | |
| processor = Processor.from_config(config) | |
| image = processor.load_image("photo.jpg") | |
| chat_prompt = tokenizer.apply_chat_template( | |
| [{"role": "user", "content": [{"type": "image"}]}], | |
| add_generation_prompt=True, | |
| reasoning_effort="max", | |
| tokenize=False, | |
| ) | |
| image_prompt, pixel_values = processor(chat_prompt, images=[image]) | |
| prompt_ids = tokenizer.encode(image_prompt, add_special_tokens=False) | |
| input_embeddings = model.embed_inputs(mx.array(prompt_ids), pixel_values=pixel_values) | |
| mx.eval(input_embeddings) | |
| sampler = make_sampler(temp=1.0, top_p=0.95, top_k=20) | |
| for response in stream_generate( | |
| model, | |
| tokenizer, | |
| prompt_ids, | |
| max_tokens=1024, | |
| sampler=sampler, | |
| input_embeddings=input_embeddings, | |
| ): | |
| print(response.text, end="", flush=True) | |
| ``` | |
| ## Quantization | |
| The conversion used [Swift Inkling 2 Mini](https://huggingface.co/ukisai/Swift-Inkling-2-Mini). | |
| Eligible non-expert tensors, including embedding and attention/projection weights, are stored in 4-bit affine MLX format with group size 64 (5.247 bits/weight overall). The routed experts retain the source checkpoint's native NVFP4/MXFP8 representation. | |
| Preserving the native expert representation avoids dequantizing the checkpoint to a 52 GB BF16 intermediate and keeps the release close to the source model's storage format. | |
| The upstream DSpark MTP speculative-draft head is not included in this MLX release. It is not required for normal text or image generation with this package. | |
| The benchmark scores above were measured on the [safetensors checkpoint](https://huggingface.co/ukisai/Swift-Inkling-2-Mini), not on these files. | |
| ## License and access | |
| Swift Inkling 2 Mini is a derivative of [Inkling 2 Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini), and both are licensed under the | |
| [Apache License 2.0](https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/blob/main/LICENSE). See [NOTICE](https://huggingface.co/ukisai/Swift-Inkling-2-Mini-MLX-4bit/blob/main/NOTICE) for the change notice and attribution details. | |
| The bundled Inkling MLX architecture and processor helper are based on the upstream MLX-LM Inkling 2 implementation. | |
| ## Citation | |
| ~~~bibtex | |
| @misc{swift-inkling-2-mini, | |
| title = {Swift Inkling 2 Mini}, | |
| author = {UkisAI}, | |
| year = {2026}, | |
| url = {https://huggingface.co/ukisai/Swift-Inkling-2-Mini} | |
| } | |
| ~~~ | |