Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
agent
tool-use
mcp
reinforcement-learning
grpo
conversational
Instructions to use Minbyul/AgentMercury-Qwen3.5-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Minbyul/AgentMercury-Qwen3.5-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Minbyul/AgentMercury-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("Minbyul/AgentMercury-Qwen3.5-4B") model = AutoModelForMultimodalLM.from_pretrained("Minbyul/AgentMercury-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 Minbyul/AgentMercury-Qwen3.5-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Minbyul/AgentMercury-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": "Minbyul/AgentMercury-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/Minbyul/AgentMercury-Qwen3.5-4B
- SGLang
How to use Minbyul/AgentMercury-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 "Minbyul/AgentMercury-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": "Minbyul/AgentMercury-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 "Minbyul/AgentMercury-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": "Minbyul/AgentMercury-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 Minbyul/AgentMercury-Qwen3.5-4B with Docker Model Runner:
docker model run hf.co/Minbyul/AgentMercury-Qwen3.5-4B
Add AgentMercury model card (WIN-only benchmark deltas vs base)
Browse files
README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: image-text-to-text
|
| 7 |
+
tags:
|
| 8 |
+
- agent
|
| 9 |
+
- tool-use
|
| 10 |
+
- mcp
|
| 11 |
+
- reinforcement-learning
|
| 12 |
+
- grpo
|
| 13 |
+
- qwen3_5
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# AgentMercury-Qwen3.5-4B
|
| 17 |
+
|
| 18 |
+
**AgentMercury-Qwen3.5-4B** is a Qwen3.5-4B (multimodal, `Qwen3_5ForConditionalGeneration`)
|
| 19 |
+
checkpoint post-trained with **agentic reinforcement learning** on MCP (Model-Context-Protocol)
|
| 20 |
+
tool-use environments. The RL objective rewards *completing real multi-turn agent tasks*
|
| 21 |
+
(correct tool calls, correct final database/environment state), not just producing text.
|
| 22 |
+
|
| 23 |
+
This checkpoint is the **clean-minimum** of the run: the step at which reward peaks while
|
| 24 |
+
**degenerate-generation rate and truncation rate are both exactly 0** — before later steps
|
| 25 |
+
regress into verbosity / reward-hacking.
|
| 26 |
+
|
| 27 |
+
## Highlights
|
| 28 |
+
|
| 29 |
+
- **Base:** Qwen3.5-4B (text + vision).
|
| 30 |
+
- **Method:** on-policy GRPO, 200-step MCP agentic RL (slime trainer + sglang rollout, 8×A100).
|
| 31 |
+
- **Reward:** final environment-state verifiers on real agent tasks (tool correctness + DB checks),
|
| 32 |
+
with penalties for degeneration/truncation.
|
| 33 |
+
- **Training-set diversity:** ~2.3k agent environments spanning **63% of industries** and
|
| 34 |
+
**76% of tools** in the source corpus.
|
| 35 |
+
|
| 36 |
+
## Benchmark results (improvement over the base model)
|
| 37 |
+
|
| 38 |
+
Only benchmarks where AgentMercury **improves over the Qwen3.5-4B base** are listed,
|
| 39 |
+
with the absolute gain (**Δ**) over base. Evaluated with an OpenAI-compatible endpoint
|
| 40 |
+
(sglang, 32k context), N repeats per cell.
|
| 41 |
+
|
| 42 |
+
### Agentic / tool-use
|
| 43 |
+
| Benchmark | Base | AgentMercury | Δ |
|
| 44 |
+
|---|---|---|---|
|
| 45 |
+
| BFCL | 30.35 | **31.93** | **+1.58** |
|
| 46 |
+
| τ³-bench | 0.706 | **0.747** | **+0.041** |
|
| 47 |
+
| τ²-bench | 0.448 | **0.457** | **+0.009** |
|
| 48 |
+
|
| 49 |
+
### Math & reasoning
|
| 50 |
+
| Benchmark | Base | AgentMercury | Δ |
|
| 51 |
+
|---|---|---|---|
|
| 52 |
+
| AIME 2026 | 0.459 | **0.553** | **+0.094** |
|
| 53 |
+
| HMMT 2026-02 | 0.285 | **0.356** | **+0.071** |
|
| 54 |
+
| GPQA-Diamond | 0.765 | **0.770** | **+0.005** |
|
| 55 |
+
| Finance-Reasoning | 0.563 | **0.571** | **+0.008** |
|
| 56 |
+
| AA-Omniscience | −52.17 | **−51.67** | **+0.50** |
|
| 57 |
+
|
| 58 |
+
### Code
|
| 59 |
+
| Benchmark | Base | AgentMercury | Δ |
|
| 60 |
+
|---|---|---|---|
|
| 61 |
+
| LiveCodeBench (v5+v6) | 0.366 | **0.435** | **+0.069** |
|
| 62 |
+
| SciCode | 0.226 | **0.260** | **+0.034** |
|
| 63 |
+
|
| 64 |
+
### Writing
|
| 65 |
+
| Benchmark | Base | AgentMercury | Δ |
|
| 66 |
+
|---|---|---|---|
|
| 67 |
+
| WritingBench | 6.232 | **6.307** | **+0.075** |
|
| 68 |
+
|
| 69 |
+
> Metrics use each benchmark's native scale (fractions 0–1, or the benchmark's own points).
|
| 70 |
+
> The largest, most consistent gains are on **agentic tool-use (BFCL, τ-bench)** and
|
| 71 |
+
> **competition math / code (AIME, HMMT, LiveCodeBench)**.
|
| 72 |
+
|
| 73 |
+
## Usage
|
| 74 |
+
|
| 75 |
+
### Serving (sglang, recommended — matches evaluation)
|
| 76 |
+
```bash
|
| 77 |
+
python3 -m sglang.launch_server \
|
| 78 |
+
--model-path Minbyul/AgentMercury-Qwen3.5-4B \
|
| 79 |
+
--served-model-name agentmercury-qwen3.5-4b \
|
| 80 |
+
--host 0.0.0.0 --port 30000 --tp 1 \
|
| 81 |
+
--context-length 32768 \
|
| 82 |
+
--reasoning-parser qwen3 --tool-call-parser qwen3_coder \
|
| 83 |
+
--trust-remote-code
|
| 84 |
+
```
|
| 85 |
+
Then call the OpenAI-compatible endpoint at `http://localhost:30000/v1` (supports tool calls).
|
| 86 |
+
|
| 87 |
+
### transformers
|
| 88 |
+
```python
|
| 89 |
+
from transformers import AutoModelForCausalLM, AutoProcessor
|
| 90 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 91 |
+
"Minbyul/AgentMercury-Qwen3.5-4B",
|
| 92 |
+
torch_dtype="bfloat16", device_map="auto", trust_remote_code=True,
|
| 93 |
+
)
|
| 94 |
+
processor = AutoProcessor.from_pretrained(
|
| 95 |
+
"Minbyul/AgentMercury-Qwen3.5-4B", trust_remote_code=True,
|
| 96 |
+
)
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
## Training notes
|
| 100 |
+
|
| 101 |
+
The reward peaks around this checkpoint while the model stays **clean**
|
| 102 |
+
(no repetition collapse, no context truncation). Continuing RL past this point raised
|
| 103 |
+
response length and reintroduced degeneration/truncation **without adding capability** —
|
| 104 |
+
so this clean-minimum checkpoint is released as the recommended weights.
|
| 105 |
+
|
| 106 |
+
## License
|
| 107 |
+
|
| 108 |
+
Released under the **Apache-2.0** license (see `LICENSE`).
|