models

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package models provides a catalog of known Claude models and their capabilities. It is the source of truth for model metadata within the SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capabilities

func Capabilities(modelID string) []string

Capabilities is a convenience function that returns capability strings for the given model ID. Returns nil if the model is not found.

Types

type Capability

type Capability string

Capability represents a model capability such as vision or tool use.

const (
	// CapVision indicates the model supports image/vision inputs.
	CapVision Capability = "vision"
	// CapToolUse indicates the model supports tool/function calling.
	CapToolUse Capability = "tool-use"
	// CapReasoning indicates the model supports extended reasoning.
	CapReasoning Capability = "reasoning"
	// CapStructuredOutput indicates the model supports structured JSON output.
	CapStructuredOutput Capability = "structured-output"
)

type CostTier

type CostTier string

CostTier represents a provider-agnostic relative cost tier.

const (
	// CostTierHigh represents opus-class pricing.
	CostTierHigh CostTier = "high"
	// CostTierMedium represents sonnet-class pricing.
	CostTierMedium CostTier = "medium"
	// CostTierLow represents haiku-class pricing.
	CostTierLow CostTier = "low"
)

type Info added in v0.0.2

type Info struct {
	ID                        string                  `json:"id"`
	Model                     string                  `json:"model"`
	DisplayName               string                  `json:"displayName"`
	Description               string                  `json:"description"`
	IsDefault                 bool                    `json:"isDefault"`
	Hidden                    bool                    `json:"hidden"`
	DefaultReasoningEffort    string                  `json:"defaultReasoningEffort"`
	SupportedReasoningEfforts []ReasoningEffortOption `json:"supportedReasoningEfforts"`
	InputModalities           []string                `json:"inputModalities"`
	SupportsPersonality       bool                    `json:"supportsPersonality"`
	Metadata                  map[string]any          `json:"metadata,omitempty"`
}

Info describes a Claude model in a Codex-like model listing payload.

func List added in v0.0.2

func List() []Info

List returns the static Claude model list in the Codex-like payload shape.

type ListResponse added in v0.0.2

type ListResponse struct {
	Models   []Info         `json:"models"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

ListResponse is the static response payload backing ListModels.

func Response added in v0.0.2

func Response() ListResponse

Response returns the full static model list response payload.

type Model

type Model struct {
	// ID is the API model identifier (e.g. "claude-opus-4-6").
	ID string
	// Name is the human-readable display name.
	Name string
	// CostTier is the relative cost tier for this model.
	CostTier CostTier
	// Capabilities lists what the model supports.
	Capabilities []Capability
	// ContextWindow is the default context window size in tokens.
	ContextWindow int
	// MaxOutputTokens is the maximum number of output tokens.
	MaxOutputTokens int
}

Model holds metadata for a single Claude model.

func All

func All() []Model

All returns a copy of every known model in the static catalog. This is not a live account-specific list from the Claude CLI.

func ByCostTier

func ByCostTier(tier CostTier) []Model

ByCostTier returns all models matching the given cost tier.

func ByID

func ByID(id string) *Model

ByID looks up a model by its identifier. Returns nil if no model is found.

func (Model) CapabilityStrings

func (m Model) CapabilityStrings() []string

CapabilityStrings returns capabilities as a string slice for interop with string-based systems.

func (Model) HasCapability

func (m Model) HasCapability(capability Capability) bool

HasCapability reports whether the model supports the given capability.

type ReasoningEffortOption added in v0.0.2

type ReasoningEffortOption struct {
	Value string `json:"reasoningEffort"`
	Label string `json:"description"`
}

ReasoningEffortOption describes a selectable reasoning effort level.

Jump to

Keyboard shortcuts

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