Help us shape the future of Go! Take the 2026 Go Developer Survey

catalog

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package catalog is what connectors offer people to choose: the providers a harness may have and the presets, a full session config each, they show as models. The harness never reads it; it takes whatever full config a connector sends. build/ makes it from source.json and models.dev, and a workflow publishes it at URL.

Index

Constants

View Source
const URL = "https://dl.mainplane.ai/catalog/v1.json"

URL is the published catalog. v1 changes only with a change that breaks readers.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Version   string              `json:"version"`
	Providers map[string]Provider `json:"providers"` // by id: the name a harness config gives it
	Presets   map[string]Preset   `json:"presets"`   // by id: provider/model
	Groups    map[string][]string `json:"groups"`    // preset ids, in the order to show
}

func Fetch

func Fetch(ctx context.Context) (Catalog, error)

Fetch reads the published catalog.

func (Catalog) Keyed added in v0.5.5

func (c Catalog) Keyed(id string) []string

Keyed is the ids of the providers that take provider id's key: its group, or id alone.

type Cost

type Cost struct {
	Input      float64 `json:"input"`
	Output     float64 `json:"output"`
	CacheRead  float64 `json:"cache_read"`
	CacheWrite float64 `json:"cache_write"`
}

Cost is USD per million tokens.

type Preset

type Preset struct {
	Name         string                     `json:"name"`
	Provider     string                     `json:"provider"`
	Model        string                     `json:"model"`
	Tools        string                     `json:"tools"`
	ContextLimit int                        `json:"context_limit"`
	Input        []string                   `json:"input"`
	Params       map[string]json.RawMessage `json:"params"`
	Cost         Cost                       `json:"cost"`
	Settings     []Setting                  `json:"settings,omitempty"`
}

Preset is a full session config but its workers.

type Provider

type Provider struct {
	Name    string `json:"name"`
	Shape   string `json:"shape"`
	URL     string `json:"url,omitempty"`     // the config's url, where it is not the shape's default
	Session string `json:"session,omitempty"` // the config's session header
	Group   string `json:"group,omitempty"`   // providers that take one key, one per shape a vendor's models span: a connector asks once and sets it on each
}

type Setting

type Setting struct {
	Name   string  `json:"name"`
	Values []Value `json:"values"`
}

Setting is one choice a connector may offer, such as effort. Each value is params merged over the preset's; the value whose params the preset's hold is the current one.

type Value

type Value struct {
	Name   string                     `json:"name"`
	Params map[string]json.RawMessage `json:"params"`
}

Directories

Path Synopsis
Build prints the catalog: source.json, our choices, filled in with each model's name, limits, input and prices from models.dev.
Build prints the catalog: source.json, our choices, filled in with each model's name, limits, input and prices from models.dev.

Jump to

Keyboard shortcuts

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