looksLikeVisionModel (providers/visionPatterns.js)

9router · open-sse/providers/visionPatterns.js · javascript · MIT
voice

Detects if a model ID likely supports vision based on naming patterns.

// Source: https://github.com/decolua/9router | License: MIT | Copyright 2024-2026 decolua and contributors
// Provided via justclaw.it.com; keep this notice with the code.
// Name-based vision detection — last resort when neither the catalog file nor
// the capability tables know a model. Vendors put the modality in the id
// ("qwen3-vl-plus", "glm-4.6v", "deepseek-v4-flash-vision-exp"), so a custom or
// freshly released model still gets image input instead of silently dropping it.
//
// Only ever turns vision ON. Never used to turn a declared capability off.

const SEP = "[-_/:.]";

// Image GENERATION, video generation, and non-chat models also carry these
// words but take no image input — checked first so they can never match.
const NOT_VISION = new RegExp(
  [
    `(^|${SEP})(image|

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key