Instructions to use kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct") model = AutoModelForCausalLM.from_pretrained("kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct
- SGLang
How to use kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct 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 "kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct" \ --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": "kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct", "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 "kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct" \ --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": "kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct with Docker Model Runner:
docker model run hf.co/kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct
PhantomEnvs-Qwen2.5-7B-Instruct
Qwen2.5-7B-Instruct trained as a multi-turn search agent in Hops, a fictional world from PhantomEnvironments: Training LLM Agents in Fictional Worlds. It never sees real-world data during training, yet it does much better than its base model on real-world multi-hop QA.
- Training: GRPO with SkyRL for 220 steps (seed 1) in the Hops
training environment (
pw-train.zipin kilian-group/phantom-envs): a universe of 1,000 fictional people and 56,250 questions, rewarded by answer F1. The agent searches the universe's articles with an e5-base-v2 retriever, for up to 10 turns. - Format: the model searches by writing
<search>query</search>, reads the results in<information>...</information>, and ends with<answer>...</answer>. It expects the prompt of phantom-envs, whose evaluation runs it against a retriever over a benchmark's corpus:
scripts/skyrl/launch_skyrl.sh eval qwen3-4b data/hp500 \
trainer.policy.model.path=kilian-group/PhantomEnvs-Qwen2.5-7B-Instruct \
--out_dir=out__eval=hp500
Results
F1 (%) on six multi-hop QA benchmarks (500 questions each, 824 for FRAMES), with the Qwen3-Embedding-4B retriever and up to 20 search turns; this model's scores are the mean of three eval runs:
| Model | HotpotQA | 2Wiki | MuSiQue | Synth-RM | Synth-SM | FRAMES | Avg. |
|---|---|---|---|---|---|---|---|
| Qwen2.5-7B-Instruct | 44.2 | 29.1 | 24.5 | 23.6 | 15.6 | 16.2 | 25.5 |
| PhantomEnvs-Qwen2.5-7B-Instruct | 65.8 | 64.4 | 46.9 | 41.1 | 42.3 | 33.9 | 49.1 |
The paper evaluates the fp32 checkpoint locally; this repo holds a bf16 copy to save disk space, and the numbers above are this copy's. The difference in F1 is minimal.
License
CC BY 4.0. The base model, Qwen2.5-7B-Instruct, is under Apache 2.0.
Citation
@article{kabra2026phantomenvironments,
title={PhantomEnvironments: Training LLM Agents in Fictional Worlds},
author={Kabra, Anmol and Selvam, Swathi Saravana and Gong, Albert and Wan, Chao and Belardi, Christian and Go, Dongyoung and Luo, Katie Z and Weinberger, Kilian Q},
journal={arXiv preprint arXiv:2609.40221},
year={2026}
}
- Downloads last month
- 11