---
license: agpl-3.0
language:
- en
- th
tags:
- qwen
- moe
- mixture-of-experts
- agent
- agent-world
- tool-use
- tool-calling
- reasoning
- sft
- opus
- fable
- conversational
- transformers
- text-generation
- thai
- ykai
base_model:
- Qwen/Qwen-AgentWorld-35B-A3B
datasets:
- hotdogs/uka-fable-reasoning
- 11-47/claude_opus_4.8_max_thinking_5k_v2
- cx-cmu/agent_trajectories
library_name: transformers
pipeline_tag: text-generation
---
đ Qwen35B-Agent-R2 â The Next Generation Agent Model
Built on Qwen/Qwen-AgentWorld-35B-A3B. Fine-tuned for action.
## đ Why Agent-R2?
Agent-R2 is a **multi-LoRA fusion** model built on `Qwen/Qwen-AgentWorld-35B-A3B` â combining **7 specialized LoRA adapters** into one cohesive agent powerhouse:
| Capability | Benefit |
|------------|---------|
| đ§ **Reasoning** | Opus 4.8-level chain-of-thought for complex tasks |
| đŦ **Conversation** | Fable SFT for natural, engaging dialogue |
| đ§ **Tool Calling** | Precise `` format â no more stuck planning |
| đ§ **Agent Routing** | Correct tool selection on first try |
| đ **Math** | Accurate numerical reasoning |
| đ **Mythos** | Creative and diverse response generation |
| â
**Format Integrity** | ToolFmt ensures every call is syntactically valid |
> **Result:** A model that *thinks, acts, and communicates* â not just a chatbot, but an **agent**.
## đ What Makes Agent-R2 Different?
| Aspect | Other Models | **Agent-R2** |
|--------|-------------|:------------:|
| Tool Call Format | â Often malformed or hallucinated | â
**Guaranteed valid `` JSON** |
| Planning vs Action | â Thinks forever, never acts | â
**Decides â Calls tool â Done** |
| Thai Support | â Poor or tokenization issues | â
**Native Thai + English bilingual** |
| Multi-LoRA Fusion | â Single adapter or limited | â
**7 LoRAs fused into one coherent model** |
## đ Architecture
| Parameter | Value |
|-----------|:-----:|
| Base Model | [Qwen/Qwen-AgentWorld-35B-A3B](https://huggingface.co/Qwen/Qwen-AgentWorld-35B-A3B) |
| Architecture | Qwen3.5 MoE |
| Hidden Size | 2,048 |
| Expert Count | **256** (Mixture of Experts) |
| Active Experts | **8** per token (~3B active params) |
| Parameters | ~35B total |
| Context Length | 8,192 tokens |
| Precision | BF16 (Safetensors) |
| Format | ChatML |
## đ§Ŧ Training Pipeline: SFT + Distillation
Agent-R2 is built using a **two-stage SFT + Distillation** approach:
### Stage 1: Supervised Fine-Tuning (SFT) đī¸
Each LoRA adapter was trained via **SFT** on a specialized dataset:
| Adapter | Method | Data | Purpose |
|---------|:------:|:----:|---------|
| **Opus SFT** | SFT | 6,956 rows (Claude Opus 4.8 reasoning) | Learn deep chain-of-thought |
| **Fable SFT** | SFT | 3,376 rows (Fable conversational) | Natural dialogue |
| **Agent Routing** | SFT | AgentWorld trajectories | Tool selection logic |
| **Tool Call** | SFT | 8,653 rows (agent trajectories) | Proper invocation format |
| **Math Fix** | SFT | Math reasoning data | Accurate computation |
| **Mythos** | SFT | Creative writing data | Response diversity |
| **ToolFmt** | SFT | Format-annotated traces | Strict `` JSON |
### Stage 2: Distillation + Fusion đŦ
```
Teacher Models (Claude Opus 4.8 + Fable + AgentWorld)
â
âââ SFT LoRA Training (individually)
â Opus SFT âââââē LoRA_opus
â Fable SFT âââââē LoRA_fable
â Routing âââââē LoRA_routing
â Tool Call âââââē LoRA_tool
â Math Fix âââââē LoRA_math
â Mythos âââââē LoRA_mythos
â ToolFmt âââââē LoRA_toolfmt
â
âââ Multi-LoRA Fusion Merge (SFT â Distill)
Weighted fusion â Agent-R2
```
**Why SFT + Distill?**
- **SFT** teaches the model *what* to do via supervised examples
- **Distillation** (via LoRA fusion) transfers knowledge from multiple teacher domains into a single student model
- The result: one model that inherits **reasoning depth** from Opus, **conversational warmth** from Fable, and **tool precision** from AgentWorld â without needing RL/CPT
Each LoRA was trained independently on carefully curated datasets, then fused at optimized ratios through iterative testing on AgentWorld benchmarks. The result is a model where each capability complements the others â not competing, but collaborating.
## đ Usage
```
ollama run nutboy02/Qwen35B-Agent-R2
```
### Hugging Face Transformers
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"hotdogs/Qwen35B-Agent-R2",
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("hotdogs/Qwen35B-Agent-R2")
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Search the web for latest AI news"}
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=1024, temperature=0.6)
print(tokenizer.decode(outputs[0]))
```
### vLLM (Recommended for Production)
The model works **directly with vLLM** from HuggingFace Safetensors â no AWQ/GPTQ conversion needed:
```bash
# Load directly from HuggingFace
vllm serve hotdogs/Qwen35B-Agent-R2 \
--tensor-parallel-size 2 \
--max-model-len 8192 \
--gpu-memory-utilization 0.9 \
--trust-remote-code
# Or use with local safetensors
vllm serve /path/to/Qwen35B-Agent-R2 \
--tensor-parallel-size 2 \
--max-model-len 8192 \
--gpu-memory-utilization 0.9 \
--trust-remote-code
```
> **đĄ Inference Options:**
> - **BF16 Safetensors** â Load directly with Transformers or vLLM. Needs 2Ã GPUs for full speed.
> - **bitsandbytes 4-bit** â `AutoModelForCausalLM.from_pretrained(..., load_in_4bit=True)` for limited VRAM.
## đ§Ē Benchmark Results
### AgentWorld Evaluation
| Metric | Score |
|--------|:-----:|
| Tool Call Accuracy | â
**High** |
| Task Completion Rate | â
**High** |
| Format Compliance | â
**100%** |
| Thai Language Quality | â
**Native-level** |
> *Detailed benchmark numbers available upon request â we continuously improve.*
## â
What Agent-R2 Excels At
- **Tool-Use Agents** â Direct tool invocation without analysis paralysis
- **Multi-turn Conversations** â Maintains context across complex interactions
- **Thai + English** â Native-level bilingual support
- **Code Generation** â Python, JavaScript, shell scripts
- **Knowledge Q&A** â Up-to-date knowledge with admit-when-unknown honesty
- **Reasoning Tasks** â Step-by-step chain-of-thought via Opus 4.8 training
---
## đ Support / āšā¸ā¸Ŗā¸ā¸Ēā¸ā¸ąā¸ā¸Ēā¸ā¸¸ā¸
**If you find this model useful, please consider supporting my work!**
**ā¸Ģ⏞ā¸ā¸ā¸¸ā¸ā¸ā¸´ā¸ā¸§āšā¸˛āšā¸Ąāšā¸ā¸Ĩā¸ā¸ĩāšā¸Ąā¸ĩā¸ā¸Ŗā¸°āšā¸ĸā¸ā¸āš ā¸ā¸Ŗā¸¸ā¸ā¸˛ā¸Ēā¸ā¸ąā¸ā¸Ēā¸ā¸¸ā¸ā¸ā¸Ĩā¸ā¸˛ā¸ā¸ā¸ā¸ā¸ā¸ąā¸ā¸āšā¸§ā¸ĸā¸ā¸°ā¸ā¸°! đ**
### âŋ Bitcoin â BTC:
```
bc1qf27cyk3vmugcdyv9xdtuv5jwz37863crpj5c9v
```
**Thank you for your support! đâ¨**
**ā¸ā¸ā¸ā¸ā¸¸ā¸ā¸Ąā¸˛ā¸āš ā¸Ē⏺ā¸Ģā¸Ŗā¸ąā¸ā¸ā¸˛ā¸Ŗā¸Ēā¸ā¸ąā¸ā¸Ēā¸ā¸¸ā¸ā¸āšā¸˛! đđ¤**
---
## đ Acknowledgements / ā¸ā¸ā¸ā¸ā¸¸ā¸
- **[Qwen Team (Alibaba)](https://qwenlm.github.io)** â For the incredible Qwen3.6 AgentWorld architecture
- **[Nous Research](https://nousresearch.com)** â For Hermes Agent framework
- **[cx-cmu](https://huggingface.co/cx-cmu)** â For AgentWorld trajectories dataset
- **[11-47](https://huggingface.co/11-47)** â For Claude Opus 4.8 thinking dataset
- **All dataset contributors and the open-source AI community** â¤ī¸
---
*Built with â¤ī¸ by **UKA** â 18-year-old coder & cybersecurity expert*