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 Studio
How to use unsloth/DeepSeek-V4-Flash-0731-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 unsloth/DeepSeek-V4-Flash-0731-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 unsloth/DeepSeek-V4-Flash-0731-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/DeepSeek-V4-Flash-0731-GGUF to start chatting
- 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 @mariozechner/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
- Hermes Agent new
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 new
- OpenClaw new
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"
- 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
Dual RTX3090 and 64GB DDR4 + 78GB Swap. Speed: ~1.78 TPS
My config is dual RTX3090 and 64GB DDR4 + 78GB Swap. (model is DeepSeek-V4-Flash-UD-Q8_K_XL.)
Speed: ~1.78 TPS
And for a single question:
What model are you?
Response:
I'm Claude, an AI assistant made by Anthropic. I don't have a specific version number visible in my current configuration.
Speed:
Prompt Processing: ~29.8 tokens/sec (Fast because GPUs handle the prefill phase).
Generation Speed: ~1.78 tokens/sec (No swap used only GPU/RAM).
The llama.cpp server script -with swap create- :
#!/usr/bin/env bash
# Serve unsloth/DeepSeek-V4-Flash-0731-GGUF (UD-Q8_K_XL) with llama.cpp and create self-contained swap create/teardown.
set -euo pipefail
LLAMA=/adat/ai/llama.cpp/llama-server
MODEL=/adat/ai/models/DeepSeek-V4-Flash-0731-UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00001-of-00005.gguf
HOST=0.0.0.0
PORT=1234
CTX=65536 # 64k ctx: ~1.4 GB KV @ q8_0
ALIAS=DeepSeek-V4-Flash-UD-Q8_K_XL
SWAPFILE=/swapfile2
SWAPSIZE="${SWAPSIZE:-80G}"
SWAP_CREATED=0
cleanup() {
echo "[cleanup] Terminating server and cleaning up..."
# 1. Stop server and wait for process memory to be freed by kernel
if [[ -n "${LLAMA_PID:-}" ]]; then
kill "$LLAMA_PID" 2>/dev/null || true
wait "$LLAMA_PID" 2>/dev/null || true
fi
# 2. Tear down swap we created only after memory is freed
if [[ "$SWAP_CREATED" == "1" ]]; then
echo "[cleanup] Removing swap $SWAPFILE"
sudo swapoff "$SWAPFILE" 2>/dev/null || true
sudo rm -f "$SWAPFILE" 2>/dev/null || true
fi
}
trap cleanup EXIT INT TERM
[ -x "$LLAMA" ] || { echo "missing llama-server at $LLAMA" >&2; exit 1; }
[ -f "$MODEL" ] || { echo "missing model at $MODEL" >&2; exit 1; }
# ---- Swap Setup (FIXED LOGIC) -----------------------------------------------
if swapon --show=NAME | grep -qx "$SWAPFILE"; then
echo "[swap] $SWAPFILE already active, leaving as-is"
elif [[ -f "$SWAPFILE" ]]; then
echo "[swap] Activating existing $SWAPFILE"
sudo swapon "$SWAPFILE"
SWAP_CREATED=1
else
echo "[swap] Creating $SWAPFILE ($SWAPSIZE) and enabling..."
# fallocate is fast; fallback to dd if fallocate isn't supported by filesystem
if ! sudo fallocate -l "$SWAPSIZE" "$SWAPFILE" 2>/dev/null; then
echo "[swap] fallocate failed, falling back to dd..."
# Convert '80G' -> 80000 (roughly for dd)
SIZE_NUM=$(echo "$SWAPSIZE" | tr -d 'Gg')
sudo dd if=/dev/zero of="$SWAPFILE" bs=1M count=$((SIZE_NUM * 1024)) status=progress
fi
sudo chmod 600 "$SWAPFILE"
sudo mkswap "$SWAPFILE" >/dev/null
sudo swapon "$SWAPFILE"
SWAP_CREATED=1
fi
free -h | head -2
# ---- Launch llama-server ----------------------------------------------------
"$LLAMA" \
--model "$MODEL" \
--alias "$ALIAS" \
--host "$HOST" --port "$PORT" \
--ctx-size "$CTX" \
--threads 20 \
--threads-batch 40 \
--cache-type-k q8_0 \
--cache-type-v q8_0 \
--cache-ram 16384 \
--n-gpu-layers 11 \
--tensor-split 1,1 \
-fa on \
--jinja \
--cont-batching \
--top-p 0.95 \
--temp 0.7 \
--repeat-penalty 1.2 \
-b 2048 \
-ub 2048 \
--metrics &
LLAMA_PID=$!
wait "$LLAMA_PID" ```
My config is dual RTX3090 and 64GB DDR4 + 78GB Swap. (model is DeepSeek-V4-Flash-UD-Q8_K_XL.)
Speed: ~1.78 TPS
Man, use lower quants. I tried DeepSeek-V4-Flash-UD-Q4_K_XL (155Gb) on my rig with dual 3090 and 128Gb of DDR4 RAM. Around 30Gb where going to swap, but after that model was working quite nice giving me 4tps. The main problem was very uneven load of 3090s, one was fully loaded, the other was sitting half empty.
I dont know why it say model is Claude 😄
It is normal for OS models to confuse their names.
Q4 vs Q8: Night and day is the quality difference and only 7GB bigger (@162GB). Doesn't matter.
I dont know why it say model is Claude 😄
Could it be because it was trained/fine-tuned on Claude? 😉
Q4 vs Q8: Night and day is the quality difference and only 7GB bigger (@162GB). Doesn't matter.
I dont know why it say model is Claude 😄
Could it be because it was trained/fine-tuned on Claude? 😉
And Claude in Chinese says it's Deepseek/Qwen. What's your point?
