Instructions to use autotrust/vision-gpt-oss-120b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use autotrust/vision-gpt-oss-120b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="autotrust/vision-gpt-oss-120b", trust_remote_code=True) 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 AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("autotrust/vision-gpt-oss-120b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use autotrust/vision-gpt-oss-120b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "autotrust/vision-gpt-oss-120b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "autotrust/vision-gpt-oss-120b", "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/autotrust/vision-gpt-oss-120b
- SGLang
How to use autotrust/vision-gpt-oss-120b 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 "autotrust/vision-gpt-oss-120b" \ --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": "autotrust/vision-gpt-oss-120b", "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 "autotrust/vision-gpt-oss-120b" \ --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": "autotrust/vision-gpt-oss-120b", "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 autotrust/vision-gpt-oss-120b with Docker Model Runner:
docker model run hf.co/autotrust/vision-gpt-oss-120b
vision-gpt-oss-120B (autotrust/vision-gpt-oss-120b)
Vision-language model that grafts a vision stack onto gpt-oss-120B so the text-only gpt-oss can see.
- LLM: gpt-oss-120B
- Vision: visiont tower (1152→5376, frozen, transplanted) → trained connector (5376→8192→2880) → injected
at
<|vis_pad|>(LLaVA-style). - Vision token budget: 1120 (dense — good for charts/documents/figures).
Results (zero-shot, no MMMU in training)
| benchmark | score | notes |
|---|---|---|
| MMMU (val, 900, zero-shot) | 43.7% | full validation set, no few-shot |
| HumanEval pass@1 (subset) | 97.5% | text ability preserved (LLM frozen) |
Training data contains no MMMU (DocVQA/AI2D/ChartQA/OCR/VQAv2, teacher-distilled) —
the MMMU number is uncontaminated. Companion dataset: autotrust/vision-gpt-oss-data.
Quick start
Runnable script in the repo — example_inference.py:
python example_inference.py --image test_images/photo.jpg
Minimal code:
import torch, re
from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
repo = "autotrust/vision-gpt-oss-120b"
proc = AutoProcessor.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
repo, trust_remote_code=True, dtype=torch.bfloat16, device_map="cuda").eval()
img = Image.open("photo.jpg").convert("RGB")
if max(img.size) > 1536: # gotcha #3
img.thumbnail((1536, 1536))
batch = proc(images=img, text="Describe this image in detail.", reasoning_effort="low")
batch = {k: (v.cuda() if torch.is_tensor(v) else v) for k, v in batch.items()}
out = model.generate(**batch, max_new_tokens=512, do_sample=False) # gotcha #2
text = proc.decode(out[0], skip_special_tokens=False) # gotcha #1
ans = re.search(r"final<\|message\|>(.*?)(?=<\|return\||<\|end\||$)", text, re.DOTALL)
print(ans.group(1).strip() if ans else text)
proc(...) also accepts messages=[{"role":"user","content":"..."}] and
reasoning_effort="low"|"medium"|"high" (gpt-oss harmony format).
Bundled test images (test_images/)
python example_inference.py --image test_images/chart.png --prompt "What % is the top bar?"
- Downloads last month
- 2
Model tree for autotrust/vision-gpt-oss-120b
Base model
openai/gpt-oss-120b