Text Generation
Transformers
GGUF
qwen
unsloth
world-model
agent
environment-simulation
imatrix
conversational
Instructions to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/Qwen-AgentWorld-35B-A3B-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("unsloth/Qwen-AgentWorld-35B-A3B-GGUF", dtype="auto") - llama-cpp-python
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="unsloth/Qwen-AgentWorld-35B-A3B-GGUF", filename="BF16/Qwen-AgentWorld-35B-A3B-BF16-00001-of-00002.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use unsloth/Qwen-AgentWorld-35B-A3B-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 unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-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 unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-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 unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
Use Docker
docker model run hf.co/unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
- LM Studio
- Jan
- vLLM
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/Qwen-AgentWorld-35B-A3B-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": "unsloth/Qwen-AgentWorld-35B-A3B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
- SGLang
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "unsloth/Qwen-AgentWorld-35B-A3B-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Qwen-AgentWorld-35B-A3B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "unsloth/Qwen-AgentWorld-35B-A3B-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Qwen-AgentWorld-35B-A3B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with Ollama:
ollama run hf.co/unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
- Unsloth Studio
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/Qwen-AgentWorld-35B-A3B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/Qwen-AgentWorld-35B-A3B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/Qwen-AgentWorld-35B-A3B-GGUF to start chatting
- Pi
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use unsloth/Qwen-AgentWorld-35B-A3B-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 unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-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 unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with Docker Model Runner:
docker model run hf.co/unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
- Lemonade
How to use unsloth/Qwen-AgentWorld-35B-A3B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull unsloth/Qwen-AgentWorld-35B-A3B-GGUF:UD-Q4_K_M
Run and chat with the model
lemonade run user.Qwen-AgentWorld-35B-A3B-GGUF-UD-Q4_K_M
List all available models
lemonade list
Upload folder using huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
license_link: https://huggingface.co/Qwen/Qwen-AgentWorld-35B-A3B/blob/main/LICENSE
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
base_model:
|
| 7 |
+
- Qwen/Qwen-AgentWorld-35B-A3B
|
| 8 |
+
datasets:
|
| 9 |
+
- Qwen/AgentWorldBench
|
| 10 |
+
tags:
|
| 11 |
+
- qwen
|
| 12 |
+
- unsloth
|
| 13 |
+
- world-model
|
| 14 |
+
- agent
|
| 15 |
+
- environment-simulation
|
| 16 |
+
---
|
| 17 |
+
<div>
|
| 18 |
+
<p style="margin-top: 0;margin-bottom: 0;">
|
| 19 |
+
<em><a href="https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>
|
| 20 |
+
</p>
|
| 21 |
+
<div style="display: flex; gap: 5px; align-items: center; ">
|
| 22 |
+
<a href="https://github.com/unslothai/unsloth/">
|
| 23 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
|
| 24 |
+
</a>
|
| 25 |
+
<a href="https://discord.gg/unsloth">
|
| 26 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
|
| 27 |
+
</a>
|
| 28 |
+
<a href="https://docs.unsloth.ai/">
|
| 29 |
+
<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
|
| 30 |
+
</a>
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
# Qwen-AgentWorld-35B-A3B
|
| 36 |
+
|
| 37 |
+
<div style="text-align: center">
|
| 38 |
+
<img width="400px" src="https://qianwen-res.oss-accelerate-overseas.aliyuncs.com/Qwen-AgentWorld/logo.png">
|
| 39 |
+
<p>
|
| 40 |
+
<a href="http://arxiv.org/abs/2606.24597">📑 Technical Report</a> |
|
| 41 |
+
<a href="https://qwen.ai/blog?id=qwen-agentworld">📖 Blog</a> |
|
| 42 |
+
<a href="https://huggingface.co/collections/Qwen/qwen-agentworld">🤗 Hugging Face</a> |
|
| 43 |
+
<a href="https://modelscope.cn/collections/Qwen/Qwen-AgentWorld">🤖 ModelScope</a> |
|
| 44 |
+
<a href="https://github.com/QwenLM/Qwen-AgentWorld">💻 GitHub</a> |
|
| 45 |
+
<a href="https://qwen.ai/blog?id=qwen-agentworld#interactive-demo-interactive-demo">🖥️ Demo</a>
|
| 46 |
+
</p>
|
| 47 |
+
</div>
|
| 48 |
+
|
| 49 |
+
> [!Note]
|
| 50 |
+
> This repository contains the model weights and configuration files for **Qwen-AgentWorld-35B-A3B**, a native language world model trained for agentic environment simulation.
|
| 51 |
+
>
|
| 52 |
+
> These artifacts are compatible with Hugging Face Transformers, vLLM, SGLang, etc.
|
| 53 |
+
|
| 54 |
+
**Qwen-AgentWorld** is the first language world model to cover seven agent interaction domains within a single model. It simulates agentic environments via long chain-of-thought reasoning, predicting the next environment state given an agent's action and interaction history. Trained through a three-stage pipeline — CPT injects environment knowledge, SFT activates next-state-prediction reasoning, RL sharpens simulation fidelity — Qwen-AgentWorld is a **native world model**: environment modeling is the training objective from the CPT stage onward, not a post-hoc add-on.
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
## Highlights
|
| 58 |
+
|
| 59 |
+
- **Seven Unified Domains.** A single model covers MCP (tool calling), Search, Terminal, SWE (software engineering), Android, Web, and OS — spanning both text and GUI interaction environments.
|
| 60 |
+
- **Native World Model.** Environment modeling from CPT onward, not post-hoc adaptation on a general-purpose LLM.
|
| 61 |
+
- **Generalizable, Scalable & Controllable Simulator.** Zero-shot generalization to OOD environments (e.g., OpenClaw); controllable perturbations and fictional-world construction surpass real-environment training.
|
| 62 |
+
- **Agent Foundation Model.** LWM RL warm-up on single-turn, non-agentic trajectories transfers to multi-turn, tool-calling agentic tasks across 7 benchmarks, including 3 entirely out-of-domain.
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
## Model Overview
|
| 66 |
+
|
| 67 |
+
- Type: Causal Language Model (Language World Model)
|
| 68 |
+
- Base Model: [Qwen3.5-35B-A3B-Base](https://huggingface.co/Qwen/Qwen3.5-35B-A3B-Base)
|
| 69 |
+
- Training Stage: Continual Pre-Training (CPT) → Supervised Fine-Tuning (SFT) → Reinforcement Learning (RL, GSPO)
|
| 70 |
+
- Number of Parameters: 35B in total and 3B activated
|
| 71 |
+
- Hidden Dimension: 2048
|
| 72 |
+
- Token Embedding: 248320 (Padded)
|
| 73 |
+
- Number of Layers: 40
|
| 74 |
+
- Hidden Layout: 10 × (3 × (Gated DeltaNet → MoE) → 1 × (Gated Attention → MoE))
|
| 75 |
+
- Gated DeltaNet:
|
| 76 |
+
- Number of Linear Attention Heads: 32 for V and 16 for QK
|
| 77 |
+
- Head Dimension: 128
|
| 78 |
+
- Gated Attention:
|
| 79 |
+
- Number of Attention Heads: 16 for Q and 2 for KV
|
| 80 |
+
- Head Dimension: 256
|
| 81 |
+
- Rotary Position Embedding Dimension: 64
|
| 82 |
+
- Mixture Of Experts
|
| 83 |
+
- Number of Experts: 256
|
| 84 |
+
- Number of Activated Experts: 8 Routed + 1 Shared
|
| 85 |
+
- Expert Intermediate Dimension: 512
|
| 86 |
+
- Context Length: 262,144 tokens
|
| 87 |
+
- Disclaimer: No outputs from external API services are included in the training pipeline.
|
| 88 |
+
|
| 89 |
+
## Performance
|
| 90 |
+
|
| 91 |
+
### AgentWorldBench (Open-Ended Evaluation)
|
| 92 |
+
|
| 93 |
+
Five-dimensional rubric mean per domain, normalized to 0-100 scale.
|
| 94 |
+
|
| 95 |
+
| Model | MCP | Search | Term. | SWE | Android | Web | OS | **Overall** |
|
| 96 |
+
|:------|:---:|:------:|:-----:|:---:|:-------:|:---:|:--:|:-----------:|
|
| 97 |
+
| GPT-5.4 | **70.10** | 37.26 | 53.69 | 66.29 | 60.00 | 51.80 | 68.58 | 58.25 |
|
| 98 |
+
| Claude Opus 4.8 | 54.93 | 35.14 | **59.18** | 64.10 | 61.50 | **54.66** | 66.62 | 56.59 |
|
| 99 |
+
| Claude Opus 4.6 | 69.90 | 29.30 | 57.51 | 64.55 | **61.74** | 51.42 | **70.20** | 57.80 |
|
| 100 |
+
| Gemini 3.1 Pro | 59.07 | 30.21 | 52.47 | 59.07 | 61.40 | 52.83 | 66.92 | 54.57 |
|
| 101 |
+
| Claude Sonnet 4.6 | 70.00 | 28.79 | 56.98 | 64.52 | 58.03 | 50.78 | 63.17 | 56.04 |
|
| 102 |
+
| DeepSeek-V4-Pro | 63.27 | 27.61 | 51.26 | 59.44 | 55.17 | 50.32 | 63.70 | 52.97 |
|
| 103 |
+
| GLM-5.1 | 67.60 | 22.46 | 47.32 | 52.07 | 59.10 | 51.50 | 59.13 | 51.31 |
|
| 104 |
+
| Kimi K2.6 | 65.23 | 27.48 | 52.54 | 58.77 | 58.93 | 50.20 | 60.80 | 53.42 |
|
| 105 |
+
| MiniMax-M2.7 | 55.82 | 27.30 | 41.62 | 37.44 | 52.40 | 50.52 | 57.73 | 46.12 |
|
| 106 |
+
| Qwen3.5-35B-A3B | 57.87 | 25.98 | 46.13 | 47.58 | 53.18 | 47.10 | 56.27 | 47.73 |
|
| 107 |
+
| Qwen3.5-397B-A17B | 68.31 | 30.81 | 55.30 | 64.44 | 54.90 | 48.55 | 60.85 | 54.74 |
|
| 108 |
+
| Qwen3.6-Plus | 55.28 | 21.94 | 50.58 | 59.08 | 57.65 | 50.78 | 60.33 | 50.81 |
|
| 109 |
+
| **Qwen-AgentWorld-35B-A3B** | 64.79 | 36.69 | 53.96 | 65.63 | 58.17 | 49.55 | 65.92 | 56.39 |
|
| 110 |
+
| **Qwen-AgentWorld-397B-A17B** | 68.24 | **37.82** | 57.73 | **68.49** | 60.20 | 50.98 | 67.89 | **58.71** |
|
| 111 |
+
|
| 112 |
+
## Quickstart
|
| 113 |
+
|
| 114 |
+
### Deployment
|
| 115 |
+
|
| 116 |
+
Qwen-AgentWorld-35B-A3B can be served via APIs with popular inference frameworks. In the following, we show example commands to launch OpenAI-compatible API servers.
|
| 117 |
+
|
| 118 |
+
> [!Important]
|
| 119 |
+
> The model has a default context length of 262,144 tokens.
|
| 120 |
+
> If you encounter out-of-memory (OOM) errors, consider reducing the context window.
|
| 121 |
+
> However, because Qwen-AgentWorld leverages extended context for multi-turn environment simulation, we advise maintaining a context length of at least 128K tokens.
|
| 122 |
+
|
| 123 |
+
#### SGLang
|
| 124 |
+
|
| 125 |
+
[SGLang](https://github.com/sgl-project/sglang) is a fast serving framework for large language models.
|
| 126 |
+
|
| 127 |
+
```bash
|
| 128 |
+
python -m sglang.launch_server \
|
| 129 |
+
--model-path Qwen/Qwen-AgentWorld-35B-A3B \
|
| 130 |
+
--port 8000 \
|
| 131 |
+
--tp-size 4 \
|
| 132 |
+
--context-length 262144 \
|
| 133 |
+
--reasoning-parser qwen3
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
An OpenAI-compatible API will be available at `http://localhost:8000/v1`.
|
| 137 |
+
|
| 138 |
+
#### vLLM
|
| 139 |
+
|
| 140 |
+
[vLLM](https://github.com/vllm-project/vllm) is a high-throughput and memory-efficient inference engine for LLMs.
|
| 141 |
+
|
| 142 |
+
```bash
|
| 143 |
+
vllm serve Qwen/Qwen-AgentWorld-35B-A3B \
|
| 144 |
+
--port 8000 \
|
| 145 |
+
--tensor-parallel-size 4 \
|
| 146 |
+
--max-model-len 262144 \
|
| 147 |
+
--reasoning-parser qwen3 \
|
| 148 |
+
--trust-remote-code
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
An OpenAI-compatible API will be available at `http://localhost:8000/v1`.
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
### Inference with Transformers
|
| 155 |
+
|
| 156 |
+
```python
|
| 157 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 158 |
+
|
| 159 |
+
model_name = "Qwen/Qwen-AgentWorld-35B-A3B"
|
| 160 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 161 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 162 |
+
model_name,
|
| 163 |
+
torch_dtype="auto",
|
| 164 |
+
device_map="auto",
|
| 165 |
+
)
|
| 166 |
+
|
| 167 |
+
messages = [
|
| 168 |
+
{
|
| 169 |
+
"role": "system",
|
| 170 |
+
"content": "You are a language world model simulating a Linux terminal environment. "
|
| 171 |
+
"Given the user's command, predict the terminal output."
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"role": "user",
|
| 175 |
+
"content": "Action: execute_bash\nCommand: ls -la /home/user/project/"
|
| 176 |
+
}
|
| 177 |
+
]
|
| 178 |
+
|
| 179 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 180 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 181 |
+
outputs = model.generate(**inputs, max_new_tokens=2048, temperature=0.6)
|
| 182 |
+
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
|
| 183 |
+
print(response)
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
### Using via the Chat Completions API
|
| 187 |
+
|
| 188 |
+
```python
|
| 189 |
+
from openai import OpenAI
|
| 190 |
+
|
| 191 |
+
client = OpenAI(
|
| 192 |
+
base_url="http://localhost:8000/v1",
|
| 193 |
+
api_key="EMPTY",
|
| 194 |
+
)
|
| 195 |
+
|
| 196 |
+
# Terminal domain example
|
| 197 |
+
messages = [
|
| 198 |
+
{
|
| 199 |
+
"role": "system",
|
| 200 |
+
"content": "You are a language world model simulating a Linux terminal environment. "
|
| 201 |
+
"Given the user's command, predict the terminal output."
|
| 202 |
+
},
|
| 203 |
+
{
|
| 204 |
+
"role": "user",
|
| 205 |
+
"content": "Action: execute_bash\nCommand: ls -la /home/user/project/"
|
| 206 |
+
}
|
| 207 |
+
]
|
| 208 |
+
|
| 209 |
+
response = client.chat.completions.create(
|
| 210 |
+
model="Qwen/Qwen-AgentWorld-35B-A3B",
|
| 211 |
+
messages=messages,
|
| 212 |
+
max_tokens=32768,
|
| 213 |
+
temperature=0.6,
|
| 214 |
+
)
|
| 215 |
+
print(response.choices[0].message.content)
|
| 216 |
+
```
|
| 217 |
+
|
| 218 |
+
> [!Note]
|
| 219 |
+
> We provide **domain-specific world model system prompt templates** in [`prompts/`](https://github.com/QwenLM/Qwen-AgentWorld/tree/master/prompts) of the GitHub repository for all 7 domains. These serve as general-purpose system prompts when using Qwen-AgentWorld as an environment simulator. Each domain folder contains a `system_prompt.txt` (world model system prompt) and a `judge_system_prompt.txt` (evaluation prompt).
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
## Evaluate on AgentWorldBench
|
| 223 |
+
|
| 224 |
+
AgentWorldBench evaluates language world models by scoring each predicted environment observation on 5 dimensions: **Format**, **Factuality**, **Consistency**, **Realism**, and **Quality**.
|
| 225 |
+
|
| 226 |
+
### Setup
|
| 227 |
+
|
| 228 |
+
```bash
|
| 229 |
+
# Clone the evaluation repository
|
| 230 |
+
git clone https://github.com/QwenLM/Qwen-AgentWorld.git
|
| 231 |
+
cd Qwen-AgentWorld
|
| 232 |
+
|
| 233 |
+
# Download the benchmark
|
| 234 |
+
huggingface-cli download Qwen/AgentWorldBench --repo-type dataset --local-dir ./AgentWorldBench
|
| 235 |
+
|
| 236 |
+
# Install dependencies
|
| 237 |
+
pip install openai
|
| 238 |
+
```
|
| 239 |
+
|
| 240 |
+
### Run Evaluation
|
| 241 |
+
|
| 242 |
+
The evaluation follows a three-step pipeline:
|
| 243 |
+
|
| 244 |
+
```bash
|
| 245 |
+
cd eval
|
| 246 |
+
|
| 247 |
+
# Step 1: Run world model inference
|
| 248 |
+
python eval.py infer \
|
| 249 |
+
--data-dir ../AgentWorldBench \
|
| 250 |
+
--model-base-url http://localhost:8000/v1 \
|
| 251 |
+
--model-name Qwen/Qwen-AgentWorld-35B-A3B \
|
| 252 |
+
--output-dir ./results
|
| 253 |
+
|
| 254 |
+
# Step 2: Run LLM judge scoring
|
| 255 |
+
export OPENAI_API_KEY="your-api-key"
|
| 256 |
+
python eval.py judge \
|
| 257 |
+
--predictions ./results/predictions.jsonl \
|
| 258 |
+
--judge-base-url https://api.openai.com/v1 \
|
| 259 |
+
--judge-model gpt-5.2-2025-12-11 \
|
| 260 |
+
--output-dir ./results
|
| 261 |
+
|
| 262 |
+
# Step 3: Aggregate and display scores
|
| 263 |
+
python eval.py score --predictions ./results/judged.jsonl
|
| 264 |
+
```
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
## Best Practices
|
| 268 |
+
|
| 269 |
+
1. **Sampling Parameters**: We recommend `temperature=0.6`, `top_p=0.95`, `top_k=20` for world model inference. The model uses thinking mode by default (`<think>...</think>`) to reason about environment state transitions before producing the predicted observation.
|
| 270 |
+
|
| 271 |
+
2. **Adequate Output Length**: We recommend an output length of 32,768 tokens for most queries. For long, multi-step trajectories, you may increase the max output length to accommodate detailed environment observations.
|
| 272 |
+
|
| 273 |
+
3. **Domain-Specific System Prompts**: For optimal simulation fidelity, use the domain-specific system prompts provided in the [`prompts/`](https://github.com/QwenLM/Qwen-AgentWorld/tree/master/prompts) directory of the GitHub repository.
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
## Citation
|
| 277 |
+
|
| 278 |
+
If you find our work helpful, feel free to give us a cite.
|
| 279 |
+
|
| 280 |
+
```bibtex
|
| 281 |
+
@article{zuo2026qwen,
|
| 282 |
+
title={Qwen-agentworld: language world models for general agents},
|
| 283 |
+
author={Zuo, Yuxin and Xiao, Zikai and Sheng, Li and Huang, Fei and Tu, Jianhong and Liu, Yuxuan and Tang, Tianyi and Hu, Xiaomeng and Su, Yang and Lan, Qingfeng and others},
|
| 284 |
+
journal={arXiv preprint arXiv:2606.24597},
|
| 285 |
+
year={2026}
|
| 286 |
+
}
|
| 287 |
+
```
|