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
AgentMercury-Qwen3.5-4B
AgentMercury-Qwen3.5-4B is a Qwen3.5-4B (multimodal, Qwen3_5ForConditionalGeneration)
checkpoint post-trained with agentic reinforcement learning on MCP (Model-Context-Protocol)
tool-use environments. The RL objective rewards completing real multi-turn agent tasks
(correct tool calls, correct final database/environment state), not just producing text.
This checkpoint is the clean-minimum of the run: the step at which reward peaks while degenerate-generation rate and truncation rate are both exactly 0 — before later steps regress into verbosity / reward-hacking.
Highlights
- Base: Qwen3.5-4B (text + vision).
- Method: on-policy GRPO, 200-step MCP agentic RL (slime trainer + sglang rollout, 8×A100).
- Reward: final environment-state verifiers on real agent tasks (tool correctness + DB checks), with penalties for degeneration/truncation.
- Training-set diversity: ~2.3k agent environments spanning 63% of industries and 76% of tools in the source corpus.
Benchmark results (improvement over the base model)
Only benchmarks where AgentMercury improves over the Qwen3.5-4B base are listed, with the absolute gain (Δ) over base. Evaluated with an OpenAI-compatible endpoint (sglang, 32k context), N repeats per cell.
Agentic / tool-use
| Benchmark | Base | AgentMercury | Δ |
|---|---|---|---|
| BFCL | 30.35 | 31.93 | +1.58 |
| τ³-bench | 0.706 | 0.747 | +0.041 |
| τ²-bench | 0.448 | 0.457 | +0.009 |
Math & reasoning
| Benchmark | Base | AgentMercury | Δ |
|---|---|---|---|
| AIME 2026 | 0.459 | 0.553 | +0.094 |
| HMMT 2026-02 | 0.285 | 0.356 | +0.071 |
| GPQA-Diamond | 0.765 | 0.770 | +0.005 |
| Finance-Reasoning | 0.563 | 0.571 | +0.008 |
| AA-Omniscience | −52.17 | −51.67 | +0.50 |
Code
| Benchmark | Base | AgentMercury | Δ |
|---|---|---|---|
| LiveCodeBench (v5+v6) | 0.366 | 0.435 | +0.069 |
| SciCode | 0.226 | 0.260 | +0.034 |
Writing
| Benchmark | Base | AgentMercury | Δ |
|---|---|---|---|
| WritingBench | 6.232 | 6.307 | +0.075 |
Metrics use each benchmark's native scale (fractions 0–1, or the benchmark's own points). The largest, most consistent gains are on agentic tool-use (BFCL, τ-bench) and competition math / code (AIME, HMMT, LiveCodeBench).
Usage
Serving (sglang, recommended — matches evaluation)
python3 -m sglang.launch_server \
--model-path Minbyul/AgentMercury-Qwen3.5-4B \
--served-model-name agentmercury-qwen3.5-4b \
--host 0.0.0.0 --port 30000 --tp 1 \
--context-length 32768 \
--reasoning-parser qwen3 --tool-call-parser qwen3_coder \
--trust-remote-code
Then call the OpenAI-compatible endpoint at http://localhost:30000/v1 (supports tool calls).
transformers
from transformers import AutoModelForCausalLM, AutoProcessor
model = AutoModelForCausalLM.from_pretrained(
"Minbyul/AgentMercury-Qwen3.5-4B",
torch_dtype="bfloat16", device_map="auto", trust_remote_code=True,
)
processor = AutoProcessor.from_pretrained(
"Minbyul/AgentMercury-Qwen3.5-4B", trust_remote_code=True,
)
Training notes
The reward peaks around this checkpoint while the model stays clean (no repetition collapse, no context truncation). Continuing RL past this point raised response length and reintroduced degeneration/truncation without adding capability — so this clean-minimum checkpoint is released as the recommended weights.
License
Released under the Apache-2.0 license (see LICENSE).
- Downloads last month
- -