Instructions to use redai-infra/hybrid-routing-context-rl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use redai-infra/hybrid-routing-context-rl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="redai-infra/hybrid-routing-context-rl") 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("redai-infra/hybrid-routing-context-rl") model = AutoModelForMultimodalLM.from_pretrained("redai-infra/hybrid-routing-context-rl", 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 redai-infra/hybrid-routing-context-rl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "redai-infra/hybrid-routing-context-rl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "redai-infra/hybrid-routing-context-rl", "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/redai-infra/hybrid-routing-context-rl
- SGLang
How to use redai-infra/hybrid-routing-context-rl 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 "redai-infra/hybrid-routing-context-rl" \ --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": "redai-infra/hybrid-routing-context-rl", "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 "redai-infra/hybrid-routing-context-rl" \ --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": "redai-infra/hybrid-routing-context-rl", "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 redai-infra/hybrid-routing-context-rl with Docker Model Runner:
docker model run hf.co/redai-infra/hybrid-routing-context-rl
hybrid-routing-context-rl
The context-compression RL checkpoint (step 40) from the paper Screenshots or Tools? Eliciting Tool Us Context in Hybrid GUI–MCP Computer-UseAgents (arXiv:2608.03327).
A Qwen3-VL-8B-Thinking policy trained with multi-turn GRPO on OSWorld under a train/inference-consistent compressed observation rule: 2-image slip_success` (the screenshot after asuccessful MCP tool call is replaced by a text placeholder). Training and evaluation share the exact same observation policy — that matching is the
Results (OSWorld-MCP test_all_no_internet, 309 tasks, greedy ×3)
| accuracy | input cost | peak context (p95) | |
|---|---|---|---|
| Base operating point (img4, uncompressed) | 33.0% | 100% | 11.5K tok |
| This checkpoint (img2 + skip, compressed) | 37.8% | 53% | −37% |
Usage
This is a complete, directly-loadable Qwen3-VL-8B model directory. Deploy it with the compressed observation rule it was trained under — evaluating with the default rich observation underestimates it:
huggingface-cli download redai-infra/hybrid-routing-context-rl --local-dir ckpts/context_rl
MODEL=ckpts/context_rl CONTEXT_POLICY=skip_on_mcp_success MAX_IMAGE_HISTORY_LENGTH=2 \
bash scripts/run_mcp_eval.sh
Code, configs, and full provenance: https://github.com/redai-infra/hybrid-routing-agent — see results/context_rl/PROVENANCE.md for how every number above is derived, and configs/experiments/context_rl.yaml for the exact training recipe.
Citation
@article{fan2026screenshots,
title = {Screenshots or Tools? Eliciting Tool Use and Managing Multimodal
Context in Hybrid GUI-MCP Computer-Use Agents},
author = {Fan, Siqi and Li, Minghao and Ma, Xiaoqian and Tan, Wenhui and
Huang, Xiusheng and Wu, Juntong and Zhang, Liujie and Shang, Shuo
and Chen, Weihang},
journal = {arXiv preprint arXiv:2608.03327},
year = {2026},
url = {https://arxiv.org/abs/2608.03327}
}
- Downloads last month
- 36
Model tree for redai-infra/hybrid-routing-context-rl
Base model
Qwen/Qwen3-VL-8B-Thinking