providermodeldiscovery

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 14 Imported by: 0

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 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
}

Jump to

Keyboard shortcuts

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