Instructions to use ivanfioravanti/deepseek-v4-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ivanfioravanti/deepseek-v4-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ivanfioravanti/deepseek-v4-gguf", filename="DeepSeek-V4-Flash-Layers10-30-39-42Q4KExperts-OtherExpertLayersQ2-imatrix.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ivanfioravanti/deepseek-v4-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 ivanfioravanti/deepseek-v4-gguf # Run inference directly in the terminal: llama cli -hf ivanfioravanti/deepseek-v4-gguf
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ivanfioravanti/deepseek-v4-gguf # Run inference directly in the terminal: llama cli -hf ivanfioravanti/deepseek-v4-gguf
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 ivanfioravanti/deepseek-v4-gguf # Run inference directly in the terminal: ./llama-cli -hf ivanfioravanti/deepseek-v4-gguf
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 ivanfioravanti/deepseek-v4-gguf # Run inference directly in the terminal: ./build/bin/llama-cli -hf ivanfioravanti/deepseek-v4-gguf
Use Docker
docker model run hf.co/ivanfioravanti/deepseek-v4-gguf
- LM Studio
- Jan
- Ollama
How to use ivanfioravanti/deepseek-v4-gguf with Ollama:
ollama run hf.co/ivanfioravanti/deepseek-v4-gguf
- Unsloth Studio
How to use ivanfioravanti/deepseek-v4-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 ivanfioravanti/deepseek-v4-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 ivanfioravanti/deepseek-v4-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ivanfioravanti/deepseek-v4-gguf to start chatting
- Pi
How to use ivanfioravanti/deepseek-v4-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ivanfioravanti/deepseek-v4-gguf
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": "ivanfioravanti/deepseek-v4-gguf" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ivanfioravanti/deepseek-v4-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 ivanfioravanti/deepseek-v4-gguf
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 ivanfioravanti/deepseek-v4-gguf
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use ivanfioravanti/deepseek-v4-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ivanfioravanti/deepseek-v4-gguf
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 "ivanfioravanti/deepseek-v4-gguf" \ --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 ivanfioravanti/deepseek-v4-gguf with Docker Model Runner:
docker model run hf.co/ivanfioravanti/deepseek-v4-gguf
- Lemonade
How to use ivanfioravanti/deepseek-v4-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ivanfioravanti/deepseek-v4-gguf
Run and chat with the model
lemonade run user.deepseek-v4-gguf-{{QUANT_TAG}}List all available models
lemonade list
DeepSeek V4 Flash — mixed Q2/Q4 GGUF
Mixed-quantization GGUF for the DS4 runtime.
Quantization recipe
- Q4_K routed experts in layers
10,30, and39–42. - Other routed-expert layers use the Q2 imatrix recipe: IQ2_XXS gate/up and Q2_K down tensors.
- Attention projections, shared experts, and output tensors follow the DS4 Q2-imatrix template.
- Six of 43 layers use Q4 routed experts (
13.95%). - File size: 97,591,747,456 bytes (
90.89 GiB).
The selected Q4 tensors were copied byte-for-byte from the compatible Q4-imatrix GGUF. Other tensors remain byte-identical to the Q2-imatrix base.
Evaluation
All variants below were scored on the same 100 official DeepSeek V4 Flash continuations containing 2,289 target tokens.
| Model / routed-expert recipe | Size | Average NLL ↓ | NLL vs Q2 | Wins vs Q2 | First-token matches ↑ | Average greedy LCP ↑ |
|---|---|---|---|---|---|---|
| Q2 imatrix baseline | 80.76 GiB | 0.368177401 | — | — | 63 / 100 | 5.96 |
Antirez mixed recipe: Q4 layers 37–42 |
90.89 GiB | 0.340543836 | -7.506% | 67 / 33 | 68 / 100 | 6.90 |
This model: Q4 layers 10, 30, 39–42 |
90.89 GiB | 0.338330454 | -8.107% | 73 / 27 | 68 / 100 | 7.47 |
| Full Q4 imatrix | 153.33 GiB | 0.173978006 | -52.746% | 87 / 13 | 86 / 100 | 12.88 |
Lower NLL is better. First-token matches count how often greedy generation starts with the same token as the official continuation. Greedy LCP is the number of consecutive matching tokens before the first divergence, so higher is better.
At the same 90.89 GiB size as the Antirez six-layer recipe, this configuration improved NLL, preserved the same first-token match count, and increased average greedy LCP from 6.90 to 7.47.
Usage
./ds4 \
-m DeepSeek-V4-Flash-Layers10-30-39-42Q4KExperts-OtherExpertLayersQ2-imatrix.gguf \
--ctx 4096 \
-p "Hello"
This GGUF uses DS4-specific DeepSeek V4 tensor naming and mixed routed-expert quantization.
- Downloads last month
- 309
We're not able to determine the quantization variants.
Model tree for ivanfioravanti/deepseek-v4-gguf
Base model
deepseek-ai/DeepSeek-V4-Flash