Instructions to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF", filename="DeepSeek-V4-Flash-REAP-K128.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF # Run inference directly in the terminal: llama cli -hf sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF # Run inference directly in the terminal: llama cli -hf sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF # Run inference directly in the terminal: ./llama-cli -hf sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF # Run inference directly in the terminal: ./build/bin/llama-cli -hf sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
Use Docker
docker model run hf.co/sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
- LM Studio
- Jan
- vLLM
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
- Ollama
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with Ollama:
ollama run hf.co/sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
- Unsloth Studio
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF to start chatting
- Pi
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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": "sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 "sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-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 sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with Docker Model Runner:
docker model run hf.co/sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
- Lemonade
How to use sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sleepyeldrazi/deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF
Run and chat with the model
lemonade run user.deepseek-v4-flash-reap-k128-Q2-Q4-Mixed-GGUF-{{QUANT_TAG}}List all available models
lemonade list
Upload DeepSeek-V4-Flash-REAP-K128 Q2/Q4 Mixed GGUF
Browse files- .gitattributes +1 -0
- DeepSeek-V4-Flash-REAP-K128.gguf +3 -0
- DeepSeek-V4-Flash-REAP-K128.gguf.reap_plan.json +0 -0
- README.md +94 -0
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
DeepSeek-V4-Flash-REAP-K128.gguf filter=lfs diff=lfs merge=lfs -text
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b46812c007a43dd8c2888fc51cd4fa7b331785f89ef6866fb0389c478e7d54e6
|
| 3 |
+
size 55875180192
|
|
The diff for this file is too large to render.
See raw diff
|
|
|
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- deepseek
|
| 5 |
+
- deepseek-v4
|
| 6 |
+
- deepseek-v4-flash
|
| 7 |
+
- mixture-of-experts
|
| 8 |
+
- reap
|
| 9 |
+
- expert-pruning
|
| 10 |
+
- gguf
|
| 11 |
+
- ds4
|
| 12 |
+
- experimental
|
| 13 |
+
- dgx-spark
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# DeepSeek V4 Flash — REAP K128 (Mixed Precision)
|
| 18 |
+
|
| 19 |
+
REAP-pruned DeepSeek V4 Flash at **K128** (128 routed experts per MoE layer).
|
| 20 |
+
Prunes 50% of routed experts via Cerebras REAP (Router-weighted Expert Activation Pruning),
|
| 21 |
+
preserving all attention, embeddings, shared experts, router, and MTP components.
|
| 22 |
+
|
| 23 |
+
## At a Glance
|
| 24 |
+
|
| 25 |
+
| | |
|
| 26 |
+
|---|---|
|
| 27 |
+
| **Base model** | DeepSeek V4 Flash |
|
| 28 |
+
| **Donor GGUF** | antirez Layers37-42Q4KExperts (90.9 GiB) |
|
| 29 |
+
| **Pruning method** | REAP (Cerebras Research) |
|
| 30 |
+
| **Routed experts** | 128 per layer (down from 256) |
|
| 31 |
+
| **Kept slots** | 5,888 / 11,008 |
|
| 32 |
+
| **Hash-preserved** | Layers 0-2 (256 experts each) |
|
| 33 |
+
| **Pruned** | Layers 3-42 (128 experts each) |
|
| 34 |
+
| **Format** | ds4-compact-v1 GGUF |
|
| 35 |
+
| **File size** | 52.04 GiB |
|
| 36 |
+
| **Mixed precision** | Layers 3-36: Q2_K/IQ2_XXS · Layers 37-42: Q4_K |
|
| 37 |
+
|
| 38 |
+
> **Note:** This variant preserves the donor's mixed quantization (Q4_K in layers 37-42,
|
| 39 |
+
> IQ2_XXS/Q2_K elsewhere). Requires a ds4 runtime that handles per-layer quant type dispatch.
|
| 40 |
+
> If you encounter "expected IQ2_XXS expert tensors" errors, use the
|
| 41 |
+
> [uniform variant](https://huggingface.co/sleepyeldrazi/deepseek-v4-flash-reap-k128-uniform).
|
| 42 |
+
|
| 43 |
+
## Domain Split (Calibration)
|
| 44 |
+
|
| 45 |
+
8,000 prompts · 5.0M tokens · 1.3B routed expert observations
|
| 46 |
+
|
| 47 |
+
| Domain | Share |
|
| 48 |
+
|---|---|
|
| 49 |
+
| Coding & development | 35-40% |
|
| 50 |
+
| Agentic tool-calling | 16% |
|
| 51 |
+
| Research & knowledge | 15-20% |
|
| 52 |
+
| Math & science | 10-15% |
|
| 53 |
+
| Design & planning | 5-10% |
|
| 54 |
+
| Trivia & general QA | 3-5% |
|
| 55 |
+
|
| 56 |
+
Calibration used the REAP `activation_energy_sum2` score metric with 4,096 token context per prompt.
|
| 57 |
+
Top-to-bottom expert score gap in layer 3: 2,200x (strong pruning signal).
|
| 58 |
+
|
| 59 |
+
## How to Run
|
| 60 |
+
|
| 61 |
+
Requires **eouya2/ds4-for-reaped** (ds4 engine with compact GGUF support):
|
| 62 |
+
|
| 63 |
+
```bash
|
| 64 |
+
git clone https://github.com/eouya2/ds4-for-reaped
|
| 65 |
+
cd ds4-for-reaped
|
| 66 |
+
make cuda-spark -j$(nproc) # DGX Spark / CUDA
|
| 67 |
+
# or: make # Metal / macOS
|
| 68 |
+
|
| 69 |
+
./ds4 --cuda -m DeepSeek-V4-Flash-REAP-K128.gguf --ctx 131072
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
API server mode:
|
| 73 |
+
```bash
|
| 74 |
+
./ds4-server --cuda -m DeepSeek-V4-Flash-REAP-K128.gguf \
|
| 75 |
+
--host 0.0.0.0 --port 17777 --ctx 131072
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
## How It Was Built
|
| 79 |
+
|
| 80 |
+
1. **Donor GGUF**: Downloaded antirez Layers37-42Q4KExperts variant (90.9 GiB) — Q4_K experts in deep layers, IQ2_XXS/Q2_K elsewhere
|
| 81 |
+
2. **Calibration**: 8,000 prompts collected and run through ds4's imatrix collector on a DGX Spark (NVIDIA GB10) at 4,096 token context
|
| 82 |
+
3. **REAP scoring**: Imatrix activation data converted to per-expert REAP scores using `activation_energy_sum2`
|
| 83 |
+
4. **Pruning**: 50% expert removal via `ds4_prune_gguf.py` from eouya2/reap-for-ds4. Layers 0-2 (hash-routed) preserved. Expert tensors copied byte-for-byte — no dequant/requant.
|
| 84 |
+
5. **Output**: `ds4-compact-v1` GGUF
|
| 85 |
+
|
| 86 |
+
**No fine-tuning.** Purely structural expert removal. Weights are unmodified — a subset of the original experts.
|
| 87 |
+
|
| 88 |
+
## Acknowledgments
|
| 89 |
+
|
| 90 |
+
- **DeepSeek** — [DeepSeek V4 Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash) base model
|
| 91 |
+
- **antirez** — [ds4 engine](https://github.com/antirez/ds4) and [GGUF quants](https://huggingface.co/antirez/deepseek-v4-gguf)
|
| 92 |
+
- **eouya2** — [ds4-for-reaped](https://github.com/eouya2/ds4-for-reaped) and [reap-for-ds4](https://github.com/eouya2/reap-for-ds4)
|
| 93 |
+
- **Cerebras Research** — [REAP](https://arxiv.org/abs/2510.13999) ([code](https://github.com/CerebrasResearch/reap))
|
| 94 |
+
- **NVIDIA** — DGX Spark hardware
|