Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverOllamaContextWindow ¶
func DiscoverOllamaContextWindow(ctx context.Context, baseURL string, model string, options Options) (int, error)
DiscoverOllamaContextWindow asks a local Ollama daemon for a model's context length via its native /api/show endpoint. The generic /v1/models probe (parseModelsResponse) only ever returns id/description — OpenAI-compatible listings don't carry context-window metadata, and a custom/local model tag (e.g. a user's own Ollama pull, including a ":cloud"-tagged model proxied through the local daemon) has no curated-catalog entry to borrow one from either, so modelContextWindow has nothing to show for it without this. Only meaningful for the local Ollama provider (baseURL like http://localhost:11434/v1) — Ollama Cloud's hosted API is a different service and isn't assumed to expose the same endpoint.
Types ¶
type Model ¶
type Model struct {
ID string
Description string
ContextWindow int
ToolCall bool
Reasoning bool
InputModalities []string
OutputModalities []string
InputCost float64
OutputCost float64
Tags []string
Source string
}
func DiscoverCatalog ¶
func DiscoverCatalog(ctx context.Context, provider providercatalog.Descriptor, profile config.ProviderProfile, options Options) ([]Model, error)