|
| 1 | +# Inkling 2 Mini |
| 2 | + |
| 3 | +Back to [README.md](../../README.md) |
| 4 | + |
| 5 | +**Inkling 2 Mini** by Thinking Machines, released on 2026-11-20: a mixture of 128 experts, 8 used a token, in 24 |
| 6 | +layers. Layers 6 to 17 run three times for each token, so a token goes through 48 layers with the weights of 24. Five |
| 7 | +layers in six look back only 1,024 tokens. PolyStrata runs [ggml-org's GGUF files](https://huggingface.co/ggml-org/Inkling-2-Mini-GGUF) |
| 8 | +of it on the strata-poly engine. |
| 9 | + |
| 10 | +**It is experimental and new.** Support was added on 2026-11-21. It has run on one PC so far (below). Its answers were |
| 11 | +checked against llama.cpp on the same file: the same next token on every prompt, and the same tokens in 32-step |
| 12 | +answers except where llama.cpp's two best tokens were almost tied. |
| 13 | + |
| 14 | +## How fast is it? |
| 15 | + |
| 16 | +> **Measured on:** RTX 2070 Super 8 GB, Ryzen 5 3600XT, 62 GB DDR4, Ubuntu 22.04, one request, warm file cache, the |
| 17 | +> server's flags (128K context, q8_0 caches). |
| 18 | +
|
| 19 | +| | IQ4_NL prompt | IQ4_NL writing | UD-Q2_K_XL prompt | UD-Q2_K_XL writing | |
| 20 | +| --- | ---: | ---: | ---: | ---: | |
| 21 | +| 302-token prompt | 270 tokens/s | 37.4 tokens/s | 366 tokens/s | 46.9 tokens/s | |
| 22 | +| 1,500-token prompt | 434 tokens/s | 36.7 tokens/s | 544 tokens/s | 45.2 tokens/s | |
| 23 | +| 34,800-token prompt (IQ4_NL, through the server) | 232 tokens/s | 28.1 tokens/s | | | |
| 24 | + |
| 25 | +IQ4_NL's speed depends on its expert profile (`--expert-profile`, which the server keeps up to date): it chooses the |
| 26 | +experts the card holds. On 100 questions (50 GSM8K, 50 MMLU-Pro, greedy, medium reasoning) IQ4_NL got 49 and 44 |
| 27 | +right, UD-Q2_K_XL 48 and 41; the two gave the same answer to 92 of the 100. |
| 28 | + |
| 29 | +About 4.6 GB of experts fit on the 8 GB card. The engine used 7.7 GB of VRAM at most and 16.5 GiB of RAM (IQ4_NL). |
| 30 | + |
| 31 | +## What you need |
| 32 | + |
| 33 | +| | | |
| 34 | +| --- | --- | |
| 35 | +| **Graphics card** | One **NVIDIA** card. About 3.1 GB of VRAM before any expert at an 8K context (measured on an 8 GB card), about 4 GB at 32K. | |
| 36 | +| **RAM** | About **22 GB** (IQ4_NL), **14 GB** (UD-Q2_K_XL) or **32 GB** (Q8_0) beside an 8 GB card, setup's estimate (the engine itself used 16.5 GiB with IQ4_NL, 9.1 GiB with UD-Q2_K_XL). The experts the card does not hold stay in RAM. Beside a 24 GB card the IQ4_NL file's experts fit in VRAM by the same estimate. | |
| 37 | +| **Disk** | 17.6, 9.1 or 27.8 GB for the model file. | |
| 38 | +| **System** | Linux and a current NVIDIA driver. Setup asks before it installs it on Windows: it was not tried there. | |
| 39 | + |
| 40 | +It is not offered on AMD or Intel cards or on a Mac: the engine code for it was written for NVIDIA cards only. For now |
| 41 | +it also runs on one card (no layer split) and answers one request at a time (no `--parallel`); setup leaves those |
| 42 | +options out for it. Its attention caches are fp16, or q8_0 with `--kv q8_0`, which halves them: a 128K context then |
| 43 | +takes about 2.3 GB of VRAM when it is full, in fp16 4.3 GB. On an 8 GB card, use q8_0 for contexts past 32K. It reads text only for now. The repository has |
| 44 | +an image encoder too, which setup does not download. It has no draft model, so it writes one token at a time. |
| 45 | + |
| 46 | +## Install |
| 47 | + |
| 48 | +```bash |
| 49 | +./setup.sh --family inkling |
| 50 | +``` |
| 51 | + |
| 52 | +```bash |
| 53 | +./setup.sh --family inkling --model UD-Q2_K_XL |
| 54 | +``` |
| 55 | + |
| 56 | +```bash |
| 57 | +./setup.sh --family inkling --model Q8_0 |
| 58 | +``` |
| 59 | + |
| 60 | +## Which model should I pick? |
| 61 | + |
| 62 | +| Size | What it is | Download | RAM beside an 8 GB card (estimate) | |
| 63 | +| --- | --- | ---: | ---: | |
| 64 | +| **IQ4_NL** | 4-bit experts in layers 0 to 19 (with an importance matrix), 8-bit everywhere else | 17.6 GB | about 22 GB | |
| 65 | +| **UD-Q2_K_XL** | Unsloth's: 2-bit experts (Q2_K, IQ1_S and Q2_0), higher where it matters. The fastest, a little less accurate | 9.1 GB | about 14 GB | |
| 66 | +| **Q8_0** | 8-bit throughout: the closest to the model as trained | 27.8 GB | about 32 GB | |
| 67 | + |
| 68 | +Setup takes IQ4_NL unless you name another size. UD-Q2_K_XL comes from Unsloth's repository in the architecture's |
| 69 | +native form (`inkling2`, the loop not unrolled); the engine reads that form as it is. Q8_0 was not run. ggml-org's model card gives the KL divergence against the BF16 file on |
| 70 | +wikitext-2: 0.0030 for Q8_0 and 0.0095 for IQ4_NL. PolyStrata did not measure that. |
| 71 | + |
| 72 | +## How it talks |
| 73 | + |
| 74 | +The server reads these from the tokenizer that setup writes from the GGUF (`pre` = `inkling2`): |
| 75 | + |
| 76 | +- **Tokens.** Byte-level BPE with 200,058 tokens, llama.cpp's `inkling2` split (its GPT-4o pattern) and, as in the |
| 77 | + model's `tokenizer.json`, `ignore_merges`: a piece that is a token as a whole is that token. No token starts a |
| 78 | + prompt. A reply ends at `<|content_model_end_sampling|>` (the GGUF's end of text) or at `<|endoftext|>`. |
| 79 | +- **Reply.** A reply is a list of blocks. Each starts with `<|message_model|>` and ends with `<|end_message|>`. A |
| 80 | + `<|content_thinking|>` block is the reasoning, a `<|content_text|>` block is the answer, and a tool call is |
| 81 | + `<|message_model|>NAME<|content_invoke_tool_json|>{"name":"NAME","args":{...}}<|end_message|>`. This is the form |
| 82 | + llama.cpp reads (its Inkling parser, ggml-org/llama.cpp PR 32381). The model writes the first header itself. |
| 83 | +- **Reasoning effort.** The template writes "Thinking effort level" in a system block. `reasoning_effort` low, medium |
| 84 | + and high give 0.2, 0.7 and 0.9. High (0.9) is the default. Thinking turned off gives 0. The model can still think a |
| 85 | + little at 0: its model card says the lowest effort does not turn reasoning off. "xhigh" and "max" are 0.9 too: |
| 86 | + the template's 0.99 is not offered. |
| 87 | +- **Sampling.** Setup writes the GGUF's own defaults into the run config: temperature 1.0, top_k 50, top_p 1.0. A |
| 88 | + `"sampling"` block you wrote yourself is kept. |
| 89 | +- **Forced calls.** `tool_choice` naming one tool is written for the model after its thinking, or at the start of |
| 90 | + the reply with thinking off. The reply ends with that call: a block the model opens after it is not sent. |
| 91 | + `"required"` with several tools is left to the model. |
| 92 | + |
| 93 | +## How it was checked |
| 94 | + |
| 95 | +Token ids against Hugging Face's `tokenizers` library on the model's `tokenizer.json`, the reference. Prompts and |
| 96 | +replies against llama.cpp 29b52d398b, the commit that added the model, built on the CPU and run without the model's |
| 97 | +weights. 53 of the strings, the 14 prompts and the 11 replies are kept in `serve/fixtures/` and checked by |
| 98 | +`serve/test_inkling.py`. |
| 99 | + |
| 100 | +- **Tokens.** 1,006 strings, about 587,000 tokens: English, Japanese, Chinese, Korean, Arabic, Hindi and Russian text, |
| 101 | + code, emoji, whitespace runs, control tokens, PolyStrata's docs and source in pieces, and 300 random strings. Every |
| 102 | + id was the same as Hugging Face's. llama.cpp's differed in 11 of the strings (see below). |
| 103 | +- **Prompts.** 14 requests rendered by llama.cpp's chat code and by the server were the same text: effort levels, a |
| 104 | + system prompt, tools, two tool calls and their answers, earlier reasoning, Unicode and quotes. |
| 105 | +- **Replies.** 11 replies (llama.cpp's own Inkling tests and a few more) gave the same reasoning, answer and tool calls, |
| 106 | + fed whole, in 5-character pieces and one character at a time. |
| 107 | + |
| 108 | +The engine's output was checked against llama.cpp's on the same files, IQ4_NL and UD-Q2_K_XL, for a short prompt and prompts |
| 109 | +of 302 and 1,500 tokens: the logits' cosine similarity was about 0.999, and greedy decoding chose the same token in |
| 110 | +30 to 32 of 32 steps (the others where the top two tokens were nearly tied). |
| 111 | + |
| 112 | +## Known differences |
| 113 | + |
| 114 | +- llama.cpp 29b52d398b does not set `ignore_merges` for `inkling2`, so a word that is one token but that no chain of |
| 115 | + merges reaches comes out as several there: `kwargs` is one token here and with Hugging Face, three in llama.cpp. |
| 116 | + That changed 11 of the 1,006 strings above. PolyStrata follows Hugging Face. llama.cpp's ids are kept beside the |
| 117 | + reference ones in `serve/fixtures/inkling2_golden.json`. |
| 118 | +- A message whose content is a list of text parts is one block here and one block a part in llama.cpp. The server |
| 119 | + joins the parts for every model. |
| 120 | +- llama.cpp checks a tool call against the declared tools with a grammar while the model writes it. PolyStrata has no |
| 121 | + grammar: it reads the call when its block is closed. A call to a tool that was not declared is shown as text. |
| 122 | + |
| 123 | +## How does it work? |
| 124 | + |
| 125 | +The engine side is in `src/poly/inkling.cpp`. The server side is `InklingParser` in `serve/frontend.py`, and the tests |
| 126 | +are `serve/test_inkling.py` and `tools/test_setup_inkling.py`. |
0 commit comments