MediaMarker

MediaMarker overrides the placeholder token used in the vision chat template to mark where images are inserted. Default is model-specific and selected automatically — override only when you understand the exact format your model expects.

Quick reference

Type string?
Default null (use the chat template’s default marker)
Category Multimodal context
Field on MultimodalContextParameters.MediaMarker

What it does

Vision chat templates use a specific token or placeholder in the prompt to mark where the image embedding is inserted. Different model families use different markers — LLaVA uses one, Qwen-VL uses another, Gemma3 yet another. The SDK picks the correct one from the model’s metadata.

  • null (default) — template picks the model’s default.
  • Explicit string — override with your own marker.

Overriding without matching the model’s trained format produces garbled output — the image is inserted at the wrong position or with the wrong surrounding tokens.

When to change it

Scenario Value
Default (recommended) null
Custom GGUF with a non-standard marker Exact marker the model was trained with

Very rarely needed. Most use cases leave this null.

Example

var preset = new Qwen3VL2BPreset();
// preset.MtmdContextParameters.MediaMarker = null; // default — correct choice

Experimental custom marker:

preset.MtmdContextParameters.MediaMarker = "<|image|>";
// Only if you know the model's training format expects this exact marker.

Interactions

What’s next