Instructions to use Rtian/MiRL-Qwen3.5-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rtian/MiRL-Qwen3.5-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rtian/MiRL-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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Rtian/MiRL-Qwen3.5-4B") model = AutoModelForMultimodalLM.from_pretrained("Rtian/MiRL-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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Rtian/MiRL-Qwen3.5-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rtian/MiRL-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": "Rtian/MiRL-Qwen3.5-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Rtian/MiRL-Qwen3.5-4B
- SGLang
How to use Rtian/MiRL-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 "Rtian/MiRL-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": "Rtian/MiRL-Qwen3.5-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Rtian/MiRL-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": "Rtian/MiRL-Qwen3.5-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Rtian/MiRL-Qwen3.5-4B with Docker Model Runner:
docker model run hf.co/Rtian/MiRL-Qwen3.5-4B
MiRL-Qwen3.5-4B
Model Checkpoint for paper "MiRL: Error-Targeted Reinforcement Learning for Correcting Terminal Agent Misbehaviors".
A terminal agent trained from Qwen/Qwen3.5-4B with reinforcement learning on 189 terminal tasks.
Terminal agents often repeat the same misbehaviors like making false claims about tests and repeating unnecessary checks.
Misbehavior-driven RL (MiRL) first profiles the errors of a policy to find these misbehaviors. It then trains the policy
with RL, starting rollouts at the steps where these misbehaviors occur and rewarding a rollout only if it passes the
tests and avoids the misbehavior.
Usage
vllm serve Rtian/MiRL-Qwen3.5-4B --language-model-only --max-model-len 262144 \
--enable-auto-tool-choice --tool-call-parser qwen3_xml
The repository holds the language model only (no vision or MTP weights), so --language-model-only is needed. The
config, tokenizer and chat template are unchanged from Qwen3.5-4B.
For more details, see https://github.com/runchu-tian/MiRL.
Citation
@misc{tian2026mirlerrortargetedreinforcementlearning,
title={MiRL: Error-Targeted Reinforcement Learning for Correcting Terminal Agent Misbehaviors},
author={Runchu Tian and Zaid Khan and Zun Wang and Justin Chih-Yao Chen and Mohit Bansal},
year={2026},
eprint={2610.35697},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2610.35697},
}
- Downloads last month
- 479