modelresolve

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package modelresolve holds the pure capability→model resolution shared by the runtime LLM proxy (agentapi.resolveModel) and the model-config display (service/models). Keeping one copy means the "effective model" the UI shows for an unset slot is exactly what a run will actually use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentCapabilityOverride

func AgentCapabilityOverride(agent dbq.Agent, capability string) (pgtype.UUID, string)

AgentCapabilityOverride returns the agent's per-capability override pair (provider FK + model name). Both empty/invalid ⇄ "no override — inherit system default". Unknown capability returns the zero pair.

func EffectiveForCapability

func EffectiveForCapability(agent dbq.Agent, settings dbq.SystemSetting, capability string) (pgtype.UUID, string)

EffectiveForCapability walks the override → default tiers for a capability: the agent's per-capability override, then the system default. The pair is empty/invalid only when neither tier is configured.

func EffectiveForSlot

func EffectiveForSlot(agent dbq.Agent, settings dbq.SystemSetting, slot dbq.AgentModelSlot) (pgtype.UUID, string)

EffectiveForSlot resolves the model a RegisterModel slot will actually use: a bound slot uses its own assignment; an unbound slot falls through to its declared capability's effective default. Mirrors agentapi.resolveModel's precedence so the displayed model matches the run-time one.

func SystemCapabilityDefault

func SystemCapabilityDefault(settings dbq.SystemSetting, capability string) (pgtype.UUID, string)

SystemCapabilityDefault returns the (default_*_provider_id, default_*_model) pair from system_settings for the given capability.

func SystemDefaultForOverride

func SystemDefaultForOverride(settings dbq.SystemSetting, slot string) (pgtype.UUID, string)

SystemDefaultForOverride returns the (provider FK, model) an empty capability-override row inherits, keyed by the override SLOT — not the capability. The distinction matters: build and exec are both the "text" capability at runtime but have separate system defaults, and search has a default without being part of the runtime capability vocabulary. Slot is one of build/exec/stt/vision/tts/image_gen/embedding/search.

Types

This section is empty.

Jump to

Keyboard shortcuts

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