Documentation
¶
Overview ¶
Package profile manages saved AgentRoute profiles: named sets of per-tier OpenRouter model choices (the generic "heavy"/"balanced"/"fast" roles described in the architecture plan), persisted as JSON files under the AgentRoute state directory.
Index ¶
Constants ¶
const ( TierHeavy = "heavy" TierBalanced = "balanced" TierFast = "fast" )
Tier names AgentRoute exposes to every platform adapter. A given platform may use a subset (see internal/platform.Role).
Variables ¶
var ErrInvalidName = fmt.Errorf("profile: invalid name")
ErrInvalidName is returned when a profile name would not round-trip safely as a filename (empty, or containing a path separator).
var ErrNotFound = fmt.Errorf("profile: not found")
ErrNotFound is returned by Load when no profile with the given name exists.
Functions ¶
func Alias ¶
Alias returns the stable AgentRoute model alias for a tier, e.g. "balanced" -> "agentroute-balanced". This is the exact string platform adapters configure their tool to send as the model, and the exact string ModelRouter.Resolve is called with.
func Delete ¶
Delete removes a saved profile. Deleting a profile that does not exist is a no-op (returns nil), matching idempotent CLI semantics.
Types ¶
type Profile ¶
type Profile struct {
Name string `json:"name"`
Port int `json:"port"`
Models map[string]string `json:"models"` // tier -> "openrouter/<id>"
Created time.Time `json:"created"`
}
Profile is a named, saved set of per-tier OpenRouter model choices.
func (Profile) Aliases ¶
Aliases returns p's tier->model mappings keyed by AgentRoute alias (see Alias) instead of bare tier name. The result is directly assignable to a gateway.MapRouter (map[string]string with the same underlying type).
func (Profile) RoleAliases ¶
RoleAliases returns p's tier->alias mapping (e.g. "heavy" -> "agentroute-heavy"), independent of which upstream model each alias currently resolves to. This is what platform.LinkInput.RoleAliases expects: a platform adapter configures its tool to request an alias for each tier; resolving that alias to a concrete model is the gateway's ModelRouter's job (see Aliases for that mapping), not the adapter's.