Documentation
¶
Overview ¶
Package alias holds remora's model aliases and compiles them into a flat chain of provider targets.
Index ¶
Constants ¶
const DefaultMaxDepth = 5
DefaultMaxDepth is the nesting limit used when Compile is given maxDepth <= 0.
Variables ¶
var ( ErrCycle = errors.New("alias: cycle") ErrDepth = errors.New("alias: nesting too deep") ErrUnknownMember = errors.New("alias: unknown member") ErrEmpty = errors.New("alias: no members") )
Compile errors. Returned errors wrap one of these and name the alias path.
var ErrInvalidName = errors.New("alias: invalid name")
ErrInvalidName means an alias name does not match the allowed pattern.
Functions ¶
Types ¶
type Alias ¶
type Alias struct {
Name string
Kind Kind
Members []Member
Capabilities []string // advertised supported_parameters, e.g. "structured_outputs", "tools"
ContextWindow int // 0 = unset
}
Alias is a named, ordered list of members that clients call as a model.
type Member ¶
type Member struct{ Ref string }
Member is one entry of an alias: an alias name, or "<provider>/<model>".
type Target ¶
type Target struct{ Provider, Model string }
Target is a provider model an alias resolves to.
func Compile ¶
Compile expands the alias name into a flat, ordered chain of provider targets. Nested aliases are expanded depth first in member order, and a target already in the chain is dropped. A member ref is an alias when all has that key, otherwise "<provider>/<model>" split at the first "/". The named alias is depth 1; maxDepth <= 0 means DefaultMaxDepth.