This model is the official
EnvFactory-8B trained from
Qwen/Qwen3-8B using SFT and RL on synthesized tool-use trajectories.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_path = "LARK-Lab/EnvFactory-8B"
5tokenizer = AutoTokenizer.from_pretrained(model_path)
6model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.bfloat16, device_map="auto")
7
8# Example tool-use conversation
9messages = [
10 {"role": "system", "content": "You are a helpful assistant with access to various tools."},
11 {"role": "user", "content": "Search for recent papers about tool-use agents on arxiv."}
12]
13
14input_ids = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt").to(model.device)
15outputs = model.generate(input_ids, max_new_tokens=1024, temperature=0.7, top_p=0.9)
16response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
17print(response)
1# Load MCP tool configuration
2import json
3
4with open("configs/mcp_server.json", "r") as f:
5 mcp_config = json.load(f)
6
7# Use with your preferred MCP client
8# See https://github.com/LARK-AI-Lab/EnvFactory for integration details
1@misc{xu2026envfactoryscalingtooluseagents,
2 title={EnvFactory: Scaling Tool-Use Agents via Executable Environments Synthesis and Robust RL},
3 author={Minrui Xu and Zilin Wang and Mengyi DENG and Zhiwei Li and Zhicheng Yang and Xiao Zhu and Yinhong Liu and Boyu Zhu and Baiyu Huang and Chao Chen and Heyuan Deng and Fei Mi and Lifeng Shang and Xingshan Zeng and Zhijiang Guo},
4 year={2026},
5 eprint={2605.18703},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2605.18703},
9}
This model is released under the Apache 2.0 License.