Instructions to use McGill-NLP/A3-Qwen3.5-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use McGill-NLP/A3-Qwen3.5-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="McGill-NLP/A3-Qwen3.5-4B") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("McGill-NLP/A3-Qwen3.5-4B") model = AutoModelForMultimodalLM.from_pretrained("McGill-NLP/A3-Qwen3.5-4B", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use McGill-NLP/A3-Qwen3.5-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "McGill-NLP/A3-Qwen3.5-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "McGill-NLP/A3-Qwen3.5-4B", "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/McGill-NLP/A3-Qwen3.5-4B
- SGLang
How to use McGill-NLP/A3-Qwen3.5-4B 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 "McGill-NLP/A3-Qwen3.5-4B" \ --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": "McGill-NLP/A3-Qwen3.5-4B", "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 "McGill-NLP/A3-Qwen3.5-4B" \ --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": "McGill-NLP/A3-Qwen3.5-4B", "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 McGill-NLP/A3-Qwen3.5-4B with Docker Model Runner:
docker model run hf.co/McGill-NLP/A3-Qwen3.5-4B
Update metadata and improve model card (#1)
Browse files- Update metadata and improve model card (d989d2409f6ceed2061bbac73023f367ca6e0c6a)
Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>
README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
|
|
|
|
|
|
| 4 |
tags:
|
| 5 |
- agents
|
| 6 |
- web
|
| 7 |
- sft
|
| 8 |
- qwen
|
| 9 |
-
base_model: Qwen/Qwen3.5-4B
|
| 10 |
-
pipeline_tag: text-generation
|
| 11 |
---
|
| 12 |
|
| 13 |
<div align="center">
|
|
@@ -20,8 +21,41 @@ pipeline_tag: text-generation
|
|
| 20 |
|
| 21 |
[**Structured Distillation of Web Agent Capabilities Enables Generalization**](https://arxiv.org/abs/2604.07776)
|
| 22 |
|
| 23 |
-
*Xing Han Lù, Siva Reddy*
|
| 24 |
|
| 25 |
</div>
|
| 26 |
|
| 27 |
-
A3-Qwen3.5-4B is a 4B web agent fine-tuned from [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) on [A3-Synth](https://huggingface.co/datasets/McGill-NLP/A3-Synth).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: Qwen/Qwen3.5-4B
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
library_name: transformers
|
| 7 |
tags:
|
| 8 |
- agents
|
| 9 |
- web
|
| 10 |
- sft
|
| 11 |
- qwen
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
<div align="center">
|
|
|
|
| 21 |
|
| 22 |
[**Structured Distillation of Web Agent Capabilities Enables Generalization**](https://arxiv.org/abs/2604.07776)
|
| 23 |
|
| 24 |
+
*[Xing Han Lù](https://huggingface.co/xhluca), [Siva Reddy](https://huggingface.co/sivareddyg)*
|
| 25 |
|
| 26 |
</div>
|
| 27 |
|
| 28 |
+
A3-Qwen3.5-4B is a 4B web agent fine-tuned from [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) on [A3-Synth](https://huggingface.co/datasets/McGill-NLP/A3-Synth).
|
| 29 |
+
|
| 30 |
+
This model was developed using the **Agent-as-Annotators (A3)** framework, which structures synthetic trajectory generation for web agents by analogy to human annotation roles, replacing the Task Designer, Annotator, and Supervisor with modular LLM components. See [A3-Qwen3.5-9B](https://huggingface.co/collections/McGill-NLP/a3-agent-as-annotators-69d854ab5b1993b10efc3fba) for full details on the framework performance and methodology.
|
| 31 |
+
|
| 32 |
+
## Quick Start: Evaluation
|
| 33 |
+
|
| 34 |
+
To evaluate the model using the official framework, first install the package:
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
pip install agent-as-annotators
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
Then, you can serve the model and run evaluation:
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
# 1. Serve the model (e.g. using vLLM)
|
| 44 |
+
vllm serve --model McGill-NLP/A3-Qwen3.5-4B
|
| 45 |
+
|
| 46 |
+
# 2. Run evaluation on a benchmark
|
| 47 |
+
a3-eval --benchmark webarena_test --model A3-qwen3.5-4b
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Citation
|
| 51 |
+
|
| 52 |
+
```bibtex
|
| 53 |
+
@misc{lu2026structured,
|
| 54 |
+
title={Structured Distillation of Web Agent Capabilities Enables Generalization},
|
| 55 |
+
author={Xing Han Lù and Siva Reddy},
|
| 56 |
+
year={2026},
|
| 57 |
+
eprint={2604.07776},
|
| 58 |
+
archivePrefix={arXiv},
|
| 59 |
+
primaryClass={cs.LG}
|
| 60 |
+
}
|
| 61 |
+
```
|