Skip to main content
The Training API supports vision-language model (VLM) fine-tuning, allowing you to train models that understand both images and text. This works across all training modes — SFT, DPO, and RL — using the same API primitives and cookbook recipes you already know.
VLM support in the Training API requires a VLM-compatible training shape. See Training Shapes for available shapes.

What changes for vision

Compared to text-only training, VLM fine-tuning differs in three ways: Everything else — loss functions, checkpointing, weight sync, deployment sampling — works identically.

Dataset format

Vision datasets use the standard OpenAI-compatible chat format. The key difference is that content fields can contain an array of content parts mixing text and images:

Single image

Multiple images

Multi-turn with images

Image encoding requirements

Images must be base64-encoded with a MIME type prefix. Raw HTTP URLs are not supported in training data.
Supported image formats: PNG, JPEG/JPG. If your dataset contains image URLs, download and convert them to base64 first. See the conversion script in the managed VLM fine-tuning guide.

Cookbook: VLM SFT

The cookbook’s sft_loop recipe works with vision datasets out of the box. Use a VLM training shape and a VLM tokenizer:
The recipe handles vision-aware tokenization automatically — image tokens are assigned weight 0.0 (prompt) and text response tokens are assigned weight 1.0 (train).

API-level: VLM training loop

For full control over the training loop, use the API directly with a VLM training shape. The workflow is the same as text-only training, but the tokenizer and shape are VLM-specific:

1. Create the managed VLM service

2. Connect and train

3. Save and promote

Checkpointing and weight sync work identically to text-only training:

VLM DPO and RL

Vision inputs also work with DPO and RL training. The dataset format is the same — use multimodal content arrays in your messages:

DPO with vision

RL with vision prompts

Use the corresponding cookbook recipes (dpo_loop, rl_loop) with a VLM training shape and tokenizer — the multimodal message handling is automatic.

Available VLM training shapes

See Training Shapes for the full list and details.