Hybrid Kimi (hkimi)
Kimi K3.1 Pro, the full model with its published weights, on one 24 GB GPU.
hkimi is a small inference engine in C++17 and CUDA. It runs Moonshot AI's Kimi K3.1 Pro (2.8 trillion parameters, 1.56 TB) by streaming it from an NVMe drive, layer by layer, through a single consumer GPU. Nothing is quantized, pruned or retrained: the text it writes is, token for token, what the full model writes when it decodes greedily.
It is slow. Expect about 6 seconds per token. This is a way to run the real model on hardware you can own, not a way to chat with it comfortably.
This is an independent project, not affiliated with or endorsed by Moonshot AI or Inferact. This repository holds no model weights, only the engine's source code. The model and the drafter are downloaded from their own repositories.
| Model | moonshotai/Kimi-K3.1-Pro, weights unchanged |
| Drafter | Inferact/Kimi-K3.1-Pro-DSpark, 5 GB |
| GPU | one 24 GB NVIDIA card (11.4 GB used) |
| RAM | 64 GB (55 GB used) |
| Disk | one 2 TB NVMe |
| Speed | 6.0 s per token (0.17 tok/s) |
| Output | the same tokens as the full model |
| Tested on | Linux. The Windows build is untested on real hardware |
How it works
Kimi K3.1 Pro is a mixture of experts: 93 layers, 92 of them with 896 experts of 17.5 MB each, and a token uses only 16 experts per layer. The part every token needs (attention, routers, the output head: the "trunk") is 111 GB. The 82,432 experts are the other 1,446 GB.
The model stays on the disk. hkimi convert rewrites the checkpoint once into a "store" where every expert is one aligned record. To process tokens the engine makes a sweep: layer by layer, it brings the layer's trunk to the GPU, runs attention, lets the router pick the experts, and reads only those from the NVMe. A sweep over one token reads 137 GB. A sweep over six tokens takes about 1.8 times as long, not six times, because the trunk is read once and tokens share experts.
A small model guesses, the full model checks. One token per sweep would mean 13 s per token. So a drafter (DSpark, 2.5 B parameters, on the GPU) reads the full model's hidden states and guesses up to 7 tokens ahead. The full model then sweeps its last token and the guesses together, keeps the guesses up to the first one it would not have written, and adds its own token. A wrong guess costs time and never a token. A sweep yields 3.4 tokens on average.
Same bits, however a token is processed. This only gives the full model's text if a position's scores do not depend on what it is swept with. On a GPU that is not automatic: a library routine such as cuBLAS's gemm rounds differently depending on the batch, and one flipped bit can send a token to a different expert. Every matrix product in hkimi is therefore its own kernel with a fixed order of additions (docs/exact.md).
Keeping the disk busy. The next layers' trunk is read ahead by a second thread, 43 GB of trunk stay in RAM between sweeps, and each layer's trunk is copied to the GPU while the layer before it still reads its experts. None of this changes a number of the result. Together they took a token from 10.9 s to 6.0 s, and a sweep now runs at the speed of the drive.
More in docs/architecture.md and docs/drafter.md.
Hardware
| Minimum | Measured on | |
|---|---|---|
| GPU | NVIDIA, 24 GB | RTX 4090 |
| RAM | 64 GB | 130 GB machine, limited to a 64 GB budget |
| Disk | 2 TB NVMe, 3.5 GB/s or more | 7.4 GB/s (PCIe 4.0) |
| OS | Linux | Linux, in a container |
- GPU. Peak use was 11.4 GB, or 12.4 GB with a 2,605-token prompt. A 16 GB card may be enough. Not tried.
- RAM. The engine holds 55 GB: 43 GB of trunk kept in memory and 12 GB of its own. With
--trunk-ram 0it holds 11 GB, so 32 GB should work at about 7 s per token. That figure comes from limiting the engine, not from a 32 GB machine. - Disk. 1.56 TB for the store, about 150 GB more during the conversion, 5 GB for the drafter. The drive sets the pace: a sweep reads 94 GB at 7.4 GB/s. A slower drive works and is slower, a faster one should help ("With another drive" below).
hkimi bench-iomeasures yours. - CPU. Not the limit on 48 cores. Not measured with few cores.
Windows. The code builds for Windows (MinGW-w64) and its tests pass under Wine, including the Windows file reader. It has never been run on a real Windows machine, never been built with Visual Studio, and never been run with a GPU under Windows. Treat it as untested: it may need small fixes. scripts/build.ps1 is the starting point.
macOS. There is a file-reading path and no GPU backend, so it is only useful for the small test models.
Other GPUs. Only the RTX 4090 ran the full model. The code also compiles for RTX 50 cards (CUDA 12.8 or newer) without having been run on one.
Speed
Measured on 22 November 2026 on a rented machine: one RTX 4090, 48 cores, an NVMe drive at 7.4 GB/s, Linux, with the engine limited to the memory of a 64 GB PC. Greedy decoding, eight invented prompts (scripts/overnight_texts.sh), the first 48 tokens of each answer, run with tools/drafter_run.py.
| Kind of question | Seconds per token | 300-word answer | First token after |
|---|---|---|---|
| Fix a bug | 4.7 | 31 min | 100 s |
| Summarize a paragraph | 4.7 | 31 min | 140 s |
| Write a Python function | 4.9 | 33 min | 74 s |
| Explain a concept | 5.6 | 37 min | 73 s |
| Arithmetic word problem | 6.4 | 43 min | 90 s |
| List of tips | 6.6 | 44 min | 66 s |
| Question in French | 6.8 | 45 min | 67 s |
| Short story | 8.1 | 54 min | 65 s |
| Average | 6.0 | 40 min | 84 s |
The 300-word column is 400 tokens at the measured speed, so it is an estimate: the measured answers were 48 tokens long. "First token after" is the sweep that reads the prompt, and it grows with the prompt.
What decides the speed is how predictable the text is. The drafter guessed 39 of the 48 tokens of the bug fix and 26 of the 48 tokens of the story. The drafter's own published results show the same order.
Other numbers from the same runs:
- Without the drafter: 12.7 to 13.4 s per token.
- A long prompt (2,605 tokens): 466 s to read it, then the same speed. The answer was correct, including a detail from the first lines of the prompt.
- Less RAM (no trunk kept): sweeps take 19% longer.
- More RAM (102 GB of trunk kept): sweeps are 4% shorter.
With another drive (estimates, not tested)
| Drive | Read speed | Seconds per token |
|---|---|---|
| PCIe 3.0 NVMe | 3.5 GB/s | about 12 |
| PCIe 4.0 NVMe (measured) | 7.4 GB/s | 6.0 |
| PCIe 5.0 NVMe | 14 GB/s | 4 to 5 |
Only the middle line was run. The other two are worked out from the timings of the measured sweeps: a typical sweep of 22 s is 14 s of GPU and memory work and 8 s of waiting for the drive. A drive twice as fast removes most of the waiting and none of the work. A drive half as fast makes the whole sweep wait for it. With this GPU the floor is about 3.8 s per token, however fast the drive. A PCIe 5.0 drive also has to hold its speed through hours of reading, which needs good cooling.
Kimi K3.1 Pro normally reasons before it answers, often for thousands of tokens. hkimi opens the answer directly unless you pass --think, because at this speed a full reasoning phase takes hours.
These numbers were measured just before the repository was tidied for publication (unused code of an earlier design removed, comments edited). The two versions give the same bytes on the small test models. The tidied version was not timed again on the full model.
Compared with other ways to run a full-size Kimi on one machine
Several projects run a 2.8-trillion-parameter Kimi on a single machine by streaming it from SSDs. They all run Kimi K3, the predecessor of the same size. As far as I know, hkimi is the only one for K3.1 Pro. Each figure, and each "exact", is what the project reports about itself on its own hardware: nothing was run side by side. "300 words" is about 400 tokens, once the prompt is read.
What you get
| Project | Model | Weights | Tokens/s | 300 words |
|---|---|---|---|---|
| Deltafin | K3 | exact | 0.29 to 1.0 | 7 to 23 min |
| WARP | K3 | 3-bit experts | 0.45 to 0.62 | 11 to 15 min |
| SSD-LLaMA | K3 | 4-bit build | 0.47 | 14 min |
| hkimi | K3.1 Pro | exact | 0.17 | 40 min |
| kimi-k3-in-c | K3 | exact | 0.04 to 0.18 | 37 min to 3 h |
| 1-bit GGUF | K3 | 1-bit | 0.10 | 67 min |
What you need
| Project | Machine | GPU | RAM | Disk |
|---|---|---|---|---|
| Deltafin | Mac | built in | 64 to 128 GB | 1.7 TB on 4 SSDs |
| WARP | Mac | none | 29 GB or more | 1 TB |
| SSD-LLaMA | PC | RTX 5090 | 16 to 32 GB | 4 TB NVMe |
| hkimi | PC | 24 GB NVIDIA | 64 GB | 2 TB NVMe |
| kimi-k3-in-c | PC or server | none | 8 to 128 GB | 1.7 TB NVMe |
| 1-bit GGUF | server | 4 ร A100 | 610 GB with VRAM | 594 GB |
How to read it
- Fastest at home: Deltafin, on a 128 GB Mac with four SSDs. On a 64 GB M1 Max laptop it gives 0.29 tokens/s.
- Least memory: kimi-k3-in-c runs in 8 GB without a GPU, at 26 s per token. It needs 128 GB of RAM to reach 5.6 s, and was timed on a 124-core server.
- On an NVIDIA PC: SSD-LLaMA is faster, with an RTX 5090 (32 GB) and a 9 GiB/s drive.
hkimiruns on a 24 GB card with the published weights. - The 1-bit GGUF (llama.cpp) keeps the whole model in memory: 610 GB of RAM and VRAM together.
- Kimi K3.1 Pro: only
hkimi, as far as I know.
A data centre is far faster. vLLM serves K3 at over 100 tokens/s on 16 GB300 GPUs, and its baseline for K3.1 Pro is a node of eight B300 GPUs. The smallest quantized K3.1 Pro build (593 GB) still needs eight H100s. So among the ways to run this model, hkimi asks for the least hardware by far and pays for it in speed. If you only want answers from Kimi, an API is hundreds of times faster.
Two things this page does not claim. It is not the least hardware for any Kimi model: smaller ones such as Kimi-Linear 48B run on a single consumer GPU from ordinary quantized builds. And it is not the first engine of its kind: Deltafin streamed K3 from SSDs exactly, with a drafter, before this.
Sources, as published in November 2026: Deltafin, WARP, SSD-LLaMA, kimi-k3-in-c, the 1-bit GGUF test, vLLM on K3, K3.1 Pro deployments.
Quick start
Linux, an NVIDIA GPU, the CUDA toolkit (12.x; 12.8 or newer for RTX 50 cards), CMake 3.24 or newer, a C++17 compiler, Python 3 with NumPy for the tests.
# build and test (the tests run on tiny random models, a few minutes)
bash scripts/build.sh cuda
build/hkimi selftest --backend cuda
# everything below in one script, with the cheap checks first:
# bash scripts/setup_linux.sh /data
# 1. the model: 1.56 TB
hf download moonshotai/Kimi-K3.1-Pro --local-dir /data/models/kimi-k3.1-pro
# 2. convert it to a store; each shard is deleted once converted, so 2 TB of disk is enough
build/hkimi convert /data/models/kimi-k3.1-pro /data/stores/kimi-k3.1-pro --delete-source
# 3. the drafter: 5 GB
hf download Inferact/Kimi-K3.1-Pro-DSpark --local-dir /data/models/k31-dspark
# 4. write
build/hkimi chat /data/stores/kimi-k3.1-pro --drafter /data/models/k31-dspark
build/hkimi run /data/stores/kimi-k3.1-pro --drafter /data/models/k31-dspark \
--prompt "Explain how a hash table works." --max-new 200
Before downloading 1.56 TB, python3 tools/real_check.py layers --hkimi build/hkimi --work /data fetches two layers (about 50 GB) and checks them against an independent NumPy implementation.
Useful options of run and chat:
| Option | Meaning |
|---|---|
--drafter DIR |
use the drafter (without it: one sweep per token) |
--trunk-ram GB |
trunk kept in RAM (default: free RAM less 16 GB, 0: none) |
--read-ahead N |
layers read ahead (default 2) |
--copy-ahead 0 |
no copying ahead to the GPU |
--think |
let the model reason first |
--max-new N |
length limit, in tokens |
The measured runs used --read-ahead 3 --ahead-threads 8 --trunk-ram 40.
What "exact" means
On one machine and one build, the engine gives the same next-token scores for a position, to the last bit, however that position is processed. From that it follows that the text written with the drafter is the text the full model writes alone, one token per sweep. Both were compared on the full model: the scores bit for bit, the answers token for token.
It does not mean the text matches another machine, another build, or Moonshot's servers. Any two implementations of this model round differently somewhere, and one near tie is enough for two greedy decodings to part. docs/exact.md has the details.
Limits
- Speed. About 6 s per token, and 1 to 2.5 minutes before the first one. A long prompt costs minutes to read (8 minutes for 2,600 tokens).
- Greedy decoding only. No temperature or sampling.
- Text only. The vision part of the model is not loaded.
- No reasoning phase by default, see above.
- One machine was used. One RTX 4090 with one drive, one drafter, eight answers of 48 tokens and one long prompt. Other cards, drives and longer answers are untested.
- Windows is untested on real hardware, macOS has no GPU backend.
- Prompts longer than 2,605 tokens have not been run on the full model.
- The drafter's repository states no license. Check its terms before you redistribute it.
Tests
ctest --preset cuda # or: default, cpu, emu
The tests build tiny random models with the real architecture and check the engine against an independent NumPy implementation (tools/ref_forward.py), bit-identical results across every way of sweeping, and the drafted text against the full model alone. The emu preset runs the CUDA kernels on the CPU, so the GPU code is tested on machines without a GPU. docs/testing.md lists what is covered and what was run on the full model.
In this repository
src/ the engine: reader (the full model), drafter, loop, GPU and CPU backends, file reading, tokenizer
tools/ NumPy reference, test models, the measurement runs (drafter_run.py, long_context.py), checks
tests/ unit tests and end-to-end tests on tiny models
scripts/ build, disk check, setup from nothing on Linux
docs/ how it works, what "exact" means, the drafter, model facts, testing
License and credits
The code is under the MIT license (LICENSE). The repository holds no weights. Kimi K3.1 Pro belongs to Moonshot AI and comes under the Kimi K3.1-Pro License. The DSpark drafter is published by Inferact with the Red Hat AI speculators team. Both are downloaded from their own repositories, under their own terms.
Thanks to:
- Moonshot AI, for the model and its open weights.
- Inferact, Red Hat and the vLLM project, for the drafter and the code that shows how it is fed.
- Deltafin, which showed first that a model of this size can be streamed from SSDs exactly, with a drafter.
- WARP, flash-linear-attention, SGLang and vLLM, whose code was read to learn what the model computes. No code was copied from them (docs/model-facts.md lists the sources).
Author
Esat Can Bozu, AI engineer and data scientist, student at EPSI Paris. This is a personal project: it was not funded, requested or supervised by the school.
