Instructions to use Minerva-Laboratories/Mercurius-0.5-4B-Preview 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 Minerva-Laboratories/Mercurius-0.5-4B-Preview 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 Minerva-Laboratories/Mercurius-0.5-4B-Preview # Run inference directly in the terminal: llama cli -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview # Run inference directly in the terminal: llama cli -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview # Run inference directly in the terminal: ./build/bin/llama cli -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview
Use Docker
docker model run hf.co/Minerva-Laboratories/Mercurius-0.5-4B-Preview
- Llama new
- LM Studio
- Jan
- Ollama
How to use Minerva-Laboratories/Mercurius-0.5-4B-Preview with Ollama:
ollama run hf.co/Minerva-Laboratories/Mercurius-0.5-4B-Preview
- Unsloth Desktop
- Pi
How to use Minerva-Laboratories/Mercurius-0.5-4B-Preview with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview
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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Minerva-Laboratories/Mercurius-0.5-4B-Preview" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Minerva-Laboratories/Mercurius-0.5-4B-Preview with Docker Model Runner:
docker model run hf.co/Minerva-Laboratories/Mercurius-0.5-4B-Preview
- Lemonade
How to use Minerva-Laboratories/Mercurius-0.5-4B-Preview with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Minerva-Laboratories/Mercurius-0.5-4B-Preview
Run and chat with the model
lemonade run user.Mercurius-0.5-4B-Preview-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use Minerva-Laboratories/Mercurius-0.5-4B-Preview with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview
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:9931/v1 hermes config set model.default Minerva-Laboratories/Mercurius-0.5-4B-Preview
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Minerva-Laboratories/Mercurius-0.5-4B-Preview with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Minerva-Laboratories/Mercurius-0.5-4B-Preview
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:9931/v1 \ --custom-model-id "Minerva-Laboratories/Mercurius-0.5-4B-Preview" \ --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"
Mercurius 0.5 4B Preview
Intermediate checkpoint of a Mercurius-Pipeline run. Training is paused at step 5825 of 6300, with quantization-aware training (QAT) active since step 4200.
- Student: Qwen3.5-4B converted to a hybrid architecture: 24 GDN-2 layers plus 8 MLA layers, with VeRA adapters.
- Teacher: Qwen3.6-35B-A3B, served by llama.cpp.
- KV cache: FoveaKV 2+2, 10% dynamic tokens (Dyn10).
- Corpus: 70.8M text tokens, 39.1M agentic-episode tokens and 10.4M math tokens.
- Code:
Minerva-Laboratories/Mercurius-Pipeline, branchfeat/native-foveakv-evaluation.
Files
| File | Description |
|---|---|
mercurius-0.5-4b-preview-foveakv-dyn10.gguf |
Deployable GGUF with packed Q4/Q8 weights and FoveaKV Dyn10 metadata. Requires the patched llama.cpp fork built by scripts/build_native_bench.sh. Stock llama.cpp will not load it correctly. |
model.safetensors |
Packed Q4/Q8 weights for the PyTorch pipeline (mercurius-packed-v1). Load it with config.json, the tokenizer files and export-manifest.json, which records the checksums. This is not a standard Transformers checkpoint. |
resume.pt |
Training resume state for the pipeline. It is not standalone: it needs the converted base model produced by the pipeline. |
Benchmarks
Both models were evaluated with the same protocol: llama.cpp/CUDA, the same
examples, prompts and per-example seeds, non-thinking mode, and the
qwen35_nonthinking_v1 decoding profile (temperature 0.7, top-p 0.8,
top-k 20, presence penalty 1.5). Each answer could use up to 32,768 tokens.
Mercurius runs with FoveaKV 2+2 Dyn10; the original Qwen3.5-4B runs with F32
weights and an exact KV cache. Scores come from a single sample per example,
with no retries and no best-of selection.
| Benchmark | Mercurius 0.5 4B Preview | Qwen3.5-4B, same protocol | Difference |
|---|---|---|---|
| HumanEval (164) | 68.90% | 84.15% | -15.2 pp |
| MBPP sanitized (257) | 71.21% | 79.38% | -8.2 pp |
| GSM8K (1,319) | 91.96% | 94.16% | -2.2 pp |
| RULER, 5 tasks at 32K (200) | 83.38% | 92.25% | -8.9 pp |
| PG-19 perplexity at 65,536 (12 books, lower is better) | 13.09 | 12.22 | +0.86 |
The difference is Mercurius minus the original.
- GSM8K is in-domain, because its training split is part of the corpus.
- In RULER, most of Mercurius's loss comes from niah_multikey_3 (60.0% vs 72.5%) and niah_multivalue (82.5% vs 96.25%). Both models score 100% on niah_multikey_2.
- In PG-19, the NLL gap stays at about 0.06-0.07 nats in every position bucket from 0-2K to 32K-64K, so it does not grow with context length.
- Mercurius produced 5 answers that hit the 32,768-token limit across HumanEval, MBPP and GSM8K, and all 5 failed. They are repetitive loops. The original produced none.
- This compares the full deployed models, so it cannot separate the effects of training, the MLA conversion, weight quantization and FoveaKV.
This is an intermediate checkpoint, not a final release.
- Downloads last month
- 488