Qwen-AgentWorld
Qwen-AgentWorld is a native language world model that simulates agentic environments across seven domains (MCP, Search, Terminal, SWE, Android, Web, OS) via long chain-of-thought reasoning. It solves the problem of training agents in real environments by providing a controllable, generalizable simulator. It is for developers building and evaluating AI agents.
✨ Key features
- Covers seven unified agent interaction domains in one model.
- Native world model trained from CPT stage onward.
- Zero-shot generalization to out-of-distribution environments.
- Controllable perturbations and fictional-world construction.
- Serves as agent foundation model for multi-turn tool-calling tasks.
- Open-source weights and benchmark under Apache 2.0.
🎯 Use cases
- Simulating terminal environments for command prediction.
- Training agents via reinforcement learning in simulated environments.
- Evaluating world models on AgentWorldBench.
- Generating synthetic trajectories for agent training.
- Testing agent robustness with controlled perturbations.
📦 Installation
🧰 Requirements: Requires Python, PyTorch, and access to Hugging Face or ModelScope for model weights; for evaluation, an OpenAI-compatible API and an LLM judge API key.
huggingface-cli download Qwen/AgentWorldBench --repo-type dataset --local-dir ./AgentWorldBenchpip install openai🚀 Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/Qwen-AgentWorld-35B-A3B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
)
messages = [
{
"role": "system",
"content": "You are a language world model simulating a Linux terminal environment. Given the user's command, predict the terminal output."
},
{
"role": "user",
"content": "Action: execute_bash\nCommand: ls -la /home/user/project/"
}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=2048, temperature=0.6)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
print(response)
⚠️ Good to know
The model is a language world model and may not perfectly simulate all environments; the 35B model has lower performance than the 397B variant.
❓ FAQ
What inference frameworks are supported?
SGLang and vLLM are demonstrated, and Transformers is also supported.
How do I download the model?
Use the model ID 'Qwen/Qwen-AgentWorld-35B-A3B' on Hugging Face, or set environment variables like SGLANG_USE_MODELSCOPE=true for ModelScope.
What is the license?
All open-weight models and AgentWorldBench are licensed under Apache 2.0.
How do I evaluate on AgentWorldBench?
Use the provided eval.py script with steps: infer, judge, and score, as described in the README.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.