Instructions to use unsloth/DeepSeek-V4-Flash-0731-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 unsloth/DeepSeek-V4-Flash-0731-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 unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
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 unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./llama-cli -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
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 unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
Use Docker
docker model run hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
- LM Studio
- Jan
- Ollama
How to use unsloth/DeepSeek-V4-Flash-0731-GGUF with Ollama:
ollama run hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
- Unsloth Desktop
- Pi
How to use unsloth/DeepSeek-V4-Flash-0731-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use unsloth/DeepSeek-V4-Flash-0731-GGUF with Docker Model Runner:
docker model run hf.co/unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
- Lemonade
How to use unsloth/DeepSeek-V4-Flash-0731-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
Run and chat with the model
lemonade run user.DeepSeek-V4-Flash-0731-GGUF-UD-Q4_K_XL
List all available models
lemonade list
- Hermes Agent
How to use unsloth/DeepSeek-V4-Flash-0731-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use unsloth/DeepSeek-V4-Flash-0731-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q4_K_XL" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
DSpark enables DeepSeek to run 2x Faster!
Hey guys, DeepSeek-V4-Flash can now run 2× faster locally with DSpark! ⚡️
DSpark enables V4-Flash-0731 GGUFs to generate ~1.4–2× faster with no accuracy change.
DeepSeek-V4-Flash-0731 can reach at 120 tokens/s.
GGUFs: https://huggingface.co/unsloth/DeepSeek-V4-Flash-0731-GGUF
Guide: https://unsloth.ai/docs/models/deepseek-v4
I wish this was more obvious than buried, but using llama.cpp its something like
-hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 4
I don't know the sweet spot on spec-draft-n-max
recipes.vllm.ai has the stuff for vllm configs for spec decoding.
oh good the docs has it spelled out! using --spec-draft-n-max 3
https://unsloth.ai/docs/models/deepseek-v4#dspark-speculative-decoding
Getting an impression that DSpark is useless with a 4-channel DDR4 + 2x 3090 rig (PCIE 4.0 x16, no nvlink; Win11 + Unsloth Studio), since there's no benefit whatsoever.
1x 3090 no DSpark: ~10 t/s generation --- Q8K_XL fits with 100K context (44 GPU layers, 43 MOE CPU layers), using VRAM quite sparingly and allowing for a higher batch size (2K to 8K).
2x 3090 with or without DSpark, no difference: ~7 t/s generation --- interestingly, it consumes the available VRAM pool unevenly (23GB on one GPU, and about a half of that on another GPU). EDIT 1: this is no longer the case after Unsloth Studio update (both GPUs now show almost equal VRAM usage), however, generation speed remains inferior.
EDIT 2: "prefer maximum performance" in NVIDIA app got me to 9 - 10 t/s with DSpark and 2x 3090, which is still weird.
@danielhanchen Any chances we could get dspark quants where the routed experts are quanted down to save on memory on the dspark model?
EDIT 2: "prefer maximum performance" in NVIDIA app got me to 9 - 10 t/s with DSpark and 2x 3090, which is still weird.
Same 2x3090 + 128GB DRAM @ 4800 (OC, 4-sticks) 8.8-9.5 at full quant. Happy as a clam. Model chugs while i do other things.
No amount of faffing got me better results than simple -fit on with llama.cpp.
9995WX, 1024GB DDR5 6400MT/s ECC, RTX Pro 6000 w/96GB of GDDR7.
I did this series top down, then realized I should collect ram usage so i did them in reverse bottom up. A lot of numbers were the same or nearly identical so I only have one set, but as I moved up the list, the things that were slow became faster and I'm not sure why. The llama.cpp webUI consists of one prompt and I kept regenerating the one answer. On one attempt I started a new chat with same question and achieved basically identical performance as the regenerated answer.
I'm sitting around 166w peak on my GPU. With llama-b10509-bin-win-cuda-13.3-x64\llama-server.exe (and some of my usual settings) and
--ctx-size 262144 --load-mode dio -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 3 --reasoning on --fit on
for my sample prompt I get
1st, 821 tokens, 1min 27s, 9.34 t/s, (didn't capture ram usage first run)
2nd, 829 tokens, 38s, 21.54 t/s, 108 GB total system RAM after prompt (+ 95.8 GB of GPU VRAM holding part of model).
1st, draft acceptance = 0.73152 ( 564 accepted / 771 generated), mean len = 3.19
2nd, draft acceptance = 0.75033 ( 574 accepted / 765 generated), mean len = 3.25
--ctx-size 262144 --load-mode dio -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 3 --reasoning on
1st, 1,167 tokens, 2min 3s, 9.44 t/s, (didn't capture ram usage first run)
2nd, 1,020 tokens, 44s, 22.86 t/s, 108 GB total system RAM after prompt (+ 95.8 GB of GPU VRAM holding part of model).
1st, draft acceptance = 0.75936 ( 811 accepted / 1068 generated), mean len = 3.28
2nd, draft acceptance = 0.78878 ( 717 accepted / 909 generated), mean len = 3.37
--ctx-size 262144 --load-mode dio -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 3 --reasoning on --seed 3407
1st, 792 tokens, 1min 21s, 9.72 t/s, (didn't capture ram usage first run)
2nd, 792 tokens, 35s, 22.59 t/s, (When I re-ran to get system ram usage I got these speeds) (108 GB total system RAM after prompt (+ 95.8 GB of GPU VRAM holding part of model).
1st, draft acceptance = 0.77451 ( 553 accepted / 714 generated), mean len = 3.32
--ctx-size 262144 --load-mode dio -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 3 --reasoning on --seed 3407 --cpu-moe
936 tokens, 22s, 41.54 t/s, 170 GB total system RAM after prompt (+ 34.6 GB of GPU VRAM holding part of model).
draft acceptance = 0.78095 ( 656 accepted / 840 generated), mean len = 3.34
--ctx-size 262144 --load-mode dio -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 3 --reasoning on --seed 3407 --cpu-moe -ctk q8_0 -ctv q8_0
916 tokens, 22s, 40.63 t/s, 170 GB total system RAM after prompt (+ 31.4 GB of GPU VRAM holding part of model).
draft acceptance = 0.76499 ( 638 accepted / 834 generated), mean len = 3.29
--ctx-size 262144 --load-mode dio -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 3 --reasoning on --seed 3407 --cpu-moe -ctk q8_0 -ctv q8_0 --fit on
916 tokens, 22s, 40.61 t/s, 170 GB total system RAM after prompt (+ 31.4 GB of GPU VRAM holding part of model).
draft acceptance = 0.76499 ( 638 accepted / 834 generated), mean len = 3.29
--ctx-size 262144 --load-mode dio -hf unsloth/DeepSeek-V4-Flash-0731-GGUF:UD-Q8_K_XL --temp 1.0 --top-p 0.95 --spec-type draft-dspark --spec-draft-n-max 3 --reasoning on --seed 3407 --fit on
792 tokens, 36s, 21.91 t/s, 108 GB total system RAM after prompt (+ 95.8 GB of GPU VRAM holding part of model).
draft acceptance = 0.77451 ( 553 accepted / 714 generated), mean len = 3.32
Using real long prompts the ones that were doing ~40t/s seem to stabilize out around 30-40 t/s
Maybe this is helpful for someone.