Image-Text-to-Text
Transformers
Safetensors
qwen3_5
agent
deep-research
reasoning
tool-use
long-context
self-improvement
conversational
Instructions to use BAAI/AREX-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BAAI/AREX-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="BAAI/AREX-2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("BAAI/AREX-2") model = AutoModelForMultimodalLM.from_pretrained("BAAI/AREX-2", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BAAI/AREX-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BAAI/AREX-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BAAI/AREX-2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/BAAI/AREX-2
- SGLang
How to use BAAI/AREX-2 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 "BAAI/AREX-2" \ --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": "BAAI/AREX-2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "BAAI/AREX-2" \ --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": "BAAI/AREX-2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use BAAI/AREX-2 with Docker Model Runner:
docker model run hf.co/BAAI/AREX-2
Add files using upload-large-folder tool
Browse files
README.md
CHANGED
|
@@ -17,7 +17,7 @@ tags:
|
|
| 17 |
<div align="center">
|
| 18 |
<img src="assets/arex-logo.png" width="40%" alt="AREX" style="display:block;margin:0 auto -2px;">
|
| 19 |
<strong>AREX-2: Advancing Self-Improving Agents through Long-Horizon Reflective Tasks</strong><br>
|
| 20 |
-
<a href="https://
|
| 21 |
<a href="https://github.com/VectorSpaceLab/AREX-2"><img src="https://img.shields.io/badge/-Homepage-24292F?style=for-the-badge&logo=github&logoColor=white" alt="Homepage"></a>
|
| 22 |
</div>
|
| 23 |
|
|
@@ -188,18 +188,11 @@ and notices for the Qwen base model and any downstream data or tools.
|
|
| 188 |
## Citation
|
| 189 |
|
| 190 |
```bibtex
|
| 191 |
-
@
|
| 192 |
-
title={AREX:
|
| 193 |
-
author={
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
and Dou, Zhicheng and He, Di and Li, Chaozhuo and Ye, Qiwei
|
| 198 |
-
and Wang, Zhongyuan and Liu, Zheng},
|
| 199 |
-
year={2026},
|
| 200 |
-
eprint={2607.21461},
|
| 201 |
-
archivePrefix={arXiv},
|
| 202 |
-
primaryClass={cs.AI},
|
| 203 |
-
url={https://arxiv.org/abs/2607.21461}
|
| 204 |
}
|
| 205 |
```
|
|
|
|
| 17 |
<div align="center">
|
| 18 |
<img src="assets/arex-logo.png" width="40%" alt="AREX" style="display:block;margin:0 auto -2px;">
|
| 19 |
<strong>AREX-2: Advancing Self-Improving Agents through Long-Horizon Reflective Tasks</strong><br>
|
| 20 |
+
<a href="https://arxiv.org/abs/2609.38288"><img src="https://img.shields.io/badge/-Paper-B31B1B?style=for-the-badge&logo=arxiv&logoColor=white" alt="Paper"></a>
|
| 21 |
<a href="https://github.com/VectorSpaceLab/AREX-2"><img src="https://img.shields.io/badge/-Homepage-24292F?style=for-the-badge&logo=github&logoColor=white" alt="Homepage"></a>
|
| 22 |
</div>
|
| 23 |
|
|
|
|
| 188 |
## Citation
|
| 189 |
|
| 190 |
```bibtex
|
| 191 |
+
@article{2026arex2,
|
| 192 |
+
title = {AREX-2: Advancing Self-Improving Agents through Long-Horizon Reflective Tasks},
|
| 193 |
+
author = {Qian, Hongjin and Li, Chaofan and Luo, Kun and Wei, Wenqing and Chen, Jianlyu and Lu, Shuqi and Hu, Yuyang and Xiao, Hongwang and Wang, Hui and Li, Chaozhuo and Ye, Qiwei and Dou, Zhicheng and Lian, Defu and Liu, Zheng},
|
| 194 |
+
journal = {arXiv preprint arXiv:2609.38288},
|
| 195 |
+
year = {2026},
|
| 196 |
+
url = {https://arxiv.org/abs/2609.38288}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
}
|
| 198 |
```
|