modelfacts

package
v0.7.59-dev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package modelfacts is what the runner knows about a hosted model without asking anyone at run time: its context window, its output limit and its prices.

The facts are a snapshot compiled into the CLI (catalog.json), a trimmed copy of models.dev's public list for the providers a policy can name; its licence is in LICENSE.models-dev. scripts/modelfacts/update.py regenerates it. Nothing here reaches the network: a model the snapshot does not hold has no facts, and the runner goes on without them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetched

func Fetched() string

Fetched is the day the snapshot was taken, as YYYY-MM-DD.

Types

type Facts

type Facts struct {
	// ContextWindow is the model's window in tokens, and MaxOutput the
	// most output one request may ask for; zero when not listed.
	ContextWindow int64
	MaxOutput     int64
	// Priced reports that the catalogue lists the model's prices. The
	// four prices are dollars a million tokens: input read fresh, input
	// read from the provider's cache, input written to it, and output.
	// A cache price the catalogue does not list is the fresh price.
	Priced     bool
	Input      float64
	CacheRead  float64
	CacheWrite float64
	Output     float64
}

Facts is what the catalogue holds about one model.

func Lookup

func Lookup(provider, model string) (Facts, bool)

Lookup returns the facts for a provider's model, by the policy's provider name and the model's id as the provider knows it.

Jump to

Keyboard shortcuts

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