models

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClaudeCodePrompt is the required system prompt for OAuth authentication.
	ClaudeCodePrompt = "You are Claude Code, Anthropic's official CLI for Claude."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cost added in v0.14.0

type Cost struct {
	Input      float64
	Output     float64
	CacheRead  *float64
	CacheWrite *float64
}

Cost represents the pricing information for a model.

type Limit added in v0.14.0

type Limit struct {
	Context int
	Output  int
}

Limit represents the context and output limits for a model.

type ModelInfo added in v0.14.0

type ModelInfo struct {
	ID          string
	Name        string
	Attachment  bool
	Reasoning   bool
	Temperature bool
	Cost        Cost
	Limit       Limit
}

ModelInfo represents information about a specific model.

type ModelsRegistry added in v0.14.0

type ModelsRegistry struct {
	// contains filtered or unexported fields
}

ModelsRegistry provides validation and information about models. It maintains a registry of all supported LLM providers and their models, including capabilities, pricing, and configuration requirements. The registry data comes from the catwalk embedded database.

func GetGlobalRegistry added in v0.14.0

func GetGlobalRegistry() *ModelsRegistry

GetGlobalRegistry returns the global models registry instance.

func NewModelsRegistry added in v0.14.0

func NewModelsRegistry() *ModelsRegistry

NewModelsRegistry creates a new models registry populated from the catwalk embedded database.

func (*ModelsRegistry) GetModelsForProvider added in v0.14.0

func (r *ModelsRegistry) GetModelsForProvider(provider string) (map[string]ModelInfo, error)

GetModelsForProvider returns all models for a specific provider.

func (*ModelsRegistry) GetRequiredEnvVars added in v0.14.0

func (r *ModelsRegistry) GetRequiredEnvVars(provider string) ([]string, error)

GetRequiredEnvVars returns the required environment variables for a provider.

func (*ModelsRegistry) GetSupportedProviders added in v0.14.0

func (r *ModelsRegistry) GetSupportedProviders() []string

GetSupportedProviders returns a list of all supported providers.

func (*ModelsRegistry) SuggestModels added in v0.14.0

func (r *ModelsRegistry) SuggestModels(provider, invalidModel string) []string

SuggestModels returns similar model names when an invalid model is provided.

func (*ModelsRegistry) ValidateEnvironment added in v0.14.0

func (r *ModelsRegistry) ValidateEnvironment(provider string, apiKey string) error

ValidateEnvironment checks if required environment variables are set.

func (*ModelsRegistry) ValidateModel added in v0.14.0

func (r *ModelsRegistry) ValidateModel(provider, modelID string) (*ModelInfo, error)

ValidateModel validates if a model exists and returns detailed information.

type OllamaLoadingResult added in v0.18.0

type OllamaLoadingResult struct {
	Message string
}

OllamaLoadingResult contains the result of model loading with actual settings used.

type ProviderConfig

type ProviderConfig struct {
	ModelString    string
	SystemPrompt   string
	ProviderAPIKey string
	ProviderURL    string
	MaxTokens      int
	Temperature    *float32
	TopP           *float32
	TopK           *int32
	StopSequences  []string
	NumGPU         *int32
	MainGPU        *int32
	TLSSkipVerify  bool
}

ProviderConfig holds configuration for creating LLM providers.

type ProviderInfo added in v0.14.0

type ProviderInfo struct {
	ID     string
	Env    []string
	Name   string
	Models map[string]ModelInfo
}

ProviderInfo represents information about a model provider.

type ProviderResult added in v0.18.0

type ProviderResult struct {
	// Model is the created fantasy LanguageModel
	Model fantasy.LanguageModel
	// Message contains optional feedback for the user
	Message string
}

ProviderResult contains the result of provider creation.

func CreateProvider

func CreateProvider(ctx context.Context, config *ProviderConfig) (*ProviderResult, error)

CreateProvider creates a fantasy LanguageModel based on the provider configuration. It validates the model, checks required environment variables, and initializes the appropriate provider.

Supported providers: anthropic, openai, google, ollama, azure, google-vertex-anthropic, openrouter, bedrock

Jump to

Keyboard shortcuts

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