Documentation
¶
Overview ¶
Package models is the built-in model catalog. A model has a lab (who made it) and a provider (which kind of maitake account serves it); with custom sources these can differ.
Index ¶
- Variables
- func Allowed(patterns []string, m Model) bool
- func CompareVersions(a, b string) int
- func DisplayName(id string) string
- func GuessProvider(id string) string
- func Match(pattern string, m Model) bool
- func SplitEffort(model string) (string, string)
- type Inventory
- type Lab
- type Listed
- type Model
- type Served
Constants ¶
This section is empty.
Variables ¶
var LabForProvider = map[string]string{"claude": "anthropic", "codex": "openai"}
LabForProvider is the lab whose models a built-in provider serves.
var Labs = []Lab{
{ID: "anthropic", Name: "Anthropic"},
{ID: "openai", Name: "OpenAI"},
}
var ProviderForLab = map[string]string{"anthropic": "claude", "openai": "codex"}
ProviderForLab is the reverse of LabForProvider.
Functions ¶
func Allowed ¶
Allowed reports whether a model passes a key's allow-list; an empty list allows everything.
func CompareVersions ¶ added in v0.9.0
CompareVersions orders model IDs by release: the version numbers in the ID, then its date stamp. It is positive when a is the later release.
func DisplayName ¶
DisplayName turns an ID like "claude-opus-4-5-20251101" into "Claude Opus 4.5".
func GuessProvider ¶
GuessProvider routes unknown model IDs by family so new upstream models work immediately.
func Match ¶
Match reports whether a glob pattern matches a model, checked against both its bare and canonical names ("claude-*" and "anthropic/*" both match claude-opus-5).
func SplitEffort ¶
SplitEffort separates an optional "(effort)" suffix: "gpt-5.5(high)" → "gpt-5.5", "high".
Types ¶
type Inventory ¶ added in v0.9.0
type Inventory struct {
Models []Served
// Unreported are accounts with no list yet, by provider; they might serve anything.
Unreported map[string][]int64
// CheckedAt is the most recent successful report.
CheckedAt time.Time
}
Inventory is what a pool's usable accounts have reported about their models.
type Listed ¶ added in v0.9.0
type Listed struct {
ID string
Created time.Time // zero when upstream doesn't say
// Preview models exist upstream but aren't generally offered: hidden or not yet active.
Preview bool
}
Listed is a model an upstream account says it can use.
type Model ¶
type Model struct {
// ID is the name the upstream expects, e.g. "claude-opus-5".
ID string `json:"id"`
// Canonical is "lab/id", the OpenRouter-style name.
Canonical string `json:"canonical"`
Lab string `json:"lab"`
Provider string `json:"provider"`
Name string `json:"name"`
ContextLength int `json:"contextLength"`
MaxOutput int `json:"maxOutput"`
// Efforts are the reasoning levels the model accepts; empty when unknown or budget-only.
Efforts []string `json:"efforts,omitempty"`
Custom bool `json:"custom"`
}