providermodeldiscovery

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	ReasoningEfforts       []string
	DefaultReasoningEffort string
	ServiceTiers           []string
	DefaultServiceTier     string
	InputModalities        []string
	OutputModalities       []string
	InputCost              float64
	OutputCost             float64
	Tags                   []string
	Source                 string
}

func Discover

func Discover(ctx context.Context, profile config.ProviderProfile, options Options) ([]Model, error)

func DiscoverCatalog

func DiscoverCatalog(ctx context.Context, provider providercatalog.Descriptor, profile config.ProviderProfile, options Options) ([]Model, error)

type Options

type Options struct {
	HTTPClient           *http.Client
	ModelsDevURL         string
	OpenGatewayURL       string
	OpenRouterURL        string
	OAuthResolver        providerio.TokenResolver
	CodexAccountResolver openai.CodexAccountResolver
	UserAgent            string
	ClientVersion        string
}

Jump to

Keyboard shortcuts

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