Inkling-2-Mini — CMF

Inkling-2-Mini, Thinking Machines' 26.4B mixture-of-experts model (3.4B parameters active a token; its 12 middle layers run three times, 5.4B effective), packaged as a single CMF file. It runs with cortiq, a Rust inference engine with no Python and no ML framework: NVIDIA GPUs through CUDA or Vulkan, AMD and Intel GPUs through Vulkan/DX12, Apple silicon through Metal, and the CPU. The file holds the language model and the release's DSpark drafter; the vision tower is not in it. Measured:

  • 15.12 GB, every weight on one 24 GB card. NVIDIA L4, CUDA: 50.9 tok/s; a 2 048-token prompt is read in 1.30 s and a 32 768-token one in 31.5 s, after which it writes 39.1 tok/s in 15.9 GB of the card.
  • DSpark speculative decoding on CUDA: the drafter shipped with the release proposes tokens that the model checks in one call; on the L4 70.8 tok/s on code and 63.8 on JSON instead of 49.5.
  • NVIDIA RTX PRO 6000 Blackwell: 220.1 tok/s, a 2 048-token prompt in 0.15 s; with DSpark 279.9 tok/s on code.
  • The same L4 over Vulkan: 35.4 tok/s; MacBook Air M4 (24 GB): 25.0 tok/s through Metal, 10.3 on the CPU alone.
  • Accuracy: WikiText-2 perplexity 9.058 against 8.944 for the release's own weights in f32 (Transformers), 7.379 against 7.310 over windows of 4 096 tokens; CUDA, Vulkan and Metal agree within 0.1 %.

English · Русский · 中文

Quick start

cargo install cortiq-cli --features cuda
hf download infosave/Inkling-2-Mini-cmf Inkling-2-Mini-q4tp.cmf --local-dir .
CMF_GPU=cuda cortiq run Inkling-2-Mini-q4tp.cmf --prompt "Why is the sky blue? Answer in three sentences."

Use cortiq 0.9.15 or later; prebuilt binaries for Linux, macOS and Windows are on the releases page. Leave out --features cuda and CMF_GPU=cuda for Vulkan, Metal or the CPU.

Files

file quantization size WikiText-2 ppl Rust ppl Python ppl WikiText-2, 4 096-token windows
Inkling-2-Mini-q4tp.cmf 4-bit: routed experts, attention and the other dense matrices; head 8-bit; drafter 8-bit 15.12 GB 9.058 3.150 2.864 7.379
reference: Transformers f32 the release's NVFP4 / MXFP8 experts, decoded 19.53 GB 8.944 3.124 2.851 7.310

Perplexity over 12 windows of 512 tokens on WikiText-2 test, 1.8 MB of Rust and 477 KB of Python, and over 2 windows of 4 096 tokens of WikiText-2, the same windows for every row, on CUDA. The release ships its routed experts in NVFP4 (layers 0–19) and MXFP8 (20–23); they are decoded and re-encoded as q4tp. The attention, its output gate and relative-position projections are GPTQ-rounded on 3 072 tokens of prose, Rust and Python that the evaluation texts do not hold; the head is 8-bit, the embedding f16, the routers, convolutions, block-mixing queries and message gates f32. The drafter's matrices are 8-bit, its norms and recurrence f32. The reference runs the release's layers (transformers PR #51050) in f32 with the experts decoded exactly.

The same file on the other backends:

backend WikiText-2 ppl WikiText-2, 4 096-token windows
CUDA (NVIDIA L4) 9.058 7.379
Vulkan (NVIDIA L4) 9.058 7.376
Metal (Apple M4) 9.052 7.377

Speculative decoding (DSpark)

The release ships a drafter (mtp.safetensors): three dense layers that read the model's hidden states at three of its 48 layer applications and its final state, and a recurrent head that writes up to seven tokens ahead. On CUDA, cortiq runs it after every token when decoding greedily (--greedy, or temperature 0 through the server): the drafts and the token before them go through the model in one call, the drafts it agrees with are kept, the rest rolled back. How many drafts a round offers follows what a round costs and how often drafts are kept, measured as it runs; on text the drafter does not predict it falls back to plain decoding. CMF_INKLING_SPEC=0 turns it off, CMF_INKLING_SPEC=N pins N drafts.

text NVIDIA L4: plain → DSpark, tok/s speed-up RTX PRO 6000: plain → DSpark, tok/s speed-up drafts kept (L4)
Python code 49.5 → 70.8 ×1.43 213.7 → 279.9 ×1.31 57 %
JSON 49.2 → 63.8 ×1.30 214.8 → 298.2 ×1.39 48 %
a short story 49.5 → 48.7 ×0.98 — — 32 %
advice in prose 50.3 → 53.1 ×1.06 — — 34 %

Greedy, 384 tokens after a one-line prompt with --no-think; drafts kept on the L4. The L4 with cortiq 0.9.14, the RTX PRO 6000 with cortiq 0.9.15 (the story and the advice not measured there). The kept tokens are the model's own greedy picks; a verify call adds its rows in another order than a one-token call, so at a near tie the text can take another branch than plain decoding.

Performance

One stream, cortiq bench --core, without speculative decoding (CMF_INKLING_SPEC=0): the time to the first token of a prompt of that length and the decode speed after it (64 tokens). Card memory is the peak nvidia-smi shows during the run. Read each backend's section on its own.

CUDA · NVIDIA L4

Stand: NVIDIA L4 (24 GB), Google Colab, the CUDA backend (CMF_GPU=cuda), cortiq 0.9.14. Without a prompt: 50.9 tok/s. A prompt is read 512 rows a call: the dense matrices, the message gates and the attention through cuBLAS, the routed experts on tensor cores grouped so that each is read once a call.

Inkling-2-Mini on CUDA

prompt, tokens first token, s decode, tok/s peak card memory, GB
512 0.45 48.7 14.7
2 048 1.30 48.0 14.8
8 192 5.53 45.6 15.1
16 384 12.3 43.2 15.3
32 768 31.5 39.1 15.9

CUDA · NVIDIA RTX PRO 6000 Blackwell

Stand: NVIDIA RTX PRO 6000 Blackwell Server Edition (96 GB), Google Colab, the CUDA backend (CMF_GPU=cuda). Without a prompt: 220.1 tok/s. Measured with cortiq 0.9.15: the decode's small stages fused, each kernel launched while its predecessor drains (programmatic dependent launch, sm_90 and newer); a prompt read 4 096 rows a call (cards of 40 GB and more), its attention as a flash kernel, the dense weights kept as f16 while free memory allows.

Inkling-2-Mini on RTX PRO 6000

prompt, tokens first token, s decode, tok/s peak card memory, GB
512 0.12 215.3 19.6
2 048 0.15 214.0 19.6
8 192 0.58 206.6 19.8
16 384 1.21 196.7 20.2
32 768 2.69 182.1 20.7

Vulkan · NVIDIA L4

Stand: the same NVIDIA L4 (24 GB), over Vulkan (the default backend), cortiq 0.9.14. Without a prompt: 35.4 tok/s. A prompt is read 128 rows a call, its 4-bit matrices and routed experts on the cooperative-matrix units.

Inkling-2-Mini on Vulkan

prompt, tokens first token, s decode, tok/s peak card memory, GB
512 2.45 31.6 13.7
2 048 12.1 27.9 13.7
8 192 58.1 23.5 15.0
16 384 145.6 19.1 15.5

Metal · MacBook Air M4

Stand: MacBook Air M4 (24 GB), fanless, Metal. Without a prompt: 25.0 tok/s. Measured with cortiq 0.9.15. The file stays memory-mapped; a prompt is read 256 rows a call, the routed experts as simdgroup GEMMs and the attention as a flash kernel on the simdgroup matrices.

Inkling-2-Mini on Metal

prompt, tokens first token, s decode, tok/s
512 3.00 23.9
2 048 13.0 22.2
8 192 55.1 19.6

CPU

stand decode, tok/s 512-token prompt decode after it
MacBook Air M4 (10 cores, 24 GB), CMF_GPU=0 10.3 22.6 s 9.7
Colab L4 host (Xeon 2.2 GHz, 6 cores / 12 threads), CMF_GPU=0 2.9 70.1 s 2.8

Usage

cortiq run Inkling-2-Mini-q4tp.cmf                                   # interactive chat
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..."                    # one answer, with its reasoning
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..." --no-think         # the least reasoning
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..." --reasoning-effort low
cortiq run Inkling-2-Mini-q4tp.cmf --prompt-file task.txt --max-tokens 2048

The embedded template is the model's own: a turn opens with a thinking-effort line (high by default; none, minimal, low, medium, xhigh or a number from 0 to 0.99 with --reasoning-effort), and the model writes a thinking part before its answer, shown between <think> and </think>. --no-think asks for effort none; as the release notes, the model may still reason a little in its answer. The file carries the release's sampling (temperature 1.0); --greedy gives deterministic output.

OpenAI-compatible server

cortiq serve puts the file behind an OpenAI-compatible HTTP API, with a web dashboard on the same port.

CMF_GPU=cuda cortiq serve Inkling-2-Mini-q4tp.cmf --port 8080 --host 127.0.0.1

curl http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "inkling-2-mini",
  "messages": [{"role": "user", "content": "Plan a three-step migration from MySQL to Postgres."}],
  "max_tokens": 1024,
  "reasoning_effort": "low"
}'
endpoint what it does
POST /v1/chat/completions a chat turn; stream: true sends the answer as it is decoded, tools lets the model call functions
POST /v1/completions the continuation of a prompt
GET /v1/models the served model
GET / the web dashboard
  • The thinking part comes back as message.reasoning_content; "enable_thinking": false asks for effort none, reasoning_effort sets it as in the CLI.
  • Tools go in tools in the OpenAI format; the model's JSON tool calls come back as message.tool_calls.
  • One sequence at a time: the server runs this file with one slot. --host 127.0.0.1 keeps it local; no API key is checked.

Long context

The model holds 1 048 576 positions; cortiq caps a conversation at 32 768 by default (CMF_MAX_SEQ sets it). It has no rotary positions: attention adds a learned relative bias over the last 1 024 distances, 20 of its 24 layers attend over a 1 024-token window, and past 8 192 positions the 4 full layers scale their queries with the logarithm of the position. Each of the 48 layer applications keeps its own keys and values: on CUDA the windowed ones a ring of 1 536 rows, the 8 full ones 32 KB a token (1.33 GB of the card for 32 768 positions).

Verify the download

sha256sum -c Inkling-2-Mini-q4tp.cmf.sha256
cortiq info Inkling-2-Mini-q4tp.cmf
file sha256
Inkling-2-Mini-q4tp.cmf e7946e77cfc4de45f867842169a6d88de6026820cb903282641ca83f4c77c97b

License

Apache-2.0, as the original release (LICENSE); use of the model is also subject to Thinking Machines' acceptable use policy. The weights were converted to CMF and quantized by cortiq. The original model card's notes on intended use, limitations and safety apply to this file as well.


Документация на русском

Inkling-2-Mini — модель Thinking Machines со смесью экспертов на 26,4 млрд параметров (3,4 млрд активных на токен; 12 средних слоёв выполняются трижды, 5,4 млрд эффективных), упакованная в один файл CMF. Его запускает cortiq — движок на Rust без Python и ML-фреймворков: GPU NVIDIA через CUDA или Vulkan, AMD и Intel через Vulkan/DX12, Apple silicon через Metal, а также CPU. В файле языковая модель и драфтер DSpark из релиза; визуального энкодера в нём нет. Измерено:

  • 15,12 ГБ, все веса на одной карте 24 ГБ. NVIDIA L4, CUDA: 50,9 ток/с; промпт из 2 048 токенов читается за 1,30 с, из 32 768 — за 31,5 с, после чего модель пишет 39,1 ток/с в 15,9 ГБ карты.
  • Спекулятивная генерация DSpark на CUDA: драфтер из релиза предлагает токены, модель проверяет их одним вызовом; на L4 70,8 ток/с на коде и 63,8 на JSON вместо 49,5.
  • NVIDIA RTX PRO 6000 Blackwell: 220,1 ток/с, промпт из 2 048 токенов — 0,15 с; с DSpark 279,9 ток/с на коде.
  • Та же L4 через Vulkan: 35,4 ток/с; MacBook Air M4 (24 ГБ): 25,0 ток/с через Metal, 10,3 на одном CPU.
  • Точность: перплексия WikiText-2 9,058 против 8,944 у собственных весов релиза в f32 (Transformers), 7,379 против 7,310 на окнах по 4 096 токенов; CUDA, Vulkan и Metal расходятся не больше чем на 0,1 %.

Быстрый старт

cargo install cortiq-cli --features cuda
hf download infosave/Inkling-2-Mini-cmf Inkling-2-Mini-q4tp.cmf --local-dir .
CMF_GPU=cuda cortiq run Inkling-2-Mini-q4tp.cmf --prompt "Почему небо голубое? Ответь в трёх предложениях."

Нужен cortiq 0.9.15 или новее; готовые сборки для Linux, macOS и Windows — на странице релизов. Для Vulkan, Metal или CPU уберите --features cuda и CMF_GPU=cuda.

Файлы

файл квантование размер ppl WikiText-2 ppl Rust ppl Python WikiText-2, окна по 4 096 токенов
Inkling-2-Mini-q4tp.cmf 4 бита: маршрутизируемые эксперты, внимание и остальные плотные матрицы; голова 8 бит; драфтер 8 бит 15,12 ГБ 9,058 3,150 2,864 7,379
эталон: Transformers f32 эксперты релиза в NVFP4 / MXFP8, раскодированные 19,53 ГБ 8,944 3,124 2,851 7,310

Перплексия на 12 окнах по 512 токенов WikiText-2 test, 1,8 МБ кода на Rust и 477 КБ на Python и на 2 окнах по 4 096 токенов WikiText-2, окна одинаковые для всех строк, CUDA. Релиз хранит маршрутизируемых экспертов в NVFP4 (слои 0–19) и MXFP8 (20–23); они раскодированы и заново закодированы в q4tp. Внимание, его выходной гейт и проекции относительных позиций округлены GPTQ на 3 072 токенах прозы, Rust и Python, которых нет в оценочных текстах; голова 8-битная, эмбеддинг f16, роутеры, свёртки, запросы смешивания блоков и гейты сообщений — f32. Матрицы драфтера 8-битные, его нормы и рекуррентная часть — f32. Эталон — слои релиза (transformers PR #51050) в f32 с точно раскодированными экспертами.

Тот же файл на других бэкендах:

бэкенд ppl WikiText-2 WikiText-2, окна по 4 096 токенов
CUDA (NVIDIA L4) 9,058 7,379
Vulkan (NVIDIA L4) 9,058 7,376
Metal (Apple M4) 9,052 7,377

Спекулятивная генерация (DSpark)

В релизе есть драфтер (mtp.safetensors): три плотных слоя, которые читают скрытые состояния модели на трёх из 48 применений слоёв и её итоговое состояние, и рекуррентная голова, пишущая до семи токенов вперёд. На CUDA cortiq запускает его после каждого токена при жадной генерации (--greedy или температура 0 через сервер): черновики и токен перед ними проходят через модель одним вызовом, согласованные с ней черновики остаются, остальные откатываются. Сколько черновиков предлагать в раунде, определяется на ходу по стоимости раунда и доле принятых; на тексте, который драфтер не угадывает, генерация возвращается к обычной. CMF_INKLING_SPEC=0 выключает DSpark, CMF_INKLING_SPEC=N фиксирует N черновиков.

текст NVIDIA L4: без DSpark → DSpark, ток/с ускорение RTX PRO 6000: без DSpark → DSpark, ток/с ускорение принято черновиков (L4)
код на Python 49,5 → 70,8 ×1,43 213,7 → 279,9 ×1,31 57 %
JSON 49,2 → 63,8 ×1,30 214,8 → 298,2 ×1,39 48 %
рассказ 49,5 → 48,7 ×0,98 — — 32 %
советы прозой 50,3 → 53,1 ×1,06 — — 34 %

Жадная генерация, 384 токенов после однострочного промпта с --no-think; доля принятых — на L4. L4 — cortiq 0.9.14, RTX PRO 6000 — cortiq 0.9.15 (рассказ и советы там не замерялись). Оставленные токены — собственный жадный выбор модели; проверочный вызов складывает строки в другом порядке, чем однотокенный, поэтому при почти равных логитах текст может пойти по другой ветке, чем при обычной генерации.

Производительность

Один поток, cortiq bench --core, без спекулятивной генерации (CMF_INKLING_SPEC=0): время до первого токена после промпта такой длины и скорость генерации после него (64 токена). Память карты — пик по nvidia-smi за прогон. Каждый раздел — свой бэкенд.

CUDA · NVIDIA L4

Стенд: NVIDIA L4 (24 ГБ), Google Colab, бэкенд CUDA (CMF_GPU=cuda), cortiq 0.9.14. Без промпта: 50,9 ток/с. Промпт читается по 512 строк за вызов: плотные матрицы, гейты сообщений и внимание — через cuBLAS, маршрутизируемые эксперты — на тензорных ядрах, сгруппированными так, что каждый читается один раз за вызов.

Inkling-2-Mini на CUDA

промпт, токенов первый токен, с генерация, ток/с пик памяти карты, ГБ
512 0,45 48,7 14,7
2 048 1,30 48,0 14,8
8 192 5,53 45,6 15,1
16 384 12,3 43,2 15,3
32 768 31,5 39,1 15,9

CUDA · NVIDIA RTX PRO 6000 Blackwell

Стенд: NVIDIA RTX PRO 6000 Blackwell Server Edition (96 ГБ), Google Colab, бэкенд CUDA (CMF_GPU=cuda). Без промпта: 220,1 ток/с. Замерено на cortiq 0.9.15: мелкие стадии генерации слиты, каждое ядро запускается, пока предыдущее досчитывается (programmatic dependent launch, sm_90 и новее); промпт читается по 4 096 строк за вызов (карты от 40 ГБ), внимание — flash-ядро, плотные веса хранятся в f16, пока хватает свободной памяти.

Inkling-2-Mini на RTX PRO 6000

промпт, токенов первый токен, с генерация, ток/с пик памяти карты, ГБ
512 0,12 215,3 19,6
2 048 0,15 214,0 19,6
8 192 0,58 206,6 19,8
16 384 1,21 196,7 20,2
32 768 2,69 182,1 20,7

Vulkan · NVIDIA L4

Стенд: та же NVIDIA L4 (24 ГБ) через Vulkan (бэкенд по умолчанию), cortiq 0.9.14. Без промпта: 35,4 ток/с. Промпт читается по 128 строк за вызов, 4-битные матрицы и маршрутизируемые эксперты — на кооперативных матрицах.

Inkling-2-Mini на Vulkan

промпт, токенов первый токен, с генерация, ток/с пик памяти карты, ГБ
512 2,45 31,6 13,7
2 048 12,1 27,9 13,7
8 192 58,1 23,5 15,0
16 384 145,6 19,1 15,5

Metal · MacBook Air M4

Стенд: MacBook Air M4 (24 ГБ), без вентилятора, Metal. Без промпта: 25,0 ток/с. Замерено на cortiq 0.9.15. Файл остаётся отображённым в память; промпт читается по 256 строк за вызов, маршрутизируемые эксперты — GEMM на simdgroup-матрицах, внимание — flash-ядро на тех же матрицах.

Inkling-2-Mini на Metal

промпт, токенов первый токен, с генерация, ток/с
512 3,00 23,9
2 048 13,0 22,2
8 192 55,1 19,6

CPU

стенд генерация, ток/с промпт 512 токенов генерация после него
MacBook Air M4 (10 ядер, 24 ГБ), CMF_GPU=0 10,3 22,6 с 9,7
хост Colab L4 (Xeon 2,2 ГГц, 6 ядер / 12 потоков), CMF_GPU=0 2,9 70,1 с 2,8

Использование

cortiq run Inkling-2-Mini-q4tp.cmf                                   # интерактивный чат
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..."                    # один ответ с рассуждением
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..." --no-think         # минимум рассуждения
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..." --reasoning-effort low
cortiq run Inkling-2-Mini-q4tp.cmf --prompt-file task.txt --max-tokens 2048

Встроенный шаблон — собственный шаблон модели: ход начинается со строки об усилии рассуждения (по умолчанию high; none, minimal, low, medium, xhigh или число от 0 до 0,99 через --reasoning-effort), и модель пишет часть рассуждения перед ответом — она выводится между <think> и </think>. --no-think просит усилие none; как отмечает релиз, модель всё равно может немного рассуждать в ответе. Файл несёт сэмплирование релиза (температура 1,0); --greedy даёт детерминированный вывод.

OpenAI-совместимый сервер

cortiq serve отдаёт файл через HTTP API, совместимый с OpenAI, с веб-панелью на том же порту.

CMF_GPU=cuda cortiq serve Inkling-2-Mini-q4tp.cmf --port 8080 --host 127.0.0.1

curl http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "inkling-2-mini",
  "messages": [{"role": "user", "content": "Составь план миграции с MySQL на Postgres в три шага."}],
  "max_tokens": 1024,
  "reasoning_effort": "low"
}'
эндпоинт что делает
POST /v1/chat/completions ход чата; stream: true присылает ответ по мере генерации, tools позволяет модели вызывать функции
POST /v1/completions продолжение prompt
GET /v1/models обслуживаемая модель
GET / веб-панель
  • Часть рассуждения приходит в message.reasoning_content; "enable_thinking": false просит усилие none, reasoning_effort задаёт его, как в CLI.
  • Инструменты передаются в tools в формате OpenAI; JSON-вызовы модели возвращаются в message.tool_calls.
  • Одна последовательность за раз: сервер запускает этот файл с одним слотом. --host 127.0.0.1 оставляет сервер локальным; ключ API не проверяется.

Длинный контекст

Модель держит 1 048 576 позиций; cortiq по умолчанию ограничивает разговор 32 768 токенами (задаётся CMF_MAX_SEQ). Ротационных позиций у неё нет: внимание добавляет обученный относительный сдвиг по последним 1 024 расстояниям, 20 из 24 слоёв смотрят в окно 1 024 токена, а 4 полных слоя после 8 192 позиций масштабируют запросы логарифмом позиции. Каждое из 48 применений слоёв хранит свои ключи и значения: на CUDA оконные — кольцо из 1 536 строк, 8 полных — 32 КБ на токен (1,33 ГБ карты на 32 768 позиций).

Проверка загрузки

sha256sum -c Inkling-2-Mini-q4tp.cmf.sha256
cortiq info Inkling-2-Mini-q4tp.cmf
файл sha256
Inkling-2-Mini-q4tp.cmf e7946e77cfc4de45f867842169a6d88de6026820cb903282641ca83f4c77c97b

Лицензия

Apache-2.0, как у исходного релиза (LICENSE); использование модели также подчиняется политике допустимого использования Thinking Machines. Веса сконвертированы в CMF и квантованы cortiq. Замечания исходной карточки о назначении, ограничениях и безопасности относятся и к этому файлу.


中文文档

Inkling-2-Mini 是 Thinking Machines 的 264 亿参数混合专家模型 (每个 token 激活 34 亿参数;中间 12 层运行三遍,等效 54 亿),这里打包为单个 CMF 文件,由 cortiq 运行——一个不依赖 Python 和机器学习框架的 Rust 推理引擎:NVIDIA 显卡走 CUDA 或 Vulkan,AMD、Intel 显卡走 Vulkan/DX12,Apple silicon 走 Metal,也可在 CPU 上运行。文件包含语言模型和发布版的 DSpark 草稿模型;视觉编码器不在其中。实测:

  • 15.12 GB,全部权重放在一块 24 GB 显卡上。 NVIDIA L4,CUDA:50.9 tok/s;2 048 token 的提示词读取 1.30 秒, 32 768 token 读取 31.5 秒,之后以 39.1 tok/s 生成,占用 15.9 GB 显存。
  • CUDA 上的 DSpark 推测解码: 发布版自带的草稿模型提出 token,模型在一次调用中校验;L4 上代码 70.8 tok/s,JSON 63.8 tok/s,不用时为 49.5。
  • NVIDIA RTX PRO 6000 Blackwell: 220.1 tok/s,2 048 token 的提示词 0.15 秒;DSpark 下代码 279.9 tok/s。
  • 同一块 L4,Vulkan: 35.4 tok/s;MacBook Air M4(24 GB): Metal 25.0 tok/s,仅 CPU 10.3。
  • 精度: WikiText-2 困惑度 9.058,发布版自身权重在 f32(Transformers)下为 8.944;4 096 token 窗口上 7.379,参考为 7.310;CUDA、Vulkan 和 Metal 之间相差不超过 0.1%。

快速开始

cargo install cortiq-cli --features cuda
hf download infosave/Inkling-2-Mini-cmf Inkling-2-Mini-q4tp.cmf --local-dir .
CMF_GPU=cuda cortiq run Inkling-2-Mini-q4tp.cmf --prompt "天空为什么是蓝色的?用三句话回答。"

需要 cortiq 0.9.15 或更高版本;Linux、macOS 和 Windows 的预编译程序见发布页面。 使用 Vulkan、Metal 或 CPU 时去掉 --features cuda 和 CMF_GPU=cuda。

文件

文件 量化 大小 WikiText-2 困惑度 Rust 困惑度 Python 困惑度 WikiText-2,4 096 token 窗口
Inkling-2-Mini-q4tp.cmf 4 位:路由专家、注意力及其他稠密矩阵;输出头 8 位;草稿模型 8 位 15.12 GB 9.058 3.150 2.864 7.379
参考:Transformers f32 发布版的 NVFP4 / MXFP8 专家,解码后 19.53 GB 8.944 3.124 2.851 7.310

困惑度在 WikiText-2 test 的 12 个 512 token 窗口、1.8 MB Rust 和 477 KB Python 代码上计算,另有 WikiText-2 的 2 个 4 096 token 窗口,各行使用相同窗口,CUDA。发布版的路由专家以 NVFP4(第 0–19 层)和 MXFP8(第 20–23 层)存储,这里解码后 重新编码为 q4tp。注意力、其输出门和相对位置投影用 GPTQ 在 3 072 个 token 的散文、Rust 和 Python 上取整(评测文本中不含 这些内容);输出头为 8 位,词嵌入为 f16,路由器、卷积、块混合查询和消息门为 f32。参考在 f32 下运行发布版的各层 (transformers PR #51050),专家精确解码。草稿模型的矩阵为 8 位,其归一化与循环部分为 f32。

同一文件在其他后端上:

后端 WikiText-2 困惑度 WikiText-2,4 096 token 窗口
CUDA(NVIDIA L4) 9.058 7.379
Vulkan(NVIDIA L4) 9.058 7.376
Metal(Apple M4) 9.052 7.377

推测解码(DSpark)

发布版附带一个草稿模型(mtp.safetensors):三个稠密层读取模型在 48 次层应用中三处的隐藏状态及其最终状态,再由一个 循环头向前写出最多七个 token。在 CUDA 上,贪心生成时(--greedy,或经服务器以温度 0 请求)cortiq 在每个 token 之后运行 它:草稿连同其前的 token 在一次调用中通过模型,模型认可的草稿保留,其余回滚。每轮提出多少草稿,按运行中测得的每轮代价 和保留比例决定;草稿模型猜不中的文本会回到普通生成。CMF_INKLING_SPEC=0 关闭,CMF_INKLING_SPEC=N 固定为 N 个草稿。

文本 NVIDIA L4:普通 → DSpark,tok/s 加速 RTX PRO 6000:普通 → DSpark,tok/s 加速 草稿保留(L4)
Python 代码 49.5 → 70.8 ×1.43 213.7 → 279.9 ×1.31 57 %
JSON 49.2 → 63.8 ×1.30 214.8 → 298.2 ×1.39 48 %
短篇故事 49.5 → 48.7 ×0.98 — — 32 %
散文式建议 50.3 → 53.1 ×1.06 — — 34 %

贪心,单行提示词加 --no-think 之后生成 384 个 token;草稿保留比例为 L4 上的数值。L4 为 cortiq 0.9.14,RTX PRO 6000 为 cortiq 0.9.15(该卡上未测短篇故事与散文建议)。保留的 token 都是模型自身的贪心 选择;校验调用对各行的累加顺序与单 token 调用不同,因此在 logits 几乎相等处,文本可能与普通生成走向不同的分支。

性能

单路,cortiq bench --core,不用推测解码(CMF_INKLING_SPEC=0):给定长度提示词后的首 token 时间及其后的生成速度(64 个 token)。 显存为运行期间 nvidia-smi 显示的峰值。各后端的小节请分别阅读。

CUDA · NVIDIA L4

测试平台:NVIDIA L4(24 GB),Google Colab,CUDA 后端(CMF_GPU=cuda),cortiq 0.9.14。无提示词时:50.9 tok/s。提示词每次调用读取 512 行:稠密矩阵、消息门和注意力走 cuBLAS,路由专家在张量核心上按专家分组,每次调用每个专家只读一次。

Inkling-2-Mini 在 CUDA 上

提示词,token 首 token,秒 生成,tok/s 显存峰值,GB
512 0.45 48.7 14.7
2 048 1.30 48.0 14.8
8 192 5.53 45.6 15.1
16 384 12.3 43.2 15.3
32 768 31.5 39.1 15.9

CUDA · NVIDIA RTX PRO 6000 Blackwell

测试平台:NVIDIA RTX PRO 6000 Blackwell Server Edition(96 GB),Google Colab,CUDA 后端(CMF_GPU=cuda)。无提示词时: 220.1 tok/s。以 cortiq 0.9.15 测得:生成的小阶段已融合,每个内核在前一个收尾时即开始调度(programmatic dependent launch,sm_90 及更新);提示词每次调用读取 4 096 行(40 GB 及以上的显卡),注意力为 flash 内核,空闲显存允许时稠密权重以 f16 常驻。

Inkling-2-Mini 在 RTX PRO 6000 上

提示词,token 首 token,秒 生成,tok/s 显存峰值,GB
512 0.12 215.3 19.6
2 048 0.15 214.0 19.6
8 192 0.58 206.6 19.8
16 384 1.21 196.7 20.2
32 768 2.69 182.1 20.7

Vulkan · NVIDIA L4

测试平台:同一块 NVIDIA L4(24 GB),Vulkan(默认后端),cortiq 0.9.14。无提示词时:35.4 tok/s。提示词每次调用读取 128 行, 4 位矩阵和路由专家在协作矩阵单元上计算。

Inkling-2-Mini 在 Vulkan 上

提示词,token 首 token,秒 生成,tok/s 显存峰值,GB
512 2.45 31.6 13.7
2 048 12.1 27.9 13.7
8 192 58.1 23.5 15.0
16 384 145.6 19.1 15.5

Metal · MacBook Air M4

测试平台:MacBook Air M4(24 GB),无风扇,Metal。无提示词时:25.0 tok/s。以 cortiq 0.9.15 测得。文件保持内存映射;提示词每次调用读取 256 行, 路由专家以 simdgroup 矩阵 GEMM 计算,注意力为同一矩阵上的 flash 内核。

Inkling-2-Mini 在 Metal 上

提示词,token 首 token,秒 生成,tok/s
512 3.00 23.9
2 048 13.0 22.2
8 192 55.1 19.6

CPU

测试平台 生成,tok/s 512 token 提示词 其后生成
MacBook Air M4(10 核,24 GB),CMF_GPU=0 10.3 22.6 秒 9.7
Colab L4 主机(Xeon 2.2 GHz,6 核 / 12 线程),CMF_GPU=0 2.9 70.1 秒 2.8

使用

cortiq run Inkling-2-Mini-q4tp.cmf                                   # 交互式对话
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..."                    # 单次回答,含推理
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..." --no-think         # 最少推理
cortiq run Inkling-2-Mini-q4tp.cmf --prompt "..." --reasoning-effort low
cortiq run Inkling-2-Mini-q4tp.cmf --prompt-file task.txt --max-tokens 2048

内置模板是模型自己的:每轮以一行推理强度开头(默认 high;可用 --reasoning-effort 设为 none、minimal、low、 medium、xhigh 或 0 到 0.99 的数字),模型在回答前先写推理部分,显示在 <think> 与 </think> 之间。--no-think 请求强度 none;如发布版所述,模型在回答中仍可能有少量推理。文件带有发布版的采样设置(温度 1.0);--greedy 给出确定性输出。

OpenAI 兼容服务器

cortiq serve 以 OpenAI 兼容的 HTTP API 提供该文件,同一端口上还有网页面板。

CMF_GPU=cuda cortiq serve Inkling-2-Mini-q4tp.cmf --port 8080 --host 127.0.0.1

curl http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "inkling-2-mini",
  "messages": [{"role": "user", "content": "制定一个从 MySQL 迁移到 Postgres 的三步计划。"}],
  "max_tokens": 1024,
  "reasoning_effort": "low"
}'
端点 作用
POST /v1/chat/completions 一轮对话;stream: true 边生成边返回,tools 让模型调用函数
POST /v1/completions 续写 prompt
GET /v1/models 所服务的模型
GET / 网页面板
  • 推理部分在 message.reasoning_content 中返回;"enable_thinking": false 请求强度 none,reasoning_effort 的设置与 CLI 相同。
  • 工具以 OpenAI 格式放在 tools 中;模型的 JSON 工具调用以 message.tool_calls 返回。
  • 一次一个序列:服务器以单槽运行该文件。--host 127.0.0.1 使服务器只在本机可访问;不校验 API key。

长上下文

模型支持 1 048 576 个位置;cortiq 默认将一次对话限制为 32 768 个 token(用 CMF_MAX_SEQ 设置)。模型没有旋转位置编码: 注意力在最近 1 024 个距离上加入学习得到的相对偏置,24 层中有 20 层在 1 024 token 的窗口内注意,4 个全注意力层在 8 192 个 位置之后按位置的对数缩放查询。48 次层应用各自保留键和值:在 CUDA 上,窗口层为 1 536 行的环形缓冲,8 个全注意力应用每个 token 32 KB(32 768 个位置占 1.33 GB 显存)。

校验下载

sha256sum -c Inkling-2-Mini-q4tp.cmf.sha256
cortiq info Inkling-2-Mini-q4tp.cmf
文件 sha256
Inkling-2-Mini-q4tp.cmf e7946e77cfc4de45f867842169a6d88de6026820cb903282641ca83f4c77c97b

许可证

Apache-2.0,与原始发布版相同(LICENSE);模型的使用还须遵守 Thinking Machines 的 可接受使用政策。权重由 cortiq 转换为 CMF 并量化。原始模型卡中 关于预期用途、局限性和安全性的说明同样适用于本文件。

Downloads last month
45
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for infosave/Inkling-2-Mini-cmf

Quantized
(177)
this model