Skip to content

Commit 9702b2b

Browse files
okada-shogoclaude
andcommitted
setup: Inkling 2 Mini as an experimental family (one NVIDIA card, Linux)
setup --family inkling installs ggml-org's IQ4_NL (the default) or Q8_0, or Unsloth's UD-Q2_K_XL, each pinned and checked by SHA-256, with q8_0 caches allowed. The family is CUDA only, so the Mac setup leaves it out. docs/models/inkling.md has what was measured, what was checked and what was not run (Q8_0, Windows, AMD); the README, AI_SETUP, BACKENDS and the MCP server's catalog list it. On 100 questions (50 GSM8K, 50 MMLU-Pro, greedy) IQ4_NL got 93 right and UD-Q2_K_XL 89. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 182e028 commit 9702b2b

10 files changed

Lines changed: 382 additions & 16 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ with an 8 GB card as well.
4848
own, made to read pictures: a file of 16 to 29 GB.
4949
- **[Kolibri 1](docs/models/kolibri.md)** by Aleph Alpha, which writes German as well as English: a file of 29 to 48 GB,
5050
most of which stays in RAM beside a small card.
51+
- **[Inkling 2 Mini](docs/models/inkling.md)** by Thinking Machines, experimental: a file of 9 to 28 GB, on one NVIDIA
52+
card under Linux.
5153

5254
The server can change between installed models while it runs ([how](docs/BACKENDS.md#changing-the-model)).
5355

‎docs/AI_SETUP.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ one 32 GB V100 wrote 91 tokens/s and read a 32K prompt at 1,017 tokens/s (first
121121
layers split wrote 93 and read it at 2,179 (first token 15.3 s); three runs, the medians above. `--model`
122122
takes Q4_K_M, Q2_K on a PC with little RAM, or Q3_K_M by name. The support is new, the GGUF independent: ask first.
123123

124+
`--family inkling` (Inkling 2 Mini, by Thinking Machines, in ggml-org's GGUF files) is the newest model on the same
125+
engine, and experimental: Linux, one NVIDIA card, one request at a time, text only, a 17.6 GB (IQ4_NL), 9.1 GB
126+
(`--model UD-Q2_K_XL`, Unsloth's, the fastest) or 27.8 GB (`--model Q8_0`) download, about 22, 14 or 32 GB of RAM
127+
beside an 8 GB card by setup's estimate. On an 8 GB RTX 2070 Super it wrote 37 tokens/s with IQ4_NL and 47 with
128+
UD-Q2_K_XL ([its page](models/inkling.md)). Take it only when the user asks for it.
129+
124130
## 4. Run setup without questions
125131

126132
From the PolyStrata folder (Windows: in `cmd`, or `cmd /c START-HERE.bat ...` from PowerShell):

‎docs/BACKENDS.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ straight to it. The larger models have pages of their own,
9999
| `clover` | Clover-35B-A3B-Preview | maternion Q3_K_M | 16.8 GB | about 20 GB |
100100
| | | IsValorum APEX-I-NanoPlus | 12.6 GB | about 16 GB |
101101
| | | maternion Q4_K_M | 21.2 GB | about 25 GB |
102+
| `inkling` | Inkling 2 Mini (experimental) | ggml-org IQ4_NL | 17.6 GB | about 22 GB |
103+
| | | Unsloth UD-Q2_K_XL | 9.1 GB | about 14 GB |
104+
| | | ggml-org Q8_0 | 27.8 GB | about 32 GB |
102105

103106
Kolibri 1's file is 29 to 48 GB, so its three numbers are the RAM beside an 8 GB card: an 8 GB card holds
104107
about a tenth of its 19,200 experts, reads the rest through the OS cache; a 32 GB card fits about two thirds
@@ -250,9 +253,12 @@ and, by the tokenizer's `pre` name, how the model writes its reasoning and its t
250253
| LFM2.5 | the prompt opens it, `</think>` ends it | `<\|tool_call_start\|>[NAME(K='V', ...), NAME2()]<\|tool_call_end\|>` |
251254
| Flint | `<think>` to `</think>`, opened by the model | as GLM's |
252255
| Kolibri 1 | the prompt opens it, `</think>` ends it | a JSON object in the wrapper: `{"name": NAME, "arguments": {...}}` |
256+
| Inkling 2 Mini | a `<\|message_model\|><\|content_thinking\|>` block, opened by the model, to `<\|end_message\|>` | `<\|message_model\|>NAME<\|content_invoke_tool_json\|>{"name":NAME,"args":{...}}<\|end_message\|>` |
253257

254258
Gemma 4's template thinks only when it is told to, reads a tool in OpenAI's shape and starts with the tokenizer's
255-
`<bos>`; the server gives it all three. A tool's answers are put in the order of their calls for every model,
259+
`<bos>`; the server gives it all three. Inkling 2 Mini's template reads only `reasoning_effort` (thinking off is its
260+
`none`) and has no generation prompt: the model writes its reply's first header itself
261+
([its page](models/inkling.md#how-it-talks)). A tool's answers are put in the order of their calls for every model,
256262
because a model reads them by position.
257263

258264
## The registry

‎docs/models/inkling.md‎

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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`.

‎metal/setup_mac.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
# Smaller architectures use strata-poly, not the fixed Qwen3.8 Metal window.
4848
# Keep their files, revisions, sizes and checksums in setup.py's single catalog.
4949
# The native port is opt-in through --family; the existing Qwen3.8 defaults stay unchanged.
50-
MAC_POLY_FAMILIES = tuple(f for f, d in S.FAMILIES.items() if d.get("engine") == "poly")
50+
# (a family marked "cuda_only", Inkling 2 Mini, has no Metal code)
51+
MAC_POLY_FAMILIES = tuple(f for f, d in S.FAMILIES.items() if d.get("engine") == "poly" and not d.get("cuda_only"))
5152

5253

5354
def smaller_model_catalog() -> dict:

0 commit comments

Comments
 (0)