⚠ การแปลยังไม่ได้อัปเดต ขณะนี้แสดงบทความภาษาอังกฤษ English
Run Inkling 2 Mini on your Mac
Ask Inkling 2 Mini to read a chart or answer a question about a document, with inference running on your Apple Silicon Mac. We added native Swift text and image support to speech-swift and published 4-bit and 5-bit MLX models.
Run either model from Swift or the command line. A separate decision example asks the model to propose the next action for a request, checks it against an allowed list, and falls back to clarify when the output is invalid.
We tested both MLX variants on an Apple M5 Pro with 48 GiB of unified memory. The downloads contain 16.1 GB or 19.2 GB of model tensors; allow more memory for inference.
Ask questions about text and images
You can give Inkling an image and ask about what it shows. We made four simple test images to check whether it could count objects, identify a shape's position, read printed words, and interpret a bar chart. Both MLX downloads, INT4 and INT5, gave the same correct answers:
| What we asked | Reply from both MLX variants |
|---|---|
| How many blue circles are in the image? | 3 |
| What shape is to the left of the blue circle? | Red square |
| Transcribe the printed words in this image. | MEET AT 4 PM |
| Which bar is tallest: A, B, or C? | B |
These are the test images, in the same order as the table, reading left to right across each row:
In the text checks, Inkling explained seasons through Earth's axial tilt and changes in sunlight. Asked for a birthday missing from a supplied passage, it said the passage did not contain it. You can inspect the prompts and final replies in the release transcript.
The validation report includes the prompts, final replies and checks behind these examples.
These examples cover two quantizations on one Mac. Try your own documents and images before choosing a model; the examples do not establish general accuracy.
Choose INT4 or INT5 for your Mac
Both MLX exports start from the same pinned source revision. We convert INT5 from that source, without passing through INT4.
| Expert precision | Model tensor bytes | Decimal size | Weight shards |
|---|---|---|---|
| INT4 | 16,141,320,192 | 16.1 GB | 39 |
| INT5 | 19,198,967,808 | 19.2 GB | 40 |
These sizes cover model tensors. Caches, intermediate arrays, and the tokenizer add to the memory footprint.
About 26 tokens per second on our Mac
On the 48 GiB M5 Pro, both Swift exports generated about 26 tokens per second. We used the same 128-token prompt and generated 64 tokens, with one full warmup and three measured trials. These are release-build results from separate runs on the same shared Mac. Generation ignored EOS to keep the work fixed.
| Model and runtime | Generated tokens/s | Peak physical footprint, GB |
|---|---|---|
| Original checkpoint, pinned MLX-VLM | 23.80 | 24.12 |
| Swift MLX INT4 | 26.54 | 16.93 |
| Swift MLX INT5 | 26.40 | 19.99 |
GB is decimal. Physical footprint includes GPU allocations and the peak during loading, warmup and inference. The linked data also records RSS, which overlaps physical footprint; do not add the two. These figures describe this workload, not the smallest Mac that can run it. The original checkpoint uses native NVFP4 experts in layers 0–19 and MXFP8 in 20–23. Our exports use affine INT4 or INT5 experts, with INT8 attention and vocabulary weights. This comparison changes both runtime and weight format.
We also scored identical token histories from four selected WikiText-2 paragraphs: 32 context tokens followed by 128 scored positions per paragraph, for 512 positions total. Lower perplexity means the model assigned more probability to the actual next tokens in these passages.
| Model | Selected-position perplexity | Top-prediction agreement with original |
|---|---|---|
| Original checkpoint | 9.111 | Reference |
| Swift MLX INT4 | 9.153 | 92.58% |
| Swift MLX INT5 | 9.172 | 94.34% |
INT5 stayed closer to the original next-token distributions on this sample: mean KL divergence was 0.00853 nats per position, compared with 0.01775 for INT4. Its perplexity was slightly higher. Four passages cannot establish a general quality ranking. The machine-readable record contains the method, source revisions, runtime versions and measured ranges.
Download a model and run it
The INT4 bundle and INT5 bundle on Hugging Face include source and conversion records, plus validation results. Build speech-swift using the model card's installation instructions, then download the weights and run:
hf download aufklarer/Inkling-2-Mini-MLX-4bit \
--local-dir /path/to/Inkling-2-Mini-MLX-4bit
.build/release/speech inkling "Reply with only the result of 2 + 2." \
--model-dir /path/to/Inkling-2-Mini-MLX-4bit \
--temperature 0 --max-tokens 512
For INT5, use aufklarer/Inkling-2-Mini-MLX-5bit and its download directory instead. The same runtime reads either bundle's precision from its configuration.
The runtime also accepts an image with --image photo.png. Images count against the context budget; the default limit is 1,024 merged patches per image. Resize larger inputs before inference.
Swift callers use Inkling2Chat from the Qwen3Chat library, with conversation history and cooperative stream cancellation. Run requests on one instance one at a time. This release does not support native tool-call parsing, audio or video input, or DSpark speculative decoding.
Give the model enough room to answer
Inkling can reason before it emits the answer, even with effort set to zero. The runtime suppresses that segment and streams answer text. Hidden reasoning and structural markers still consume the output budget.
Our first 32-token smoke test ended during reasoning and produced an empty visible reply. With a larger budget, the same arithmetic prompt produced 4. The acceptance runs use greedy decoding, effort zero, and a limit of 512 generated tokens. Timings include hidden reasoning and come from a debug build on a shared development machine, so they cannot support a controlled speed comparison.
Use it for local decisions
Inkling can propose an action from text or an image. We added a runnable example that asks for one of answer, summarize, describe_image, or clarify. The example invokes the native Swift CLI and validates the final JSON reply.
python3 scripts/examples/inkling2_decision.py \
"Summarize this note: The train is delayed by ten minutes. The platform has changed to number four." \
--model-dir /path/to/Inkling-2-Mini-MLX-5bit \
--speech .build/release/speech
# {"action": "summarize", "validated": true, "fallback_reason": null}
The wrapper rejects malformed JSON, duplicate keys, extra fields and unknown actions. Missing input or an inference failure returns clarify.
The backend generates free text, so the wrapper parses and validates the final JSON after generation. Decoding does not enforce the schema. A validated proposal passes the format and input checks. Your application must still check that the chosen action suits the request, meets the task's preconditions, and has permission to run. The example executes no actions.
For a short list of text intents, weigh the 16.1–19.2 GB of tensors against a smaller classifier or language model. Image input and context reasoning may justify that size for a more involved routing task. The example starts a CLI process per request; the native Swift API can reuse a loaded instance for requests run one at a time.
How Swift handles the repeated layers
Thinking Machines released Inkling 2 Mini as a 26.4-billion-parameter mixture-of-experts model. It routes each token to eight of 128 experts. Six prelude layers run once, twelve core layers run three times, and six final layers run once: 6 + 12 × 3 + 6 = 48 visits.
Reusing weights avoids storing three copies of the core layers. Each visit still needs its own attention cache and four convolution histories. A cache indexed by the 24 physical layers would mix the histories from different passes, so the Swift runtime keeps separate state for all 48 visits. It carries messages from one core pass into the next.
Local attention retains a sliding history. Global attention keeps the full request history. Relative-position logits depend on backward distance, so the order of cached tokens matters. The default request budget is 8,192 tokens, including the prompt and generated tokens.
The orange weight bank stays shared across passes; the blue bank holds the 48 independent visit states. Open the diagram to read its labels at full size.
How we converted the weights
The released experts use NVFP4 in the first twenty layers and MXFP8 in the last four. The converter decodes the source scales, separates alternating gate and up rows, and writes the affine weight, scale, and bias tensors that MLX Swift loads.
You can choose 4, 5, or 8 bits for expert weights. Attention and vocabulary matrices use 8 bits. The vision encoder, routers, normalization weights, relative-position parameters, and loop controllers retain their source precision. The exporter records the source revision and file hashes.
This conversion changes the weight representation. It does not reproduce the source activation quantization, and a file-size reduction by itself says little about answer quality.
Check the Swift port against a reference
A small reference model exercises full prefill, cached decoding, expert grouping, and the repeated-layer messages. The MLX Swift CPU outputs match the recorded reference exactly for that fixture. Metal outputs stay within the separate GPU tolerance. Full-weight checks cover tokenizer behavior, next-token scores, vision embeddings, and generation through the CLI.
The full BF16 MLX model is not bit-exact across the Python and Swift paths. INT5's top-20 scores had 1.30% normalized RMS drift against Python MLX 0.32.4 and 2.46% against 0.31.1, matching Swift's embedded core. Both agreed on the top token. The release report records the score tolerances, including a maximum-error guard revised after its original INT4 threshold failed INT5. The production inference math did not change for that test adjustment.
Reproduce and inspect
- INT4 weights, source patch, and validation results
- INT5 weights, source patch, and validation results
- speech-swift
- Upstream model card and limitations
- Apache 2.0 license and the upstream model acceptable use policy
The release includes the original model card, license, source configuration, and conversion provenance. Read the upstream limitations alongside the local results.
