modelresolver

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultModelPerProvider = map[string]string{
	"amazon-bedrock":         "us.anthropic.claude-opus-4-6-v1",
	"anthropic":              "claude-opus-4-7",
	"openai":                 "gpt-5.4",
	"azure-openai-responses": "gpt-5.4",
	"openai-codex":           "gpt-5.5",
	"deepseek":               "deepseek-v4-pro",
	"google":                 "gemini-3.1-pro-preview",
	"google-vertex":          "gemini-3.1-pro-preview",
	"github-copilot":         "gpt-5.4",
	"openrouter":             "moonshotai/kimi-k2.6",
	"vercel-ai-gateway":      "zai/glm-5.1",
	"xai":                    "grok-4.20-0309-reasoning",
	"groq":                   "openai/gpt-oss-120b",
	"cerebras":               "zai-glm-4.7",
	"zai":                    "glm-5.1",
	"mistral":                "devstral-medium-latest",
	"minimax":                "MiniMax-M2.7",
	"minimax-cn":             "MiniMax-M2.7",
	"moonshotai":             "kimi-k2.6",
	"moonshotai-cn":          "kimi-k2.6",
	"huggingface":            "moonshotai/Kimi-K2.6",
	"fireworks":              "accounts/fireworks/models/kimi-k2p6",
	"together":               "moonshotai/Kimi-K2.6",
	"opencode":               "kimi-k2.6",
	"opencode-go":            "kimi-k2.6",
	"kimi-coding":            "kimi-for-coding",
	"cloudflare-workers-ai":  "@cf/moonshotai/kimi-k2.6",
	"cloudflare-ai-gateway":  "workers-ai/@cf/moonshotai/kimi-k2.6",
	"xiaomi":                 "mimo-v2.5-pro",
	"xiaomi-token-plan-cn":   "mimo-v2.5-pro",
	"xiaomi-token-plan-ams":  "mimo-v2.5-pro",
	"xiaomi-token-plan-sgp":  "mimo-v2.5-pro",
}

Functions

func FindExactModelReferenceMatch

func FindExactModelReferenceMatch(modelReference string, availableModels []llm.Model) *llm.Model

func IsAliasModelID

func IsAliasModelID(id string) bool

Types

type AllModelRegistry

type AllModelRegistry interface {
	GetAll() []llm.Model
}

type CodingModelRegistry

type CodingModelRegistry interface {
	AllModelRegistry
	GetAvailable() []llm.Model
	Find(provider, modelID string) (llm.Model, bool)
}

type FindInitialModelOptions

type FindInitialModelOptions struct {
	CLIProvider              string
	CLIModel                 string
	ScopedModels             []ScopedModel
	IsContinuing             bool
	DefaultProvider          string
	DefaultModelID           string
	DefaultThinkingLevel     ThinkingLevel
	ModelRegistry            CodingModelRegistry
	NoModelsAvailableMessage string
}

type InitialModelResult

type InitialModelResult struct {
	Model           *llm.Model
	ThinkingLevel   ThinkingLevel
	FallbackMessage string
	Error           string
}

func FindInitialModel

func FindInitialModel(options FindInitialModelOptions) InitialModelResult

type ModelPatternOptions

type ModelPatternOptions struct {
	StrictInvalidThinkingLevel bool
}

type ParsedModelResult

type ParsedModelResult struct {
	Model         *llm.Model
	ThinkingLevel ThinkingLevel
	Warning       string
}

func ParseModelPattern

func ParseModelPattern(pattern string, availableModels []llm.Model, options ...ModelPatternOptions) ParsedModelResult

type ResolveCLIModelOptions

type ResolveCLIModelOptions struct {
	CLIProvider              string
	CLIModel                 string
	ModelRegistry            AllModelRegistry
	NoModelsAvailableMessage string
}

type ResolveCLIModelResult

type ResolveCLIModelResult struct {
	Model         *llm.Model
	ThinkingLevel ThinkingLevel
	Warning       string
	Error         string
}

func ResolveCLIModel

func ResolveCLIModel(options ResolveCLIModelOptions) ResolveCLIModelResult

type ScopedModel

type ScopedModel struct {
	Model         llm.Model
	ThinkingLevel ThinkingLevel
}

func ResolveModelScope

func ResolveModelScope(patterns []string, registry CodingModelRegistry) []ScopedModel

Jump to

Keyboard shortcuts

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