Skip to content

Add support for Inkling 2 Mini - #70

Merged
ihavespoons merged 3 commits into
mainfrom
inkling-2-mini
Nov 21, 2026
Merged

ihavespoons merged 3 commits into
mainfrom
inkling-2-mini

Conversation

@ihavespoons

@ihavespoons ihavespoons commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Sibyl can now run Inkling 2 Mini (thinkingmachines/Inkling-2-Mini). The model is a looped Mixture of Experts model: its middle 12 layers run 3 times for each token. llama.cpp reads it as the inkling2_loop architecture from b12600 (ggml-org/llama.cpp#32694).

Changes

  • The HIP and Vulkan images move from llama.cpp b11889 to b12600. I compared common/arg.cpp and common/speculative.cpp of both releases: b12600 takes every llama-server flag and every --spec-type value that Sibyl writes.
  • Meta counts one KV cache for each pass through a looped layer (loop.start, loop.end, loop.count). The released code counts 4 caches for this model, and llama.cpp keeps 8.
  • Meta counts the attention mask that llama.cpp keeps for each head of a model with a relative-position bias (Meta.MaskHeads). The cost grows with the micro-batch size, so BytesPerToken, ContextBytes and FitInput now take the ubatch setting.
  • DetectReasoning reads levels that a chat template keeps as the keys of a map, and follows an alias of an alias. The form now offers none, minimal, low, medium, high, xhigh and max for this model. The template refuses any other value with a Jinja exception.
  • The download picker takes the Unsloth files. unsloth/Inkling-2-Mini-GGUF keeps its files for mainline llama.cpp as Mainline_Support/<name>.gguf_file. hf.Variants offers each of them under the plain name, in place of the .gguf file at the top, which declares the inkling2 architecture with Unsloth's loop keys. The download saves it with the .gguf extension.
  • The HIP and Vulkan builds apply ggml-org/llama.cpp#32704 from containers/llama-swap/patches/. llama.cpp did not merge it yet. Without it, the second and third pass through the looped layers run the NVFP4 experts of the Unsloth files without their scales. git apply fails the build if the patch stops applying.
  • os/Containerfile has the current fedora-bootc:44 digest. Quay deleted the pinned one, and the os-image job failed with not found.
  • Dependabot now leaves a new Fedora release alone. PR Bump: Bump fedora/fedora-bootc from 44 to 45 in /os #64 (Fedora 45) is a major update, which does not merge by itself, and while it was open Dependabot opened no pull request for the Fedora 44 digest.
  • hf.Variants leaves imatrix files out. The picker listed imatrix.gguf of ggml-org/Inkling-2-Mini-GGUF as a model.
  • docs/guides/models.md has a section for the model, and docs/design/overview.md records the measurements.

Measurements

Host: the test host, two Radeon RX 7900 XTX, ROCm. Build: llama.cpp b12600 (29b52d3) from the build stage of Containerfile.hip with GPU_TARGETS=gfx1100. File: Inkling-2-Mini-IQ4_NL.gguf (17.6 GB), which the System API of the installed release downloaded and verified.

Test (llama-bench) Tokens per second
Prompt, 512 tokens, GPU 1 1,448
Prompt, 4,096 tokens, GPU 1 1,122
Generation, GPU 1 29.9
Generation, GPU 0 25.4
Prompt, 512 tokens, layer split across both GPUs 111
Generation, layer split across both GPUs 10.6

GPU 0 of the test host is on a PCIe 3.0 x1 link, which makes the split result worse than on most hosts.

KV cache Micro-batch Measured bytes per context token Estimate
f16 512 133,978 134,144
q8_0 512 118,616 118,784
f16 256 83,350 83,456
f16 1,024 235,206 235,520

Each value is the change in VRAM between two context sizes. The released estimate for this model is 24,576 bytes per token, so it chooses the native context of 1,048,576 tokens. A 65,536-token context at f16 did not load on one 24 GB GPU.

The Unsloth UD-Q4_K_XL file, on the same build plus the patch, answered 391 for 17 * 23 and Canberra for the capital of Australia, returned a correct get_weather tool call, and gave 1,382 tokens per second for the prompt and 30.0 for generation in llama-bench. I did not run that file on a build without the patch.

For the ggml-org file, llama-server answered chat requests at 29.4 to 29.8 tokens per second, returned a correct get_weather tool call, and returned HTTP 500 for reasoning_effort: "bogus".

Not in this change

  • The NVIDIA image stays at llama.cpp b11889, without the patch. The newest ghcr.io/ggml-org/llama.cpp:full-cuda-* tag is b12464, which is older than b12600. An NVIDIA host cannot load the model until llama.cpp publishes a later CUDA image.
  • Vision. Sibyl does not download or load mmproj files for any model, so Inkling 2 Mini reads text only.
  • The DSpark drafter of the model. llama.cpp b12600 cannot run it (ggml-org/llama.cpp#32218 is open).
  • The new --spec-type values draft-dflash2 and draft-lilicorr of b12600.

Verification

go vet ./... && go test -race ./... && golangci-lint run ./...

All three pass, and golangci-lint reports 0 issues. I did not run the arm64 image build or actionlint on the laptop. CI builds the images.

🤖 Generated with Claude Code

ihavespoons and others added 3 commits November 21, 2026 14:08
Inkling 2 Mini (thinkingmachines/Inkling-2-Mini) is a looped Mixture of
Experts model. llama.cpp reads it as the inkling2_loop architecture from
b12600.

- Move the HIP and Vulkan images from llama.cpp b11889 to b12600. b12600
  still takes every llama-server flag and --spec-type value that Sibyl
  writes. The CUDA image stays at b11889, because llama.cpp publishes no
  full-cuda image later than b12464.
- Count one KV cache for each pass through a looped layer (loop.start,
  loop.end, loop.count).
- Count the attention mask that llama.cpp keeps for each head of a model
  with a relative-position bias. The cost grows with the micro-batch
  size, so the fit now takes the ubatch setting.
- Read reasoning levels that a chat template keeps as the keys of a map,
  and follow an alias of an alias to reasoning_effort.
- Leave imatrix files out of the download variants.

Measured on the test host with one RX 7900 XTX and the IQ4_NL file:
1,448 tokens per second for the prompt and 29.9 for generation. The
estimate per context token is within 0.2% of four measurements, which
internal/models/meta_test.go holds.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Quay deleted the pinned fedora-bootc:44 manifest, so the os-image build
failed with "not found" on every pull request.

Dependabot offered Fedora 45 as a major update, which does not merge by
itself. While that pull request was open, Dependabot opened none for the
digest of Fedora 44. Dependabot now leaves a new Fedora release alone,
as it does for ROCm and Ubuntu.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
unsloth/Inkling-2-Mini-GGUF is the most downloaded GGUF repository of
the model. Its files at the top use a layout that mainline llama.cpp
cannot load. Its files for mainline llama.cpp are in Mainline_Support,
with the extension .gguf_file.

- The download picker takes a .gguf_file file under the plain name of
  the model, in place of the .gguf file of the same name, and saves it
  with the .gguf extension.
- The HIP and Vulkan builds apply ggml-org/llama.cpp#32704, which
  llama.cpp did not merge yet. Without it, the later passes through the
  looped layers run the NVFP4 experts without their scales.
  containers/llama-swap/patches/README.md says when to remove it.

On the test host, the UD-Q4_K_XL file answered chat and tool-call
requests correctly on the patched build, at 30.0 tokens per second.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@ihavespoons
ihavespoons merged commit 6704c86 into main Nov 21, 2026
15 checks passed
ihavespoons added a commit that referenced this pull request Nov 21, 2026
ggml-org/Inkling-2-Mini-GGUF gives attention.head_count as a list of 24
values, one for each layer. metaFrom read it as one number, got 0 heads,
and left the attention mask term out of the memory estimate. The test
of #70 used one number, so it did not show this.

On the test host, the fit then chose a context of 118,784 tokens for one
24 GB GPU, at 49,152 bytes for each token. llama-server needs 133,978,
and it exited when the model loaded.

metaFrom now takes the largest value of the list, and the test header
gives both head counts as lists, as the file does.

Co-authored-by: Claude Fable 5.2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant