models

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
var LabForProvider = map[string]string{"claude": "anthropic", "codex": "openai"}

LabForProvider is the lab whose models a built-in provider serves.

View Source
var Labs = []Lab{
	{ID: "anthropic", Name: "Anthropic"},
	{ID: "openai", Name: "OpenAI"},
}
View Source
var ProviderForLab = map[string]string{"anthropic": "claude", "openai": "codex"}

ProviderForLab is the reverse of LabForProvider.

Functions

func Allowed

func Allowed(patterns []string, m Model) bool

Allowed reports whether a model passes a key's allow-list; an empty list allows everything.

func CompareVersions added in v0.9.0

func CompareVersions(a, b string) int

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

func DisplayName(id string) string

DisplayName turns an ID like "claude-opus-4-5-20251101" into "Claude Opus 4.5".

func GuessProvider

func GuessProvider(id string) string

GuessProvider routes unknown model IDs by family so new upstream models work immediately.

func Match

func Match(pattern string, m Model) bool

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

func SplitEffort(model string) (string, string)

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 Lab

type Lab struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

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"`
}

func Builtin

func Builtin() []Model

func Lookup

func Lookup(id string) (Model, bool)

Lookup finds a built-in model by ID, ignoring a trailing date stamp on either side.

type Served added in v0.9.0

type Served struct {
	ID       string
	Provider string
	Created  time.Time
	Accounts []int64
	// PreviewAccounts list the model as a preview.
	PreviewAccounts []int64
}

Served is a listed model and the accounts that reported it.

Jump to

Keyboard shortcuts

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