Documentation
¶
Overview ¶
Package catalog reads the Codex model catalog (GET {base_url}/models, or $CODEX_HOME/models_cache.json read-only) and answers two questions: which models share a compatibility group, and how large a model's usable context window is. Field names follow models_cache.json as fetched by codex 0.162.1.
Index ¶
Constants ¶
const ToolModeNone = "none"
ToolModeNone is the tool_mode of an entry that has no tool_mode field.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
Catalog is a parsed /models body.
func LoadCache ¶
LoadCache reads a models_cache.json. A missing file yields an empty catalog, not an error. The file is never written.
func (Catalog) Compatible ¶
Compatible reports whether both models are known and share a Group.
type Group ¶
Group is the compatibility key: a per-step rewrite is safe only between models with an equal Group (research §1.2, spikes 3-5).
type Model ¶
type Model struct {
Slug string `json:"slug"`
Visibility string `json:"visibility"`
ContextWindow int `json:"context_window"`
MaxContextWindow int `json:"max_context_window"`
EffectivePercent int `json:"effective_context_window_percent"`
CompHash string `json:"comp_hash"`
ResponsesLite bool `json:"use_responses_lite"`
ToolMode string `json:"tool_mode"`
ReasoningLevels []ReasoningLevel `json:"supported_reasoning_levels"`
}
Model is one catalog entry. Only the fields the router reads are decoded.
func (*Model) UnmarshalJSON ¶
UnmarshalJSON applies Codex's default for an absent effective_context_window_percent; an explicit 0 stays 0.
type ReasoningLevel ¶
ReasoningLevel is one entry of supported_reasoning_levels.
type Source ¶
type Source interface {
Current() Catalog
}
Source is what consumers read the current catalog through.