Text Generation
Transformers
Safetensors
English
qwen2
search-agent
tool-use
function-calling
deep-search
qwen
conversational
text-generation-inference
Instructions to use alibaba-pai/SearchQwen2.5-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alibaba-pai/SearchQwen2.5-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alibaba-pai/SearchQwen2.5-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alibaba-pai/SearchQwen2.5-7B") model = AutoModelForCausalLM.from_pretrained("alibaba-pai/SearchQwen2.5-7B", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use alibaba-pai/SearchQwen2.5-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alibaba-pai/SearchQwen2.5-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alibaba-pai/SearchQwen2.5-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/alibaba-pai/SearchQwen2.5-7B
- SGLang
How to use alibaba-pai/SearchQwen2.5-7B 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 "alibaba-pai/SearchQwen2.5-7B" \ --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": "alibaba-pai/SearchQwen2.5-7B", "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 "alibaba-pai/SearchQwen2.5-7B" \ --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": "alibaba-pai/SearchQwen2.5-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use alibaba-pai/SearchQwen2.5-7B with Docker Model Runner:
docker model run hf.co/alibaba-pai/SearchQwen2.5-7B
Simplify model card and reference EasyDistill 2.0
Browse files
README.md
CHANGED
|
@@ -11,64 +11,38 @@ tags:
|
|
| 11 |
- search-agent
|
| 12 |
- tool-use
|
| 13 |
- function-calling
|
| 14 |
-
- react
|
| 15 |
- deep-search
|
| 16 |
-
- multi-hop-qa
|
| 17 |
- qwen
|
| 18 |
---
|
| 19 |
|
| 20 |
# SearchQwen2.5-7B
|
| 21 |
|
| 22 |
-
**SearchQwen2.5-7B** is a compact Search Agent model from the Alibaba Cloud PAI team. It is
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
## Model details
|
| 29 |
|
| 30 |
| Item | Value |
|
| 31 |
|---|---|
|
| 32 |
| Base model | [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) |
|
| 33 |
| Parameters | 7.62B |
|
| 34 |
-
|
|
| 35 |
-
|
|
| 36 |
-
|
|
| 37 |
-
| Training | Environment-aligned trajectories, Solver-in-the-Loop verification, and process-aware post-training |
|
| 38 |
-
| Companion dataset | [alibaba-pai/SynSearch-Data](https://huggingface.co/datasets/alibaba-pai/SynSearch-Data) |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
## Evaluation
|
| 43 |
-
|
| 44 |
-
We report LLM-judge accuracy (%) over two benchmark groups:
|
| 45 |
-
|
| 46 |
-
- **Multi-hop QA:** 2WikiMultiHopQA, Bamboogle, HotpotQA, MuSiQue.
|
| 47 |
-
- **Deep Search:** GAIA, WebWalkerQA, xbench-deepsearch, BrowseComp-ZH.
|
| 48 |
|
| 49 |
-
##
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|---|---:|---:|---:|
|
| 53 |
-
| Qwen2.5-7B-Instruct | 45.28 | 18.65 | 31.96 |
|
| 54 |
-
| **SearchQwen2.5-7B** | **52.95** | **26.23** | **39.59** |
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|---|---:|---:|---:|
|
| 60 |
-
| Qwen2.5-7B-Instruct | 45.23 | 24.35 | 33.33 |
|
| 61 |
-
| **SearchQwen2.5-7B** | **55.90** | **33.33** | **44.61** |
|
| 62 |
-
|
| 63 |
-
Deep Search gains are consistently larger than the gains on conventional multi-hop QA, indicating improved search, browsing, and evidence-integration behavior rather than answer memorization alone.
|
| 64 |
-
|
| 65 |
-
## Requirements
|
| 66 |
-
|
| 67 |
-
```bash
|
| 68 |
-
pip install -U transformers accelerate torch
|
| 69 |
-
```
|
| 70 |
-
|
| 71 |
-
## Transformers quickstart
|
| 72 |
|
| 73 |
```python
|
| 74 |
import torch
|
|
@@ -82,36 +56,23 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 82 |
device_map="auto",
|
| 83 |
).eval()
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
tools = [
|
| 86 |
{
|
| 87 |
"type": "function",
|
| 88 |
"function": {
|
| 89 |
"name": "search",
|
| 90 |
-
"description": "Search the web
|
| 91 |
"parameters": {
|
| 92 |
"type": "object",
|
| 93 |
"properties": {"query": {"type": "string"}},
|
| 94 |
"required": ["query"],
|
| 95 |
},
|
| 96 |
},
|
| 97 |
-
}
|
| 98 |
-
{
|
| 99 |
-
"type": "function",
|
| 100 |
-
"function": {
|
| 101 |
-
"name": "browse",
|
| 102 |
-
"description": "Read the content of a web page.",
|
| 103 |
-
"parameters": {
|
| 104 |
-
"type": "object",
|
| 105 |
-
"properties": {"url": {"type": "string"}},
|
| 106 |
-
"required": ["url"],
|
| 107 |
-
},
|
| 108 |
-
},
|
| 109 |
-
},
|
| 110 |
-
]
|
| 111 |
-
|
| 112 |
-
messages = [
|
| 113 |
-
{"role": "system", "content": "You are a search agent. Use tools before answering."},
|
| 114 |
-
{"role": "user", "content": "Which city is the birthplace of the author of The Old Man and the Sea?"},
|
| 115 |
]
|
| 116 |
|
| 117 |
inputs = tokenizer.apply_chat_template(
|
|
@@ -123,75 +84,18 @@ inputs = tokenizer.apply_chat_template(
|
|
| 123 |
return_dict=True,
|
| 124 |
).to(model.device)
|
| 125 |
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
new_tokens = output[0, inputs["input_ids"].shape[-1]:]
|
| 130 |
-
print(tokenizer.decode(new_tokens, skip_special_tokens=False))
|
| 131 |
-
```
|
| 132 |
-
|
| 133 |
-
A typical first response is a structured call:
|
| 134 |
-
|
| 135 |
-
```xml
|
| 136 |
-
<tool_call>
|
| 137 |
-
{"name": "search", "arguments": {"query": "..."}}
|
| 138 |
-
</tool_call>
|
| 139 |
-
```
|
| 140 |
-
|
| 141 |
-
Execute the requested tool, append the tool response to the conversation, and call the model again until it returns a final answer.
|
| 142 |
-
|
| 143 |
-
## vLLM deployment
|
| 144 |
-
|
| 145 |
-
```bash
|
| 146 |
-
vllm serve alibaba-pai/SearchQwen2.5-7B \
|
| 147 |
-
--served-model-name SearchQwen2.5-7B \
|
| 148 |
-
--enable-auto-tool-choice \
|
| 149 |
-
--tool-call-parser hermes \
|
| 150 |
-
--max-model-len 8192
|
| 151 |
```
|
| 152 |
|
| 153 |
-
|
| 154 |
|
| 155 |
-
##
|
| 156 |
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
- Research on search agents and retrieval-augmented reasoning.
|
| 162 |
-
- Search/browse tool-use experiments.
|
| 163 |
-
- Fine-tuning, evaluation, and deployment of compact agent models.
|
| 164 |
-
|
| 165 |
-
## Limitations
|
| 166 |
-
|
| 167 |
-
- The model requires an external search/browse runtime; it does not provide a search index itself.
|
| 168 |
-
- Final-answer quality depends on tool availability and retrieved evidence quality.
|
| 169 |
-
- Tool schemas and prompt templates should remain compatible with the released chat template.
|
| 170 |
-
- LLM-judge scores may vary with evaluator model, decoding settings, and search backend.
|
| 171 |
-
- Do not use the model as the sole authority for safety-critical, legal, medical, or financial decisions.
|
| 172 |
-
|
| 173 |
-
## Artifact integrity
|
| 174 |
-
|
| 175 |
-
`SHA256SUMS` contains checksums for all weight shards, the weight index, configuration, and tokenizer.
|
| 176 |
-
|
| 177 |
-
## Related releases
|
| 178 |
-
|
| 179 |
-
- [SearchQwen2.5-7B](https://huggingface.co/alibaba-pai/SearchQwen2.5-7B)
|
| 180 |
-
- [SearchQwen2.5-3B](https://huggingface.co/alibaba-pai/SearchQwen2.5-3B)
|
| 181 |
-
- [SearchQwen3-8B](https://huggingface.co/alibaba-pai/SearchQwen3-8B)
|
| 182 |
-
- [SynSearch-Data](https://huggingface.co/datasets/alibaba-pai/SynSearch-Data)
|
| 183 |
-
|
| 184 |
-
## Citation
|
| 185 |
-
|
| 186 |
-
```bibtex
|
| 187 |
-
@misc{searchqwen2026,
|
| 188 |
-
title = {Fake It Till You Make It: Training Deep Search Agents on Synthetic Reality},
|
| 189 |
-
author = {Alibaba Cloud PAI Team},
|
| 190 |
-
year = {2026},
|
| 191 |
-
note = {SearchQwen model family and SynSearch-Data}
|
| 192 |
-
}
|
| 193 |
-
```
|
| 194 |
|
| 195 |
## License
|
| 196 |
|
| 197 |
-
This
|
|
|
|
| 11 |
- search-agent
|
| 12 |
- tool-use
|
| 13 |
- function-calling
|
|
|
|
| 14 |
- deep-search
|
|
|
|
| 15 |
- qwen
|
| 16 |
---
|
| 17 |
|
| 18 |
# SearchQwen2.5-7B
|
| 19 |
|
| 20 |
+
**SearchQwen2.5-7B** is a compact Search Agent model from the Alibaba Cloud PAI team. It is trained with environment-aligned, solver-verified search trajectories generated by [EasyDistill 2.0](https://github.com/modelscope/easydistill/tree/v2.0.0), and is designed for multi-hop search, browsing, and evidence integration.
|
| 21 |
|
| 22 |
+
> SearchQwen2.5-7B 是基于 EasyDistill 2.0 环境对齐轨迹蒸馏链路训练的 Search Agent 小模型,支持结构化 `search` / `browse` 工具调用。
|
| 23 |
|
| 24 |
+
## Model overview
|
|
|
|
|
|
|
| 25 |
|
| 26 |
| Item | Value |
|
| 27 |
|---|---|
|
| 28 |
| Base model | [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) |
|
| 29 |
| Parameters | 7.62B |
|
| 30 |
+
| Context length | 32,768 |
|
| 31 |
+
| Recommended interface | Structured Tool-Call |
|
| 32 |
+
| Training data | [SynSearch-Data](https://huggingface.co/datasets/alibaba-pai/SynSearch-Data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
## Results
|
| 35 |
|
| 36 |
+
LLM-judge accuracy (%). Multi-hop QA averages 2WikiMultiHopQA, Bamboogle, HotpotQA, and MuSiQue; Deep Search averages GAIA, WebWalkerQA, xbench-deepsearch, and BrowseComp-ZH.
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
| Interaction | Model | Multi-hop QA | Deep Search | Overall |
|
| 39 |
+
|---|---|---:|---:|---:|
|
| 40 |
+
| Search-R1 style | Qwen2.5-7B-Instruct | 45.28 | 18.65 | 31.96 |
|
| 41 |
+
| Search-R1 style | **SearchQwen2.5-7B** | **52.95** | **26.23** | **39.59** |
|
| 42 |
+
| Tool-Call | Qwen2.5-7B-Instruct | 45.23 | 24.35 | 33.33 |
|
| 43 |
+
| Tool-Call | **SearchQwen2.5-7B** | **55.90** | **33.33** | **44.61** |
|
| 44 |
|
| 45 |
+
## Quickstart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
```python
|
| 48 |
import torch
|
|
|
|
| 56 |
device_map="auto",
|
| 57 |
).eval()
|
| 58 |
|
| 59 |
+
messages = [
|
| 60 |
+
{"role": "system", "content": "You are a search agent. Use tools before answering."},
|
| 61 |
+
{"role": "user", "content": "Which city is the birthplace of the author of The Old Man and the Sea?"},
|
| 62 |
+
]
|
| 63 |
tools = [
|
| 64 |
{
|
| 65 |
"type": "function",
|
| 66 |
"function": {
|
| 67 |
"name": "search",
|
| 68 |
+
"description": "Search the web.",
|
| 69 |
"parameters": {
|
| 70 |
"type": "object",
|
| 71 |
"properties": {"query": {"type": "string"}},
|
| 72 |
"required": ["query"],
|
| 73 |
},
|
| 74 |
},
|
| 75 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
]
|
| 77 |
|
| 78 |
inputs = tokenizer.apply_chat_template(
|
|
|
|
| 84 |
return_dict=True,
|
| 85 |
).to(model.device)
|
| 86 |
|
| 87 |
+
output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
|
| 88 |
+
print(tokenizer.decode(output[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=False))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
```
|
| 90 |
|
| 91 |
+
The model returns a structured `<tool_call>`; execute the tool, append its response, and continue until a final answer is produced. An external search/browse backend is required.
|
| 92 |
|
| 93 |
+
## Related resources
|
| 94 |
|
| 95 |
+
- Framework: [EasyDistill 2.0](https://github.com/modelscope/easydistill/tree/v2.0.0)
|
| 96 |
+
- Data: [SynSearch-Data](https://huggingface.co/datasets/alibaba-pai/SynSearch-Data)
|
| 97 |
+
- Paper: [EasyDistill: A Comprehensive Toolkit for Effective Knowledge Distillation of Large Language Models](https://aclanthology.org/2025.emnlp-demos.60/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
## License
|
| 100 |
|
| 101 |
+
This model follows the license included in this repository and the terms of its base model. Checksums are provided in `SHA256SUMS`.
|