Image-Text-to-Text
Transformers
Safetensors
qwen3_5
agents
tool-use
reinforcement-learning
terminal-agent
conversational
Instructions to use twothsnd/ReTerm-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use twothsnd/ReTerm-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="twothsnd/ReTerm-9B") 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("twothsnd/ReTerm-9B") model = AutoModelForMultimodalLM.from_pretrained("twothsnd/ReTerm-9B", 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 twothsnd/ReTerm-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "twothsnd/ReTerm-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "twothsnd/ReTerm-9B", "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/twothsnd/ReTerm-9B
- SGLang
How to use twothsnd/ReTerm-9B 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 "twothsnd/ReTerm-9B" \ --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": "twothsnd/ReTerm-9B", "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 "twothsnd/ReTerm-9B" \ --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": "twothsnd/ReTerm-9B", "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 twothsnd/ReTerm-9B with Docker Model Runner:
docker model run hf.co/twothsnd/ReTerm-9B
Clarify ReTerm training approach
Browse files11 unmodified lines1213141516171811 unmodified lines# ReTerm-9BReTerm-9B is a terminal agent trained to complete tasks that require interacting with a command-line environment. It starts from Qwen3.5-9B and is trained in two stages: supervised fine-tuning on ReTerm-10K, followed by ReTerm-GRPO. The latter trains on both ordinary task attempts and continuations from failure states produced during training.The model weights are provided in Hugging Face format. ReTerm was trained and evaluated with a terminal harness that supplies a bash tool, executes commands, and returns their observations. The model alone does not provide a terminal sandbox or task verifier. Use the Qwen3.5 chat template and the same tool-call protocol when building an agent around these weights.11 unmodified lines1213141516171811 unmodified lines# ReTerm-9BReTerm-9B is a terminal agent trained to recover from errors made during task execution. Its training includes supervised learning from successful continuations of failed attempts and ReTerm-GRPO, which learns from new failure states produced as the policy evolves. The released checkpoint starts from Qwen3.5-9B and uses ReTerm-10K for supervised training.The model weights are provided in Hugging Face format. ReTerm was trained and evaluated with a terminal harness that supplies a bash tool, executes commands, and returns their observations. The model alone does not provide a terminal sandbox or task verifier. Use the Qwen3.5 chat template and the same tool-call protocol when building an agent around these weights.
README.md+1-1