Text Generation
Safetensors
English
qwen3_5
reasoning
agent-traces
distillation
dora
qwen
nitrai
opengcm
conversational
Instructions to use NitrAI/OpenGCM-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Inference
File size: 5,891 Bytes
e8da3e9 8f6d013 e8da3e9 8f6d013 7fc1252 ed6359d 7fc1252 e8da3e9 237ab77 ed6359d 0471903 ed6359d 8f6d013 e8da3e9 ea34f95 8f6d013 ea34f95 e8da3e9 ea34f95 e8da3e9 63fa849 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | ---
license: apache-2.0
language:
- en
tags:
- text-generation
- reasoning
- agent-traces
- distillation
- dora
- qwen
- qwen3_5
- nitrai
- opengcm
pretty_name: OpenGCM-v2 9B
base_model: Qwen/Qwen3.5-9B
pipeline_tag: text-generation
---
<p align="center">
<img src="https://huggingface.co/NitrAI/OpenGCM-v2/resolve/main/OpenGCM_banner.png" alt="NitrAI OpenGCM-v2" style="width:100%; max-width:1200px; border-radius:18px; border:1px solid rgba(0,229,255,0.45);" />
</p>
## Benchmarks
<p align="center">
<img src="https://huggingface.co/NitrAI/OpenGCM-v2/resolve/main/benchmark_comparison.svg" alt="NitrAI OpenGCM-v2 bench" style="width:100%; max-width:1500px; border-radius:18px; border:1px solid rgba(0,229,255,0.45);" />
</p>
## Overview
**OpenGCM-v2** is a reasoning-focused 9B parameter model developed by **NitrAI**. The model is built on top of the next-generation **Qwen3.5-9B** base model, which features state-of-the-art architectures and a 262k context window.
The goal of OpenGCM-v2 is to distill complex coding-agent trajectories, multi-step math logic, and system-level reasoning from frontier LLMs (GPT-5.5, Claude-Fable-5, and GLM-5.2) into a highly efficient, lightweight consumer-hardware-friendly model.
## Distillation Mixture
To prevent VRAM paging bottlenecks during training on consumer GPUs, the dataset was strictly audited, cleaned of outlier long sequences, and downsampled to fit an optimal token budget. The final fine-tuning dataset consists of **597 high-signal QA items** containing **904,466 tokens** in total.
### Dataset Composition Breakdown
| Source Dataset | Count (QAs) | Total Tokens | Avg Tokens | Min Tokens | Max Tokens | Description |
| :--- | :---: | :---: | :---: | :---: | :---: | :--- |
| **fable-5** | 159 | 399,989 | 2,515.7 | 108 | 3,981 | Real tool-use/bash/filesystem agent trajectories from Fable-5. |
| **gpt-5.5** | 410 | 399,689 | 974.9 | 586 | 1,023 | Detailed reasoning and step-by-step instruction distillation from GPT-5.5. |
| **glm-5.2** | 28 | 104,788 | 3,742.4 | 842 | 7,994 | Complex system-level reasoning traces and tool-use steps from GLM-5.2. |
| **Total** | **597** | **904,466** | **1,515.0** | **108** | **7,994** | Balanced multi-source agent-reasoning blend. |
## Training Methodology
The training was performed locally on a single consumer GPU setup using the **Unsloth** library (leveraging optimized Triton fused kernels for training acceleration) and **DoRA (Weight-Decomposed Low-Rank Adaptation)**.
### Hyperparameters & Settings
* **Base Model**: `Qwen/Qwen3.5-9B`
* **PEFT Method**: DoRA (Weight-Decomposed LoRA)
* **Rank (r)**: 64
* **Alpha (α)**: 128
* **Target Modules**: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`
* **Max Sequence Length**: 2048 tokens
* **Optimizer**: `adamw_8bit`
* **Learning Rate**: $1.5 \times 10^{-5}$
* **Warmup steps**: 110 (10% of training steps)
* **Training Steps**: 1100
* **Batch Size**: 1 (Gradient Accumulation Steps = 4, effective batch size = 4)
* **Precision**: `bfloat16`
## Evaluation & Performance
We evaluated OpenGCM-v2 on a suite of hard benchmarks (AIME, SWE-bench Pro, GPQA, MMMU Pro, LiveCodeBench) and compared it to `gemma4-coder-fable5`:
| Benchmark | OpenGCM-v2 (9B) Accuracy | OpenGCM-v2 Time (s) | gemma4-coder-fable5 Accuracy | gemma4-coder-fable5 Time (s) |
| :--- | :---: | :---: | :---: | :---: |
| **AIME 26** | **1/1 (100%)** | 33.2s | 1/1 (100%) | 20.6s |
| **SWE-bench Pro** | **1/1 (100%)** | 17.8s | 0/1 (0%) | 7.5s |
| **GPQA Diamond** | 0/1 (0%) | 67.7s | 1/1 (100%) | 14.3s |
| **MMMU Pro** | 0/1 (0%) | 38.2s | 1/1 (100%) | 16.4s |
| **LiveCodeBench** | 0/1 (0%) | 162.8s | 0/1 (0%) | 59.3s |
### Key Strengths & Weaknesses
* **Strengths**:
* Exceptional math reasoning and step-by-step logical decomposition (solved AIME sequence problems perfectly).
* Highly capable of localized code reasoning and bug patch verification (SWE-bench).
* **Limitations**:
* Occasional instability / context drift during extremely long inference generation where it might switch focus or hallucinate the task constraints. A lower temperature (e.g. `0.2` or `0.4`) and structured system prompts are recommended.
## Usage
### Ollama Configuration
You can easily run this model locally in **Ollama** by creating a `Modelfile` with the following configuration:
```dockerfile
FROM ./opengcm_Q6_K.gguf
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ .Response }}<|im_end|>
"""
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
```
### Transformers Inference Example
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "NitrAI/OpenGCM-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
messages = [
{"role": "system", "content": "You are a helpful assistant. Use step-by-step reasoning enclosed in <think>...</think> tags before answering."},
{"role": "user", "content": "Solve: a_1 = 1, a_2 = 3. For n >= 3, a_n is the smallest positive integer that hasn't appeared yet and is coprime to a_{n-1}. Find a_100."}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(
inputs,
max_new_tokens=1024,
temperature=0.4,
do_sample=True
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
## Citation & Acknowledgements
Special thanks to the open-source community, Hugging Face, **Unsloth**, and the creators of the original source datasets:
* `ansulev/GPT-5.5-Thinking-Max-Distill-25k`
* `AletheiaResearch/GLM-5.2-Agent`
* `Glint-Research/Fable-5-traces`
|