Instructions to use gaber/kimi-k3-dspark-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use gaber/kimi-k3-dspark-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf gaber/kimi-k3-dspark-gguf:BF16 # Run inference directly in the terminal: llama cli -hf gaber/kimi-k3-dspark-gguf:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf gaber/kimi-k3-dspark-gguf:BF16 # Run inference directly in the terminal: llama cli -hf gaber/kimi-k3-dspark-gguf:BF16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf gaber/kimi-k3-dspark-gguf:BF16 # Run inference directly in the terminal: ./llama-cli -hf gaber/kimi-k3-dspark-gguf:BF16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf gaber/kimi-k3-dspark-gguf:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf gaber/kimi-k3-dspark-gguf:BF16
Use Docker
docker model run hf.co/gaber/kimi-k3-dspark-gguf:BF16
- LM Studio
- Jan
- vLLM
How to use gaber/kimi-k3-dspark-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gaber/kimi-k3-dspark-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gaber/kimi-k3-dspark-gguf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gaber/kimi-k3-dspark-gguf:BF16
- Ollama
How to use gaber/kimi-k3-dspark-gguf with Ollama:
ollama run hf.co/gaber/kimi-k3-dspark-gguf:BF16
- Unsloth Studio
How to use gaber/kimi-k3-dspark-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gaber/kimi-k3-dspark-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gaber/kimi-k3-dspark-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for gaber/kimi-k3-dspark-gguf to start chatting
- Docker Model Runner
How to use gaber/kimi-k3-dspark-gguf with Docker Model Runner:
docker model run hf.co/gaber/kimi-k3-dspark-gguf:BF16
- Lemonade
How to use gaber/kimi-k3-dspark-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull gaber/kimi-k3-dspark-gguf:BF16
Run and chat with the model
lemonade run user.kimi-k3-dspark-gguf-BF16
List all available models
lemonade list
- Atomic Chat
Kimi-K3 DSpark Draft Model β GGUF (BF16)
β οΈ Experimental β This GGUF was converted from a model that's only 2 days old (as of 2026-07-30). The file format is correct but upstream llama.cpp cannot run it yet β see Runtime status below.
A GGUF conversion of Inferact/Kimi-K3-DSpark, an MLA-native DSpark draft model designed to accelerate moonshotai/Kimi-K3 inference through speculative decoding.
What is this?
DSpark is a small draft model that predicts multiple tokens ahead of the main Kimi-K3 model. The main model then verifies those predictions in a single forward pass, accepting correct ones and rejecting mistakes. This gives you 3β5Γ faster generation without changing the output quality β the distribution is mathematically identical to running the target model alone.
This particular draft model is "MLA-native" β it uses the same Multi-head Latent Attention architecture as Kimi-K3 itself, which means the draft and target share one KV cache layout. No separate memory management needed.
How it works
- 5 transformer layers with MLA attention (q_lora_rank=1536, kv_lora_rank=512)
- Markov head β a semi-autoregressive block predictor that drafts 7 tokens per forward pass
- Confidence head β decides when to draft and when to fall back to the target model
- Trained on Kimi-K3's own hidden states from layers [2, 23, 47, 71, 89] of 93
GGUF vs original model
The original Inferact/Kimi-K3-DSpark is 4B params (7.12 GB) because it includes embed_tokens.weight β a 1.17B parameter embedding matrix shared with Kimi-K3's vocabulary. This GGUF is 2.4B params (4.45 GB) because we stripped that tensor.
Why? Because llama.cpp's DFlash runtime never loads it. The draft model only processes hidden states from the target β it never sees raw token IDs at inference time. The embed_tokens was used during training (TorchSpec needs it for the forward pass) but is dead weight at runtime.
Verified: We compared the embed_tokens tensors from both models and confirmed they are not identical β DSpark was trained with its own embeddings, optimized for its 5-layer architecture. This is expected: a shallow model benefits from different embedding geometry than a 93-layer one.
vLLM vs llama.cpp
This same model runs on two engines, with different assumptions:
vLLM (works today):
vllm serve moonshotai/Kimi-K3 \
--speculative-config '{"method": "dspark", "model": "Inferact/Kimi-K3-DSpark", ...}'
- Loads the full 4B-param safetensors (with
embed_tokens) - Draft runs as a standalone model with its own embedding layer
- Both share MLA KV layout β draft's pages unify with target's cache
- Native
FLASHINFER_MLAbackend, dedicateddsparkspec decode worker - Achieves 464 tok/s on 4Γ GB300 at bs=1
llama.cpp (needs runtime patch):
llama-server -m kimi-k3.gguf -md dspark-draft.gguf --spec-type draft-dspark
- Loads stripped 2.4B-param GGUF (no
embed_tokens) - Draft is a lightweight extension of the target
- Target handles tokenization/embedding, passes hidden states directly
- Needs MLA support ported from
kimi_linear.cpptodflash.cpp
Both approaches are lossless β the output distribution is identical to running the target model alone.
GGUF metadata
| Key | Value |
|---|---|
| Architecture | dflash |
| Block size | 7 |
| Target layers | [3, 4, 5, 6, 7, 8, 9] |
| Embedding dim | 7168 |
| Vocab size | 163,840 |
| KV lora rank | 512 |
| Q lora rank | 1536 |
| Quantization | BF16 |
| Tensors | 72 |
| File size | 4.45 GB |
Runtime status
The GGUF file is structurally correct β architecture, tensor names, MLA parameters, DSpark heads, and tokenizer are all properly encoded.
However, upstream llama.cpp cannot run it yet. The C++ runtime's DFLASH model implementation (src/models/dflash.cpp) currently only loads standard multi-head attention tensors (attn_q, attn_k, attn_v). This GGUF uses MLA tensors (attn_q_a, attn_kv_a_mqa, attn_k_b, attn_v_b) which require a patch to the runtime's tensor loading and attention graph.
In other words: the file format is right, but the engine doesn't know how to read the MLA tensors inside the DFLASH architecture yet. The code even acknowledges this with a TODO comment:
"only Qwen3-style backbones are supported for now; other backbones need their own conversion path and graph tweaks"
What's needed from llama.cpp
src/models/dflash.cppβ Add MLA tensor loading (attn_q_a,attn_kv_a_mqa,attn_k_b,attn_v_b) to the DFLASH architecture, similar to howsrc/models/kimi_linear.cpphandles them- Attention graph β Build the MLA decompression graph (compressed KV β full K/V via
kv_b_proj) inside the DFLASH forward pass - Rope handling β MLA uses split rope dimensions (
qk_nope_head_dim+qk_rope_head_dim) which the standard DFLASH path doesn't support
These changes exist in kimi_linear.cpp already β they need to be ported to dflash.cpp. Once upstream adds MLA support to DFLASH, this GGUF should work with:
llama-server \
-m kimi-k3-target.gguf \
-md Kimi-K3-DSpark-draft-bf16.gguf \
--spec-type draft-dspark \
-ngld 99
Conversion details
Converted from Inferact/Kimi-K3-DSpark (safetensors) using a patched convert_hf_to_gguf.py. The converter needed three patches:
- Register
K3DSparkModelarchitecture inconversion/__init__.py - Add
K3DSparkModelconverter class inconversion/kimi_linear.pywith MLA parameter handling and tensor name remapping - Add MLA tensor definitions to the
DFLASHarch ingguf-py/gguf/constants.py
The patches and conversion script are saved in the modal_agent project under converters/.
Links
- Source model: Inferact/Kimi-K3-DSpark
- Target model: moonshotai/Kimi-K3
- DSpark paper: arxiv.org/abs/2607.05147
- Speculative decoding in llama.cpp: docs/speculative.md
- Downloads last month
- 2,781
16-bit