- Cuda 39%
- C++ 31.4%
- Python 24.9%
- JavaScript 1.4%
- CMake 1%
- Other 2.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| assets | ||
| bench | ||
| cmake | ||
| data | ||
| docker | ||
| docs | ||
| include/maya | ||
| ref | ||
| serve | ||
| src | ||
| tests | ||
| third_party | ||
| tools | ||
| .gitattributes | ||
| .gitignore | ||
| CHANGELOG.md | ||
| chat.py | ||
| CMakeLists.txt | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| LICENSE.deepseek-v41 | ||
| LICENSE.hy4-flash | ||
| LICENSE.minimax-m31 | ||
| LICENSE.qwen-community-1.0 | ||
| maya.py | ||
| maya.sh | ||
| README.ja.md | ||
| README.md | ||
| README.pt-BR.md | ||
| README.zh-CN.md | ||
| SECURITY.md | ||
| setup.py | ||
| setup.sh | ||
| START-MAYA.bat | ||
| VERSION | ||
Inkling 2 Mini on ONE RTX 3090: up to 131 tok/s plain, 231 with DSpark
Thinking Machines' 26B looped MoE, all of it in 24 GB of VRAM. Now on Project Maya v1.1.84 with full GSQ-RCO support (IQ3_S to IQ2_S: 125–131 tok/s plain, 184–231 tok/s with DSpark, ~2,510–2,570 tok/s prefill), Unsloth UD-Q4_K_XL (124 tok/s plain, 179 tok/s with DSpark), runtime refusal ablation (--ablate), dspark-Inkling-2-Mini-Q8_0.gguf & mtp.safetensors drafting, up to 344K context, images, and tools. Also runs on 8–16 GB GPUs, Linux and Windows, NVIDIA CUDA and AMD HIP, with continuous batching (--parallel) and host-RAM conversation caching (IK2_SESSION_CACHE_GB).
Read the guide · Quick start · GSQ-RCO Uncensored Pack (HF) · GSQ-RCO Weights · Unsloth Weights
Speed on ONE RTX 3090 (24 GB, 300 W)
All quants stay 100% resident in 24 GB VRAM (resident: every expert in VRAM) with FP8 KV (IK2_KV=fp8) and DSpark drafting (128K context in the benchmark table below; 262K + DSpark also fits with 6.7–8.9 GiB headroom on GSQ-RCO):
| Quant | Size on disk | Plain decode, tok/s | With DSpark drafter, tok/s | Prefill 2K / 8K, tok/s | Experts VRAM |
|---|---|---|---|---|---|
GSQ-RCO IQ3_S |
11.43 GB | 125.4 (124.9 with --ablate) |
183.8 (190.3 with --ablate) |
2,511 / 2,556 | 9.2 GiB |
GSQ-RCO IQ3_XXS |
10.61 GB | 126.5 | 198.6 | 2,515 / 2,561 | 8.4 GiB |
GSQ-RCO Q2_K_XL |
9.79 GB | 128.6 | 208.6 | 2,519 / 2,566 | 7.8 GiB |
GSQ-RCO IQ2_S |
8.98 GB | 131.2 | 231.3 | 2,528 / 2,572 | 7.0 GiB |
Unsloth UD-Q4_K_XL |
17.63 GB | 124.0 | 179.3 | 2,481 / 2,530 | 14.7 GiB |
On UD-Q4_K_XL across workloads (cold prompt every time, 1× RTX 3090, FP8 KV; llama.cpp b12590 gets 57.0 tok/s on prose and 42.7 at 65K): prose decodes at 126 tok/s plain / 131 with DSpark, new Python code hits 182–207 tok/s through the HTTP server, editing a document hits 212 tok/s, and a 64K-token document runs at 104–106 tok/s plain / 125 with DSpark (prefill up to 2,742 tok/s at 4K, 2,361 at 64K, 2,079 at 128K). Every launch and log is in the guide.
What you get
maya-ik2(Project Maya v1.1.84), an engine for Inkling 2 Mini: the 24 layers, the loop (layers 6 to 17 run 3 times, 48 layer visits per token), the relative bias, the short convs, and the attention residuals.- GSQ-RCO low-bit quants at full tensor-core speed. Supports ISTA-DASLab's GSQ-RCO files (
IQ3_S,IQ3_XXS,Q2_K_XL,IQ2_S) and llama.cpp master'sinkling2_looplayout: dense non-Q8 projections repack to planarQ8_0at load (IK2_REPACK_DENSE=1,wqkvrg/wqrgfused), routed experts run whole-superblockmma16816tensor-core kernels (IQ1_S/M,IQ2_XXS/XS/S,IQ3_XXS/Sgate_upandIQ4_NL/Q2_0down), and verify windows use bit-exact grouped IQ/Q2_0 block MMA plus vectorizeduint4FP16 decode for prefill. - Built-in runtime refusal ablation (
--ablate). Weights stay untouched.maya-ik2projects single directions or per-visit multi-direction banks (ik2_ablate.hpp) out of the residual stream at runtime, per conversation, and individual API requests can toggle"ablate": true/falsewhen loaded with--ablate-default off. Ready-to-use fitted direction banks for all 4 GSQ-RCO quants ship inalesha-pro/Inkling-2-Mini-GSQ-RCO-Uncensored-GGUF. - The whole model stays in 24 GB VRAM. All 3,072 experts (7.0–9.2 GiB on GSQ-RCO, 14.7 GiB on
UD-Q4_K_XL), the dense weights, and an FP8 KV cache fit on one 24 GB card: up to 344,064 tokens without the drafter, 262,144 with it (GSQ-RCO keeps 6.7–8.9 GiB of headroom at 262K + DSpark). - Speculative decoding with DSpark (
dspark-Inkling-2-Mini-Q8_0.ggufandmtp.safetensors). Both the Q8_0 GGUF drafter (dspark-Inkling-2-Mini-Q8_0.gguf) and Thinking Machines' BF16mtp.safetensorsare supported. The engine verifies 2 to 8 tokens at a time in one CUDA-graphed pass using grouped expert MMA (max |dlogit| = 0bit-exact vs plain decode). - Runs on 8–16 GB GPUs too. Supports Maya's offload + CPU lane path (
IK2_OFF/IK2_LANE, as well asik2-mini-8gb.jsonwhich keeps experts in pinned host RAM with a VRAM cache at ~41 tok/s on an RTX 5070 Laptop 8 GB vs 12.5 tok/s in llama.cpp). - Continuous batching (
--parallel N) and conversation caching (IK2_SESSION_CACHE_GB). Pass--parallel N(2 to 8, single GPU) to serve concurrent requests over a shared paged global KV pool (~205 tok/s aggregate for 4 concurrent 300-token prompts on one 3090). On--parallel 1,IK2_SESSION_CACHE_GBparks displaced conversations in host RAM so interleaved agent calls restore without re-prefilling. - Linux, Windows (MSVC / CUDA 13), and AMD (HIP). Native Windows builds work out of the box, and AMD RDNA 3 / 3.5 / 4 GPUs build via ROCm/HIP (
-DMAYA_ENABLE_HIP=ON -DMAYA_PREFILL_MMQ=ON). - Images, tools, reasoning control, streaming through OpenAI and Anthropic compatible APIs on
/v1.
Quick start
Linux or Windows (MSVC), an NVIDIA GPU (sm_80 or newer, CUDA 12.8+ / 13.x; 24 GB for full resident VRAM or 8 GB+ with offload) or an AMD GPU with ROCm/HIP, CMake 3.24+, Ninja, and Python 3.10+.
git clone https://github.com/alesha-pro/maya-inkling-mini && cd maya-inkling-mini
pip install numpy jinja2 regex pyyaml tqdm requests pillow psutil "jsonschema>=4.18,<5" huggingface_hub
# the engine (NVIDIA CUDA; set CMAKE_CUDA_ARCHITECTURES to your GPU, e.g. 86, 89, 120)
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DMAYA_ENABLE_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES=86 -DMAYA_BUILD_TESTS=OFF
cmake --build build -j 24 --target maya-ik2
# the image encoder (skip it for text only)
cmake -S tools/vision -B build-vision -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLAMA_DIR=third_party/llama.cpp
cmake --build build-vision -j 24 --target maya-vision
Option A: GSQ-RCO Uncensored pack (11.4 GB IQ3_S, runtime refusal ablation + DSpark)
hf download alesha-pro/Inkling-2-Mini-GSQ-RCO-Uncensored-GGUF \
Inkling-2-Mini-GSQ-RCO-IQ3_S.gguf \
refusal-directions/Inkling-2-Mini-GSQ-RCO-IQ3_S-refusal-direction.gguf \
dspark-Inkling-2-Mini-Q8_0.gguf \
mmproj-Inkling-2-Mini-BF16.gguf \
--local-dir models
python tools/strata_tokenizer.py --gguf models/Inkling-2-Mini-GSQ-RCO-IQ3_S.gguf --out ik2 \
--chat-template tools/ik2/chat_template.jinja --check
python serve/server.py --engine maya --config docs/inkling2-mini/ik2-mini-gsq-iq3s-uncensored.json --host 127.0.0.1 --port 18000
(Or pick iq3xxs, q2kxl, or iq2s with the matching file and config in docs/inkling2-mini/; you can also download --include "tokenizer/*" straight from the HF pack and copy models/tokenizer to ik2/tokenizer.)
Option B: Unsloth UD-Q4_K_XL (17.6 GB NVFP4/Q8_0)
hf download unsloth/Inkling-2-Mini-GGUF Inkling-2-Mini-UD-Q4_K_XL.gguf mmproj-BF16.gguf --local-dir models
hf download thinkingmachines/Inkling-2-Mini mtp.safetensors --local-dir models
python tools/strata_tokenizer.py --gguf models/Inkling-2-Mini-UD-Q4_K_XL.gguf --out ik2 \
--chat-template tools/ik2/chat_template.jinja --check
python serve/server.py --engine maya --config docs/inkling2-mini/ik2-mini.json --host 127.0.0.1 --port 18000
For an AMD GPU (HIP), configure with -DMAYA_ENABLE_HIP=ON -DMAYA_PREFILL_MMQ=ON and your AMDGPU_TARGETS / CMAKE_HIP_ARCHITECTURES (for example gfx1201). See the guide for Windows MSVC and AMD HIP build flags.
Then talk to http://127.0.0.1:18000/v1 with any OpenAI or Anthropic client, model inkling-2-mini. docs/inkling2-mini/ includes 9 configs: 4 GSQ-RCO Uncensored configs (ik2-mini-gsq-{iq3s,iq3xxs,q2kxl,iq2s}-uncensored.json: DSpark Q8_0 drafter, 262K context, runtime --ablate, CPU vision) plus the 5 UD-Q4_K_XL configs (ik2-mini.json, ik2-mini-long.json, ik2-mini-text.json, ik2-mini-gpu-vision.json, ik2-mini-8gb.json). Add "--parallel", "4" to args in a config to serve concurrent requests.
Why it's faster than llama.cpp
llama.cpp runs about 7,350 kernel launches per token for this model. A token here is ~757 launches replayed as one CUDA graph, and the GPU never waits for the host between the embedding and the logits.
After that a token costs what its weights weigh: ~2.1–2.7 GB read from VRAM on GSQ-RCO (3.7 GB on UD-Q4_K_XL). Attention reads the KV cache at up to 846 GB/s, dense non-Q8 projections repack to planar Q8_0 (IK2_REPACK_DENSE=1) with fused wqkvrg/wqrg, and both NVFP4 and GSQ-RCO IQ/Q2_0 experts decode in registers straight into mma16816 tensor-core instructions (445 GB/s IQ3_S gate_up, 610 GB/s IQ4_NL down).
The drafter's window has its own path: the tokens' expert picks are grouped on the GPU so an expert is read once for all the tokens that picked it, and the verify window runs bit-exact grouped IQ/Q2_0 block MMA (T=2..8) inside one CUDA graph.
The guide has the details, and what didn't help.
Quality
- GSQ-RCO speed kernels vs scalar reference: across all 4 GSQ-RCO quants with
IK2_REPACK_DENSE=1, median KL is0.00067–0.00143on prose and1.6e-7–4.0e-7on code (0.000000withIK2_REPACK_DENSE=0). - DSpark vs plain decode parity: under
IK2_WINDOW_CHECK=1, greedy DSpark matches plain 1-token decode 100% bit-for-bit (max |dlogit| = 0) across all 4 GSQ-RCO quants and with--ablateon.ik2_kernels_testpasses all checks (test_repack_q8p, 16test_decodeformats,test_experts_iq_mma, and bit-exactexperts_block_iq == T=1). - Refusal ablation (
--ablate): fitted per-quant dual-direction banks (none+high) remove ~95% of refusals onIQ3_S/IQ3_XXS/IQ2_S(~85% onQ2_K_XL) while keeping 62–64/64 harmless Alpaca prompts intact (full AdvBench, JailbreakBench, and KLD tables on the HF pack card). - Base
UD-Q4_K_XL: on 96 GSM8K questions, greedy: 74 solved with plain decode and 77 with the drafter. Against the float64 reference inref/inkling2.py, the engine picks the same top token on 45 to 46 of 47 positions. Batched--parallel 4decode matches soloforward()with median KL ~3e-8 and 0 argmax disagreements (IK2_SLOTS_CHECK=32).
Limits
--parallel N(2 to 8 concurrent requests) is single-GPU and non-managed KV only; DSpark speculates when 1 slot is active and switches to batched decode when 2+ run together. Two GPUs run as expert parallel (IK2_EP=1) or tensor-parallel experts (IK2_TP=1) with--parallel 1, and the drafter runs on one GPU.IK2_SESSION_CACHE_GBapplies to--parallel 1.- Supported GGUF formats: Thinking Machines / Maya-L (
NVFP4+Q8_0), UnslothUD-Q4_K_XL/UD-IQ3_XXS, and ISTA-DASLabGSQ-RCO(IQ3_S,IQ3_XXS,Q2_K_XL,IQ2_S).UD-Q8_K_XLkeeps the last 4 layers' experts in BF16 and is not loaded. - Decode slows down with depth, because 8 of the 48 layer visits attend over the full prefix: 16 KB of FP8 KV cache per token of context is read for every new token.
- The drafter helps code, edits, and structured text. On free prose it accepts fewer tokens per window and the adaptive controller (
IK2_DRAFT_ADAPT) falls back toward plain decode. - The image encoder runs on the CPU in the default configs.
- Tested hardware: Linux on RTX 3090 (with
gpu-unlock, Ubuntu 22.04, driver 610.43) and AMD RX 9070 XT / RX 7900 XTX (gfx1201,gfx1100); Windows 11 (MSVC + CUDA 13.5) on RTX 4090, RTX 5090, RTX 5070 Laptop 8 GB, and dual RTX 5080 + RTX 4060 Ti.
About this repo
This is Project Maya v1.1.84, the engine family by Peasant Smith (@mw00) and the Maya contributors, which grew out of Strata by Niko1221. maya-ik2 started as the Inkling 2 Small engine from Maya's pull requests #981 and #1079. This release combines upstream v1.1.84 with GSQ-RCO tensor-core MMA & planar Q8 dense repacking, DSpark grouped IQ block MMA, and per-visit multi-direction runtime refusal ablation (--ablate).
Community contributions merged here and upstreamed into Project Maya:
- @cobra91: initial Windows / CUDA 13 port and two-GPU expert parallel.
- @PrasoonPratham: Windows MSVC hardening (
SIGUSR1, 64-bit offsets,PrefetchVirtualMemory,VirtualAlloc, CMake UTF-8 & Threads, #3). - @ImagineNotChetng: 8 GB GPU cache + CPU miss path at ~41 tok/s and
ik2-mini-8gb.json(#4). - @joeldeteves: native
--parallelcontinuous batching with paged global KV (#5). - @DeseretSaint: AMD HIP build and compatibility layer for
maya-ik2(#7). - @mkultraware: Windows
serve_multibuild fix (#10) and host-RAM conversation caching (IK2_SLOT_KEEP, #11, superseded in v1.1.84 byIK2_SESSION_CACHE_GB).
Core Inkling 2 Mini work is offered upstream in mw00/project-maya#1095. The rest of Maya (GLM-5.3, DeepSeek-V4.1-Flash, MiniMax-M3.1-Flash, Hy4-flash and the app around them) is in the tree; use upstream Maya for general Maya releases.
Weights: Inkling 2 Mini and its drafter by Thinking Machines, GGUF by Unsloth, GSQ-RCO quants by ISTA-DASLab, and GSQ-RCO Uncensored pack by alesha-pro.
License
The code is MIT, as upstream (LICENSE). The model weights are Apache 2.0.