deltafin README

The project's README from github.com/gavamedia/deltafin. As one markdown file: README.md.

	____       _ _         __ _
	|  _ \  ___| | |_ __ _ / _(_)_ __
	| | | |/ _ \ | __/ _` | |_| | '_ \
	| |_| |  __/ | || (_| |  _| | | | |
	|____/ \___|_|\__\__,_|_| |_|_| |_|

Run the full, never-pruned, 2.8-trillion-parameter Kimi K3 on consumer hardware, as "fast" as possible

Deltafin is a single native binary that runs full Kimi K3. Nothing pruned. Nothing skipped. K3 decides every token.

All 16 experts, every single token. No shortcuts, no "close enough." It's exactly what Moonshot shipped.

The quality rule is simple: K3 itself decides every token, and nobody else. Small draft models are allowed to guess ahead (that's where much of the speed comes from), but K3 checks every guess, and nothing reaches you without its official sign-off.

Latest Benchmarks on an M1 Max laptop

Historical M1 benchmarks:

model platforms accelerators experts runtime license


Mission Statement

Pure raw uncut K3 quality, as fast as possible. Speed must never come from reducing model quality. Deltafin keeps all 16 routed experts and the full K3 target as the sole authority for every single token.

Our goal is to squeeze out every last drop of efficiency possible when running a huge model like K3, with all options on the table... except for reducing quality.


But Why?!?

Deltafin is not a product pitch. It is an experiment in how far consumer hardware can be pushed, and what we can learn by attempting something so challenging.

Kimi K3 targets infrastructure on the scale of 16 nodes and roughly 4.8 TB of aggregate VRAM. That means the full 2.8T parameters and the 1M-token context window, with the expert bank never pruned. On any home setup, this is an extreme constraint. Every 1% improvement is very hard-won. But each gain can teach something.

Research and exploration is the point. That is our mission. Not everything has to be a "minimum viable product" to impress venture capitalists. If Deltafin helps make frontier models usable on a $15,000 home setup, instead of a $2,000,000 infrastructure like Kimi recommends, we believe that is worthwhile progress on our self-hosted AI journey. Plus everything learned along the way could even benefit other projects in unexpected ways.

“We choose to run the full 2.8-trillion-parameter model locally, and do the other things, not because they are easy, but because they are hard.” — John F. Kennedy probably

Other projects appear to run full K3, somehow faster. But look closer: they've re-encoded K3's expert bank down to ~3 bits. Clever engineering toward a different goal: the smallest K3 that fits and is "close enough." Those weights are no longer the ones Moonshot released, and nobody, including them, has measured what those compromises cost.

Deltafin is the other experiment: every expert byte exactly as Moonshot shipped it, made as fast as physics allows.


1. New Installation

Deltafin installs almost everything it needs. See Requirements if you're missing anything.

# 1. Get it
git clone https://github.com/gavamedia/deltafin.git
cd deltafin

# 2. Build it
cargo build --locked --release

# 3. Download the FULL 1.7 TB K3 model to disk (optional, but fastest)
./target/release/deltafin setup --full

Or, if you don't have enough disk space:

# 3. Stream K3 as you use it (slower, but 215 GB to start) 
./target/release/deltafin setup --stream

setup --stream installs the resident model and fetches exact experts on-demand only, initially running far more slowly when routes have no local cache yet. As you build up your cache over time, this can be a way to save space, storing only the parts of the model you use, running entirely off cache on disk.

Default DSpark (and optional Qwen)

The normal setup includes Inferact's Kimi-K3-DSpark. It takes 6.635 GiB on disk and approximately 4.49 GiB when admitted at runtime. Deltafin avoids materializing DSpark's redundant copy of K3's embedding. Chat and server requests use DSpark automatically when beneficial; any failures, insufficient headroom, or bad live economics simply leaves full K3 running by itself.

Qwen is a separate add-on for faster raw text continuation:

# 4. Optionally install qwen later
./target/release/deltafin setup-qwen

Qwen speeds up raw completion only: the small models guess what comes next, K3 checks the guess, and you get identical output in less time. That helps code autocomplete and other /v1/completions traffic, plus deltafin run --prompt ... — one measured 17-token completion ran 2.7× faster with the same output IDs.

This adds 4.337 GiB on disk, and because Qwen will not improve chat speed, we make it an optional add-on. You can add it to a fresh install with deltafin setup --full --include-qwen, or add it later with the command above.

2. Upgrading

From the Deltafin folder:

./target/release/deltafin upgrade

upgrade gets what you need, and rebuilds the binary. Models, converted weights, and caches are left alone. It never re-runs setup or re-downloads K3.


NOTE: Upgrading from our old python version? Inspect it first:

git status --short

# ⬆️ Continue only when that returns nothing

git pull --ff-only
cargo build --locked --release
./target/release/deltafin upgrade

Continue only when git status --short is empty. If it lists files, preserve or commit that work yourself, rather than allowing an upgrade procedure to guess. Existing model data remains in the same repository-root directories.


upgrade needs a clean, non-diverged branch, and it remembers how the binary was built, so an NVIDIA/CUDA build stays a CUDA build rather than quietly falling back to CPU. Anything unexpected safely stops the upgrade.

upgrade ignores build environment variables — it reuses whatever the binary was already built with. So to switch configuration (CPU to CUDA, say, or a moved LibTorch tree), run cargo build --locked --release yourself once with the new variables set; see Requirements. That becomes the recorded setup, and later upgrades keep it.

3. Use from the command line

# Chat: apply K3's audited chat template and stop at the model's end marker.
./target/release/deltafin run --chat \
  --prompt "What are the three largest moons of Saturn?"

# Raw continuation: cap output because raw text has no chat end boundary.
./target/release/deltafin run \
  --prompt "The capital of France is" --max-new 17

# Add cumulative throughput and native transaction statistics.
./target/release/deltafin run \
  --prompt "The largest planet in our solar system is" --max-new 17 --stats

Without --stats, generated text streams normally instead of printing one diagnostic line per token. --max-new N limits new tokens; it does not alter the prompt or context. Chat output stops at K3's control boundary, while raw completion should normally use a bound.

Long conversations are far slower than short completions — prefill and cache grow with history, and startup prints the actual usable context bound.

4. Use through an OpenAI-compatible server

./target/release/deltafin serve --host 127.0.0.1 --port 8000
curl http://127.0.0.1:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"deltafin-kimi-k3","stream":true,"messages":[{"role":"user","content":"Hello!"}]}'

The native server implements /v1/chat/completions, /v1/completions and /v1/models, including server-sent-event streaming. Point an OpenAI-compatible client at http://127.0.0.1:8000/v1 and use any non-empty local API key expected by that client.

The server implements a deliberately small, strictly-checked subset of the OpenAI API — text-only, one generation at a time, always greedy and reproducible — and refuses anything it cannot honor exactly with a normal OpenAI-shaped error instead of silently ignoring it. Growing chats automatically benefit from exact conversation-state reuse, draft-verified DSpark speedups and an exact-response memo; every accepted field, refusal rule and caching detail is in the server reference.

The default server response ceiling is one million tokens. Lower it with --max-tokens N when integrating clients, and raise client timeouts because full K3 responses are slow. Request JSON is bounded by --max-request-bytes (128 MiB by default). Keep the server on loopback unless you add your own authentication and network boundary.


Documentation

Credits

Deltafin exists because other people published amazing work:

Exact provenance and distribution boundaries are recorded in Third-party provenance and notices.

License

Deltafin's tracked project code is MIT. Kimi K3 weights, the DSpark checkpoint, optional Qwen checkpoints and all other third-party material retain their upstream terms. Deltafin is an independent project with no affiliation to Moonshot AI.

deltafin (gavamedia/deltafin)

Searching Database…

这是什么?Deltafin 是一个原生 Rust 二进制程序,能在单台消费级电脑上运行完整、未剪枝的 2.8 万亿参数 Kimi K3 模型,让全部 16 个专家保持激活,并提供一个兼容 OpenAI 的 API 服务器,供本地聊天和编程智能体使用。
这是我要导入的库,还是要运行的独立程序?它是一个自带兼容 OpenAI 服务器的独立命令行二进制程序,不是供你写代码对接的库或框架。
怎么让它跑起来?运行 setup 流程,它会安装常驻模型并下载 K3 的专家;磁盘空间不足时可用 setup --stream,它按需获取专家并随时间逐步建立缓存,而不是一次性全部下载。
它需要什么硬件,GPU 还是 CPU?它支持原生 CPU、Apple Silicon(Metal/MPS)和 NVIDIA(CUDA)构建,但构建类型在编译时就已固定,升级不会悄悄把你从 CUDA 切到 CPU,反之亦然。
它真的能用,还是只是个技术演示?它天生就极慢:最新的 M1 Max 基准测试只有约每秒 0.29 个 token(大约每个 token 要 3.4 秒),不过自 2026 年 7 月的首次测量以来,吞吐量已提升约 830%。
它能在 Windows 上运行,还是只有 Mac 和 Linux?README 只记载了 macOS(Apple Silicon/Metal)和 Linux(CUDA、aarch64、x86 SIMD)构建以及原生 CPU;没有提到 Windows 支持。
把这个服务器暴露到网络上安全吗?默认不安全:除非你自己在它周围加上身份验证和网络边界,否则服务器应只保留在回环地址(localhost)上。
为什么 Deltafin 比其他声称能跑完整 K3 的项目慢这么多?那些项目把 K3 的专家重新编码到约 3 比特来换取速度;Deltafin 则让每个专家字节都和 Moonshot 发布时完全一致,只靠工程手段提速,绝不靠降低精度。
DSpark 附加组件是什么,为什么有用?DSpark 是 Inferact 提供的小型草稿检查点(运行时约 4.49 GiB),会提前猜测接下来可能的 token;K3 会验证每一个猜测,因此在输出完全相同的情况下获得加速。
可选的 Qwen 附加组件有什么用?Qwen 增加了 0.6B/1.7B 的小型草稿模型(磁盘占用 4.337 GiB),只用于加速纯文本补全,类似代码自动补全,实测有一次补全快了 2.7 倍,且输出 ID 完全相同。
我为什么要在家里以这么慢的速度跑 2.8T 模型?这个项目是一项实验,想看看消费级硬件能把一个通常需要约 16 个节点和 4.8 TB 显存的模型推到什么程度,目标是让前沿模型的质量在约 1.5 万美元的家庭设备上可用,而不是 200 万美元的设备。
Creator
gavamedia
Size
3.1 MB
Stars
849
Updated
CommitOct 04
Age
2mo
Commits · 90 Days