CoolFace
Modelpublic

samuelcardillo/Qwen3-Coder-Next-Opus-4.6-Reasoning-Distilled-GGUF

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
44likes828downloads
Model Card

Qwen3-Coder-Next — Opus 4.6 Reasoning Distilled (GGUF)

GGUF quantizations of the full fine-tuned Qwen/Qwen3-Coder-Next (~80B total / ~3B active, MoE) with Claude Opus 4.6 reasoning distillation. Trained on 8x H100 80GB SXM with DeepSpeed ZeRO-3, all parameters.

Model Details

PropertyValue
Base ModelQwen/Qwen3-Coder-Next
Architectureqwen3_next (Mixture of Experts)
Total Parameters~80B
Active Parameters~3B per token (10 of 512 experts)
Expert Config512 experts, 10 active per token, intermediate=512
Shared ExpertYes (intermediate=512)
AttentionHybrid: linear attention + full attention every 4th layer
Hidden Size2048
Layers48
Attention Heads16 (2 KV heads, GQA)
Intermediate Size5120
Vocab Size151,936
Max Context262,144 tokens (256K)
RoPEPartial rotary (0.25), theta=5M

Available Quantizations

QuantizationSizeBPWMin VRAMUse Case
BF16149 GB16.012x 96GBFull precision, lossless
Q8_079 GB8.501x 96GBBest quality quant — recommended for RTX PRO 6000
Q6_K62 GB6.581x 80GBHigh quality with room for large context
Q5_K_M54 GB5.701x 80GBGreat quality/size balance
Q4_K_M46 GB4.871x 48GBGood quality — fits RTX 4090/A6000 or maximizes context on larger GPUs
MXFP4_MOE42 GB4.391x 48GBMXFP4 for expert weights, Q8 for routing — best quality at 4-bit for MoE

Benchmark Results

Evaluated by Claude Opus 4.6 across 26 tests in 6 categories, scored 1-10 on correctness, completeness, clarity, and adherence to instructions.

CategoryBase ModelOpus DistilledWinnerDelta
Coding8.28.5Opus Distilled+0.3
Bug Detection8.49.0Opus Distilled+0.6
Probability8.68.0Base-0.6
Tool Calling3.47.2Opus Distilled+3.8
Logic8.57.5Base-1.0
Instruction Following7.77.0Base-0.7
Overall7.357.73Opus Distilled+0.38

Detailed Test Results

Coding (6 tests)
TestBaseOpusWinnerNotes
Python: Trie Implementation99TieBoth correct and complete
Python: Async Web Scraper89OpusOpus uses cleaner class-based design with semaphore rate limiting
Rust: Custom Iterator89OpusOpus adds idiomatic impl Iterator<Item = u64> convenience function
TypeScript: Event Emitter88TieBoth implement type-safe emitters with different valid approaches
SQL: Complex Query78OpusBase has a bug: references window function in WHERE of same SELECT
Python: Graph BFS/DFS98BaseBase covers more methods within token budget
Bug Detection (5 tests)
TestBaseOpusWinnerNotes
Off-by-one in binary search99TieBoth find all 4 bugs
Race condition in Go89OpusOpus adds deadlock diagram + 3 solutions vs 2
Memory leak in C++99TieBoth identify Rule of Three/Five violations
Security bugs in JavaScript89OpusOpus adds severity table, catches JWT forgery and missing rate limiting
Deadlock in Python threading89OpusOpus provides step-by-step timeline diagram + Coffman conditions
Probability (5 tests)
TestBaseOpusWinnerNotes
Bayes' Theorem99TieBoth correct (~1.94%)
Birthday Problem Variant98BaseBase more mathematically rigorous
Monty Hall Extended99TieBoth correctly derive P(switch)=2/5
Markov Chain86BaseOpus made computation error, had to restart
Combinatorics: Card Hands99TieBoth correct on completed sections
Tool Calling (5 tests) — Largest improvement
TestBaseOpusWinnerNotes
Weather API planning27OpusBase outputs single call (37 tokens). Opus chains all 3 tools.
Database CRUD operations38OpusBase: 1 tool call (119 tokens). Opus: complete 4-step workflow.
Multi-step file operations43BaseBoth perform poorly on this test
API orchestration27OpusBase outputs malformed tool call. Opus plans 3 clear steps.
Complex reasoning with tools67OpusBase batches lookups correctly but stops. Opus completes reasoning.
Logic (2 tests)
TestBaseOpusWinnerNotes
Sudoku Solver Explanation98BaseBase explains constraint propagation more clearly within token budget
Einstein's Riddle87BaseBase makes more deduction progress within token budget
Instruction Following (3 tests)
TestBaseOpusWinnerNotes
Structured JSON output106BaseBase: clean JSON only (453 tokens). Opus: 2048 tokens, ignored constraint
Code with exact constraints56OpusBoth struggle. Base self-corrects mid-response.
Multi-format output88TieBoth truncated, similar quality

Key Findings

  • —Tool Calling: Largest improvement (+3.8). Base model outputs only the first tool call and stops. Opus Distilled plans full multi-step tool chains with reasoning between steps.
  • —Bug Detection: Opus Distilled provides more structured analysis with severity tables, timeline diagrams, and catches more edge cases (+0.6).
  • —Coding: Opus Distilled favors class-based architectures with better design patterns. Caught a SQL bug (window function in WHERE clause) that Base missed.
  • —Probability: Base is more concise and made fewer computation errors. Opus Distilled made an error on a Markov Chain steady-state calculation.
  • —Logic: Base makes better progress within token budgets — Opus Distilled spends more tokens on preamble.
  • —Instruction Following: Base adheres more strictly to output format constraints (e.g., "output ONLY valid JSON").

Verdict

Opus-Distilled wins overall driven by massively better tool calling and slightly better bug detection and coding. Base wins on math/probability (fewer errors), logic (better token efficiency), and instruction following (better constraint adherence). For coding assistant use cases where tool calling matters, Opus-Distilled is clearly superior.

Performance

Both models run at comparable speeds on RTX PRO 6000 Blackwell (96GB) with Q8_0:

MetricBaseOpus Distilled
Tokens/sec100.5102.5
Avg response length1,085 tokens1,464 tokens

Usage with llama.cpp

Basic Serving

bash
llama-server \
  --model Qwen3-Coder-Next-Opus-Distilled-Q8_0.gguf \
  --n-gpu-layers -1 \
  --ctx-size 262144 \
  --host 0.0.0.0 --port 8081

With Reasoning Support (Recommended)

The model produces <think>...</think> reasoning blocks. To properly separate these from the visible output, use a custom chat template with --reasoning-format deepseek:

bash
llama-server \
  --model Qwen3-Coder-Next-Opus-Distilled-Q8_0.gguf \
  --n-gpu-layers -1 \
  --ctx-size 262144 \
  --chat-template-file qwen3-think.jinja \
  --reasoning-format deepseek \
  --host 0.0.0.0 --port 8081

This puts the thinking in message.reasoning_content and keeps message.content clean.

Chat Template

The repo includes a ready-to-use `qwen3-think.jinja` chat template that supports both <think> reasoning and Qwen3's XML tool calling format. Download it alongside the GGUF:

bash
# Download model + template
huggingface-cli download samuelcardillo/Qwen3-Coder-Next-Opus-4.6-Reasoning-Distilled-GGUF \
  Qwen3-Coder-Next-Opus-Distilled-Q8_0.gguf qwen3-think.jinja \
  --local-dir ./
Note: The base Qwen3-Coder-Next chat template does NOT include <think> tag support. You must use the provided qwen3-think.jinja template for proper reasoning and tool calling behavior. Thanks to @codyknowscode for the tool calling fix.

OpenAI-Compatible API

The model serves an OpenAI-compatible API. Example request:

bash
curl http://localhost:8081/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "opus-distilled",
    "messages": [{"role": "user", "content": "Implement a thread-safe LRU cache in Rust"}],
    "max_tokens": 4096,
    "temperature": 0.6
  }'

Response includes reasoning_content (thinking) separate from content (answer).

Training Details

Hardware & Infrastructure

  • —GPUs: 8x NVIDIA H100 80GB SXM with NVLink
  • —System RAM: 2 TB DDR5
  • —Distribution: DeepSpeed ZeRO-3 (parameters sharded across all 8 GPUs)
  • —Optimizer Offload: AdamW optimizer states offloaded to CPU RAM (~700GB)
  • —Platform: RunPod

Hyperparameters

ParameterValue
MethodFull fine-tune (all parameters)
FrameworkHuggingFace TRL 1.0.0 + DeepSpeed 0.18.9
Transformers5.4.0
OptimizerAdamW (CPU offloaded via DeepSpeed ZeRO-3)
Learning Rate2e-5 (cosine schedule)
Warmup5% of steps
Weight Decay0.01
Gradient Clipping1.0
Epochs3
Effective Batch Size32 (1 per GPU x 4 grad accum x 8 GPUs)
Max Sequence Length8192 (training context window)
Gradient CheckpointingEnabled (non-reentrant)
PrecisionBF16
Total Steps303
Seed42

Training Progression

MetricStep 1Step 50Step 114Step 150Step 214Step 303 (Final)
Loss0.8700.4980.2440.2100.1150.062
Token Accuracy78.0%84.4%91.5%93.5%96.5%98.1%
Learning Rate01.94e-51.51e-51.29e-54.66e-65.99e-10
Epoch0.010.501.111.332.103.00

Datasets

3,204 examples after quality filtering (required <think> tags and >200 characters of assistant content):

DatasetExamplesDescription
nohurry/Opus-4.6-Reasoning-3000x-filtered2,321Claude Opus 4.6 reasoning traces (thinking + solution)
TeichAI/claude-4.5-opus-high-reasoning-250x250High-quality Claude reasoning conversations
Jackrong/Qwen3.5-reasoning-700x633Qwen reasoning conversations

Data Format

Each training example follows this structure:

<|im_start|>user
{problem}<|im_end|>
<|im_start|>assistant
<think>
{chain-of-thought reasoning}
</think>

{final answer}<|im_end|>

Quality Filter

Examples were filtered to require:

  1. 1.At least one assistant message containing <think> tags
  2. 2.Assistant content longer than 200 characters

This removed low-quality or non-reasoning examples from the combined dataset.

Reasoning Format

The model produces reasoning inside <think>...</think> tags:

<think>
Let me analyze this step by step...
1. First consideration
2. Second consideration
3. Conclusion
</think>

Here is the final answer based on my analysis.

HF Safetensors

For the full-precision HuggingFace model (BF16 safetensors), see samuelcardillo/Qwen3-Coder-Next-Opus-4.6-Reasoning-Distilled.