models

package
v0.182.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package models provides utilities for working with LLM models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsImageGenModalities

func IsImageGenModalities(mods sdk.ModelModalities) bool

IsImageGenModalities reports whether a modality set describes an image-generation model: it outputs "image" but not "text", so it can produce pictures but cannot chat. Vision chat models (image in, text out) return false.

func IsImageGenerationModel

func IsImageGenerationModel(modelID string) bool

IsImageGenerationModel reports whether the model generates images rather than text (see IsImageGenModalities). Falls back to false when the model is not in the registry.

func LookupContextWindow

func LookupContextWindow(model string) (int, bool)

LookupContextWindow returns the matched context window size and whether a real match was found (from user config override or gateway data). Unknown models return (0, false) - there is no built-in fallback, so callers must gate window-dependent features on the second return.

func ModalitiesLabel

func ModalitiesLabel(modelID string) string

ModalitiesLabel returns a compact human-readable label for a model's modalities, or "" when the model is not in the registry: "image-gen" for image-generation models, "vision" for image-accepting chat models, "" otherwise.

func SetGatewayContextWindows

func SetGatewayContextWindows(windows map[string]int)

SetGatewayContextWindows replaces the gateway-reported context windows (from /v1/models?include=context_window). Keys are full "provider/model" ids; matching is exact on the lowercased id.

func SetGatewayModalities

func SetGatewayModalities(modalities map[string]sdk.ModelModalities)

SetGatewayModalities replaces the gateway-reported modalities (from /v1/models?include=modalities). Keys are full "provider/model" ids; matching is exact on the lowercased id.

func SupportsVision

func SupportsVision(modelID string) bool

SupportsVision reports whether the model accepts native image input (input modalities include both "text" and "image"). Models not in the registry return false.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL