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 ¶
- func AgentCapabilityOverride(agent dbq.Agent, capability string) (pgtype.UUID, string)
- func EffectiveForCapability(agent dbq.Agent, settings dbq.SystemSetting, capability string) (pgtype.UUID, string)
- func EffectiveForSlot(agent dbq.Agent, settings dbq.SystemSetting, slot dbq.AgentModelSlot) (pgtype.UUID, string)
- func SystemCapabilityDefault(settings dbq.SystemSetting, capability string) (pgtype.UUID, string)
- func SystemDefaultForOverride(settings dbq.SystemSetting, slot string) (pgtype.UUID, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentCapabilityOverride ¶
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 ¶
SystemCapabilityDefault returns the (default_*_provider_id, default_*_model) pair from system_settings for the given capability.
func SystemDefaultForOverride ¶
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.