capabilities

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package capabilities derives model reasoning capabilities (thinking mode and effort tiers) from the LiteLLM model registry. It is a BUILD-TIME helper used by cmd/synccaps to enrich the hand-maintained conf/providers templates; it is not wired into the runtime server (the runtime reads capabilities straight from the provider templates).

Matching is intentionally LIGHT: model identifiers enumerated in the official provider templates are already canonical (e.g. "claude-opus-4-6", "gpt-5.4", "grok-4"), so a canonical-equality match against the registry is enough. We deliberately avoid token-subset / version-veto fuzzing: a canonical miss simply falls back to the template's own legacy toggle default, which is safer than borrowing a sibling/repackaged entry's capabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	// ThinkingMode is "", toggle, adaptive, or none. "" = unknown.
	ThinkingMode string
	// EffortLevels is the ordered effort tier list, or nil if unknown.
	EffortLevels []string
	// Vision / ToolCall / FileInput are nil when the registry is silent.
	Vision   *bool
	ToolCall *bool
	// FileInput mirrors supports_pdf_input: the provider API accepts documents
	// (PDF) as native input parts.
	FileInput *bool
	// ContextWindow is nil when unknown.
	ContextWindow *int
}

Capabilities is the fill payload derived from a registry entry. A zero/empty field means "registry did not provide this"; callers must only fill missing upstream values and never override explicit ones.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver resolves model capabilities from a LiteLLM registry snapshot. It is a BUILD-TIME helper (used by cmd/synccaps) and is not part of the runtime path.

func NewResolver

func NewResolver(body []byte) (*Resolver, error)

NewResolver parses a LiteLLM registry JSON body, prunes third-party reseller shells, and builds the lookup index.

func (*Resolver) Count

func (r *Resolver) Count() int

Count reports the number of (post-prune) registry entries indexed.

func (*Resolver) Resolve

func (r *Resolver) Resolve(modelID string) (Capabilities, bool)

Resolve returns derived capabilities for a (canonical) model identifier. The bool is false on a miss; callers should leave the template's existing values untouched in that case.

Jump to

Keyboard shortcuts

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