Text Generation
GGUF
mellum
mellum2
code
coding
reasoning
thinking
Mixture of Experts
llama.cpp
local-llm
conversational
Instructions to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-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 yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-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 yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
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 yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
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 yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
Use Docker
docker model run hf.co/yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-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": "yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
- Ollama
How to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF with Ollama:
ollama run hf.co/yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
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": "yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF with Docker Model Runner:
docker model run hf.co/yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
- Lemonade
How to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-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 yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
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 yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M
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 "yuxinlu1/Mellum2-12B-A2.5B-Claude-4.6-4.8-Opus-Thinking-GGUF:Q4_K_M" \ --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"
Add model card
Browse files
README.md
CHANGED
|
@@ -1,3 +1,160 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: JetBrains/Mellum2-12B-A2.5B-Thinking
|
| 4 |
+
library_name: gguf
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags: [mellum, mellum2, code, coding, reasoning, thinking, moe, gguf, llama.cpp, local-llm]
|
| 7 |
---
|
| 8 |
+
|
| 9 |
+
# โ๏ธ Mellum2-12B-A2.5B-Reasoning-Distill (GGUF) โ๏ธ
|
| 10 |
+
### ๐งโ๐ป A fast little coding brain โ local AI for *everyone*
|
| 11 |
+
|
| 12 |
+
> **12B total params, only 2.5B active per token.** This is a **Mixture-of-Experts** model, so it *runs
|
| 13 |
+
> like a ~2.5B model* but *thinks like a 12B* one. ๐
|
| 14 |
+
> Built on **JetBrains' Mellum 2** (a from-scratch software-engineering model) and tuned on **Claude Opus
|
| 15 |
+
> 4.6 / 4.7 / 4.8** reasoning traces โ it reasons step-by-step in `<think>` blocks, then answers. ๐ง ๐ป
|
| 16 |
+
> All local, all yours, no API, no cloud. And it's **seriously fast.**
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## โก Blazing fast โ *measured*, not marketing ๐๏ธ๐จ
|
| 21 |
+
**~440 tokens/sec on a single RTX 5090** at Q4_K_M (`--n-gpu-layers 99 -fa on`) โ and **generation quality
|
| 22 |
+
holds up**: correct, coherent code and clean step-by-step reasoning. ๐ฏ
|
| 23 |
+
|
| 24 |
+
You get **big-model answers at small-model speed.** Why so quick? It's a **Mixture-of-Experts** (only 2.5B of
|
| 25 |
+
the 12B params fire per token) with a **compact 98K vocab** โ so it generates several times faster than a
|
| 26 |
+
dense model its size, **with no draft / speculative model needed.** ๐
|
| 27 |
+
|
| 28 |
+
| Hardware | Quant | Generation speed (measured) |
|
| 29 |
+
|---|---|---|
|
| 30 |
+
| RTX 5090 (32 GB) | Q4_K_M | **~440 tok/s** โก |
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## ๐ฆ Pick your size (GGUF quants)
|
| 35 |
+
|
| 36 |
+
| Quant | Size | Vibe |
|
| 37 |
+
|------|------|------|
|
| 38 |
+
| ๐ข **Q2_K** | **5.0 GB** | tiniest โ runs almost anywhere |
|
| 39 |
+
| ๐ต **Q4_K_M** | **8.1 GB** | the sweet spot ๐ (recommended) |
|
| 40 |
+
| ๐ฃ **Q6_K** | **10.9 GB** | near-lossless |
|
| 41 |
+
| โช **Q8_0** | **12.9 GB** | basically full quality |
|
| 42 |
+
| (f16) | 24.3 GB | full precision (overkill for most) |
|
| 43 |
+
|
| 44 |
+
> ๐ก It's a **Mixture-of-Experts**: all 64 experts live on disk/VRAM (so size is for the *whole* 12B), but
|
| 45 |
+
> only 8 fire per token โ that's why it's so quick.
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## ๐งฎ "Will it fit?" โ rough VRAM guide
|
| 50 |
+
|
| 51 |
+
Mellum2 has a **tiny KV cache** (GQA with just 4 KV heads, and sliding-window attention on 3 of every 4
|
| 52 |
+
layers) โ so **context is rarely the limiter.** Pick the quant that fits your VRAM and you'll have plenty
|
| 53 |
+
of room for long context (max is **131K**). Rough numbers ๐ค (weights + ~2 GB overhead):
|
| 54 |
+
|
| 55 |
+
| Your VRAM / unified mem | Best quant that fits | Context headroom |
|
| 56 |
+
|---|---|---|
|
| 57 |
+
| **8 GB** | ๐ข Q2_K | comfy (long ctx still fits) |
|
| 58 |
+
| **12 GB** | ๐ต Q4_K_M | lots |
|
| 59 |
+
| **16 GB** | ๐ฃ Q6_K / โช Q8_0 | lots |
|
| 60 |
+
| **24 GB+**| โช Q8_0 (or f16) | up to 131K ๐ |
|
| 61 |
+
|
| 62 |
+
> ๐ก Apple Silicon / iGPUs with **unified memory** count too โ same idea, just slower than a dGPU.
|
| 63 |
+
> ๐ก Tight on room? Drop a quant or use a `q4_0` KV cache for even more context.
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
## ๐ How to run it (super easy)
|
| 68 |
+
|
| 69 |
+
### Option A โ llama.cpp (recommended) ๐ฆ
|
| 70 |
+
1. Grab a quant above (e.g. `โฆ-Q4_K_M.gguf`) and `llama-server` from [llama.cpp](https://github.com/ggml-org/llama.cpp).
|
| 71 |
+
> โ ๏ธ Needs a **recent llama.cpp** that supports the **`mellum2`** architecture (a mid-2026 build or newer).
|
| 72 |
+
> Older builds fail with `unknown architecture: 'mellum2'`.
|
| 73 |
+
2. Run a server (Windows `.bat` shown โ tweak `--port`, `--ctx-size` to taste):
|
| 74 |
+
|
| 75 |
+
```bat
|
| 76 |
+
@echo off
|
| 77 |
+
cd /d C:\llama.cpp
|
| 78 |
+
llama-server.exe ^
|
| 79 |
+
-m C:\models\mellum2-claude-Q4_K_M.gguf ^
|
| 80 |
+
--ctx-size 16384 ^
|
| 81 |
+
--n-gpu-layers 99 ^
|
| 82 |
+
--no-mmap ^
|
| 83 |
+
-fa on ^
|
| 84 |
+
--jinja --reasoning-format deepseek ^
|
| 85 |
+
--temp 0.6 --top-p 0.95 --top-k 20 ^
|
| 86 |
+
--host 0.0.0.0 --port 18080
|
| 87 |
+
pause
|
| 88 |
+
```
|
| 89 |
+
3. Open `http://localhost:18080` and chat. ๐ (Tip: bump `--ctx-size` โ the KV cache is small, so go big.)
|
| 90 |
+
|
| 91 |
+
### Option B โ one-click apps ๐ฑ๏ธ
|
| 92 |
+
Works in **LM Studio**, **Jan**, **Ollama**, etc. โ just import the GGUF, pick your quant, go. ๐พ
|
| 93 |
+
*(Make sure the app ships a recent llama.cpp that knows `mellum2`.)*
|
| 94 |
+
|
| 95 |
+
### ๐ง Thinking mode
|
| 96 |
+
This model thinks natively in `<think> โฆ </think>` blocks. The chat template handles it automatically;
|
| 97 |
+
the `--reasoning-format deepseek` flag tells llama.cpp to surface the reasoning cleanly.
|
| 98 |
+
**Recommended sampling: `temp 0.6, top_p 0.95, top_k 20`** (JetBrains' official settings for the Thinking model).
|
| 99 |
+
|
| 100 |
+
<details><summary>๐ Prefer raw transformers? (click)</summary>
|
| 101 |
+
|
| 102 |
+
> This repo ships **GGUF** (for llama.cpp). To run in raw transformers you need non-GGUF weights โ point `mid`
|
| 103 |
+
> at the original JetBrains checkpoint (or your own merged fp16). Needs **`transformers >= 5.8`** (the `mellum`
|
| 104 |
+
> architecture is built in โ no `trust_remote_code`). It's a plain text **CausalLM** (not multimodal).
|
| 105 |
+
|
| 106 |
+
```python
|
| 107 |
+
import torch
|
| 108 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 109 |
+
|
| 110 |
+
mid = "JetBrains/Mellum2-12B-A2.5B-Thinking" # GGUF won't load here โ use non-GGUF weights
|
| 111 |
+
tok = AutoTokenizer.from_pretrained(mid)
|
| 112 |
+
model = AutoModelForCausalLM.from_pretrained(mid, dtype=torch.bfloat16,
|
| 113 |
+
device_map="auto", attn_implementation="sdpa")
|
| 114 |
+
|
| 115 |
+
msgs = [{"role": "user", "content": "Write a Python function to check if a number is prime."}]
|
| 116 |
+
inputs = tok.apply_chat_template(msgs, return_tensors="pt", add_generation_prompt=True,
|
| 117 |
+
enable_thinking=True)
|
| 118 |
+
inputs = inputs.to(model.device)
|
| 119 |
+
out = model.generate(inputs, max_new_tokens=512, temperature=0.6, top_p=0.95, top_k=20)
|
| 120 |
+
print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=False))
|
| 121 |
+
```
|
| 122 |
+
</details>
|
| 123 |
+
|
| 124 |
+
---
|
| 125 |
+
|
| 126 |
+
## โก Why no MTP / draft model?
|
| 127 |
+
JetBrains' Mellum 2 uses Multi-Token Prediction as a **training-time** objective only โ it isn't exported to
|
| 128 |
+
the released weights, so there's no draft to ship. **You don't need one:** with just 2.5B active params and a
|
| 129 |
+
compact vocab, it already generates extremely fast (~440 tok/s on a 5090 at Q4_K_M). ๐๏ธ
|
| 130 |
+
|
| 131 |
+
---
|
| 132 |
+
|
| 133 |
+
## ๐งฉ What is this, exactly?
|
| 134 |
+
- **Base:** [`JetBrains/Mellum2-12B-A2.5B-Thinking`](https://huggingface.co/JetBrains/Mellum2-12B-A2.5B-Thinking)
|
| 135 |
+
โ a **from-scratch**, software-engineering-focused **Mixture-of-Experts** model (12.15B total / **2.5B active**,
|
| 136 |
+
28 layers, 64 experts with 8 active, 131K context). JetBrains already did SFT + RLVR on it; this is a light
|
| 137 |
+
extra **LoRA distillation** pass on top.
|
| 138 |
+
- **This fine-tune:** a low-intensity QLoRA-style pass over the attention projections, distilling **Claude Opus
|
| 139 |
+
reasoning style** into the model. It keeps Mellum 2's coding/agent strengths while nudging the reasoning
|
| 140 |
+
voice toward Opus. ๐ก
|
| 141 |
+
|
| 142 |
+
---
|
| 143 |
+
|
| 144 |
+
## โ ๏ธ Good to know
|
| 145 |
+
- **Coding-first:** Mellum 2 is built for code generation, editing, debugging, tool-calls and agents. Great at
|
| 146 |
+
programming + structured reasoning; it's **not** a general-knowledge encyclopedia.
|
| 147 |
+
- **Reduced refusals:** the distillation data omits safety hedging, so it refuses less than a typical aligned
|
| 148 |
+
chat model. It is **not** safety-aligned โ add your own guardrails for production. Use responsibly. ๐
|
| 149 |
+
- The reasoning is *stylistic* synthetic CoT โ great for structure, but double-check facts and numbers.
|
| 150 |
+
- English-centric (handles other languages, but English is strongest).
|
| 151 |
+
|
| 152 |
+
---
|
| 153 |
+
|
| 154 |
+
## ๐ Data & License
|
| 155 |
+
- **Base model:** [`JetBrains/Mellum2-12B-A2.5B-Thinking`](https://huggingface.co/JetBrains/Mellum2-12B-A2.5B-Thinking),
|
| 156 |
+
released under **Apache-2.0**.
|
| 157 |
+
- **Training data:** built on the public, **Apache-2.0** dataset
|
| 158 |
+
[`angrygiraffe/claude-opus-4.6-4.7-reasoning-8.7k`](https://huggingface.co/datasets/angrygiraffe/claude-opus-4.6-4.7-reasoning-8.7k),
|
| 159 |
+
**augmented with additional Opus 4.8-generated reasoning samples** I curated and mixed in.
|
| 160 |
+
- Personal/hobby project โ shared as-is, no warranty. Have fun! ๐พโจ
|