Instructions to use thinkingmachines/Inkling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thinkingmachines/Inkling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="thinkingmachines/Inkling") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("thinkingmachines/Inkling") model = AutoModelForMultimodalLM.from_pretrained("thinkingmachines/Inkling", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thinkingmachines/Inkling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thinkingmachines/Inkling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thinkingmachines/Inkling", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/thinkingmachines/Inkling
- SGLang
How to use thinkingmachines/Inkling with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "thinkingmachines/Inkling" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thinkingmachines/Inkling", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "thinkingmachines/Inkling" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thinkingmachines/Inkling", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use thinkingmachines/Inkling with Docker Model Runner:
docker model run hf.co/thinkingmachines/Inkling
Notes from an independent NVFP4 port of Inkling on One RTX 5090
What was converted. Inkling (952B total / 28B active, architectureinkling_mm_model, text tower inkling) was adapted to the C++20/CUDA
Blackwell-only engine. The pure-BF16 checkpoint (108 safetensors shards) becomes
a 500 GB tree: the dense planes upload to a single RTX 5090 (~14.3 GiB
resident) and the 16 384 routed-expert records (256 experts × 64 MoE layers)
stay memory-mapped on the host and stream in per token. The vision (8 tensors),
audio (2) and MTP (160) towers are ballast — counted in the index, never applied.
This is a NEW family member, not a sibling of Inkling-2-Small. The base
release is a different architecture: no RoPE and no relative-bank clipping
(the bank is a plain learned bias over distance), attention scale 1/head_dim
with per-head RMS-normed q/k, static short convolutions conv(x)+x with no
normalizer, a plain residual (no depth-mixing block stack), 256 experts
top-6 + 2 shared-sink, a muP /24 head and no softcap. It shares the family
name and the tiktoken tokenizer (kind 2), nothing else.
Pure BF16 → standard NVFP4. Unlike the sibling (which carried the release's
own mixed NVFP4/MXFP8 precision verbatim), the base release is pure BF16, so
every dense and routed weight is requantized to NVFP4 (E2M1 nibbles, per-16
E4M3 block scales, per-tensor global scale amax/6). Norms, biases, the
relative bank, the short-conv taps, the router and embed/unembed stay high
precision. The requantization is faithful: the engine matches the release's own
modelling code (driven on the real weights, bf16, truncated layers) at every
layer 0–6 with cosine 0.999+ (relL2 3e-3…4.8e-2, the bf16-vs-fp32 rounding
floor). Knowledge sanity perplexity 3.84 (< log(100) = 4.6).
The two defects that cost the model its knowledge
Both were invisible to every byte-level check and were caught only by the
release modelling code driven on real weights — the same lesson the sibling
taught, recurring on a different release.
The routed
w13_weightis ROW-INTERLEAVED, not halves. The releaseconversion_mapping.py("inkling_mm_model") appliesInterleave(dim=1)to
de-interleave[g0,u0,g1,u1,…]into[gate;up]before the forward chunks the
output — exactly as it does forshared_w13_weightand the densew13_dn.
The converter (and both of my references, and my first HF oracle) split the
slab in halves, pairing every gate row with the wrong up row. Every MoE layer
diverged from the release forward (L2 relL2 jumped 7e-3 → 4e-2, L5/L6 cos
0.86). The fix isTakeParityRows(gate = even rows, up = odd), pinned
test-first by flipping the fixture'sRoutedW13to interleaved and the
ROW PAIRING 3 assertion. After the fix the reference matches the release at
every layer (cos 0.9998+).The base release's residual stream genuinely explodes — FP16 overflows at
five points. The residual reaches1.3e6 by layer 65 (1.9e5 at layer 8
position 0). This is the model's own bf16 behaviour, not a defect: the fp32
reference reproduces it and matches the release. But FP16 (max 65504)
overflowed at: the residual stream itself, the residual-path short convs
(~1.9e5), the expert/shared down GEMV (a shared expert reached ~9.6e5),
and the wo attention-output projection (attn_o ~881 × wo at the deep
layers). Each overflow produced NaN that propagated to the K cache and killed
decoding. The fix carries the residual in FP32 end to end:RunNormF32,RunShortConvF32,RunExpertAccumulateF32/RunSharedAccumulateF32, andProjF32for wo. Raw and framed prompts now
decode at all lengths without NaN.
What the checkpoint forced into the engine
- Rel-bank attention, no RoPE. Each token's relative state (
r_proj, 16
profiles) projects onto a learned bank spanningrel_extentbackward
distances (1024 full / 512 sliding) and gathers one bias per distance, zero
beyond the extent. q/k are RMS-normed per head; scale is1/head_dim. - Hybrid attention. 55 sliding layers (window 512, 16 kv heads) and 11 full
layers (ids {5,11,…,65}, 8 kv heads, extent 1024). 64 q heads × 128, q_dim
8192 ≠ hidden 6144. - Four static short convolutions per layer (
conv(x)+x, k=4, no
normalizer): on raw k, raw v, post-attention, post-MLP. The v conv output must
be stored back to the KV cache (the first defect fixed: it was computed but
never written, so the cache held the raw v projection). - MoE routing is sigmoid with a selection-only bias, joint renorm over the
6 selected routed + 2 shared logits (logsigmoid, softmax, × route_scale 8 ×
gate.global_scale). The router weight has 258 rows (256 routed + 2 shared);
the bias covers only the 256 routed. Both stay high precision. - muP head: final hidden
/24before unembed, no softcap. eos 200006, no BOS. - Inline reasoning. The model emits
<|content_thinking|>(200008) first,
reasons, then<|content_text|>(200004) before the answer. SelfCheck usesanswer_window=48/selfcheck_max_gen=48; CODE usesanswer_start_token_id=200004to cut to the final answer; FSI/CODE/DET usemax_new_tokens=1024so the reasoning span completes.
Gates (real tree, kOff, one target at a time)
| gate | result |
|---|---|
| SelfCheck | PASS ×3 bit-exact, framed Paris ("The capital of France is Paris.") |
| FSI | 3/3 (template-derived golden, 1024 budget) |
| CODE | 3/3 (template-derived, answer_start_token_id=200004) |
| DET | 3/3 (deterministic) |
| tool round-trip | PASS (get_weather{"city":"Paris"}) |
| knowledge sanity | perplexity 3.84 |
FSI/CODE/DET goldens are template-derived (the 952B source is not runnable
locally) and say so in source. The CODE-03 regex failure was an extraction
artifact, not a model defect: the model's answer was correct
(\b[0-9A-F]{4}\b), but the first-anchor extractor grabbed a reasoning bullet
((so [0-9A-F])); answer_start_token_id resolves it.
Perf
Read-bound, as the pre-engine estimate predicted (~0.5–1.5 t/s): 28B active of
952B, the per-token expert read dominates. Seeded 1.68 t/s (perf) / 1.66 t/s
(r3) at the canonical 2048-token protocol, TTFT ~15.2 s, ~132 W on a 575 W
card (tests/perf/perf_baselines.json, Release harness). The card is barely
loaded — the wall is the per-token expert read, not compute. Re-measured clean
(GPU idle, no concurrent workload): 1.68 / 1.66 t/s, agreeing within ~1%.
The full ingestion report — including the internal evidence, CTest gate targets (test_inkling_moe_base_*), end-to-end FP32 residual kernels, and the C++20/CUDA runtime — is available in the public repository:
• Full Ingestion Report: https://github.com/Alex7MV/logestix/blob/main/docs/model-reports/2026-11-18-Inkling.md
• Repository: https://github.com/Alex7MV/logestix