providers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 5 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

Overview

Package providers holds the catalogue of well-known LLM providers and the logic to connect one, shared by the TUI picker and the CLI so both stay in sync.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Activate

func Activate(cfg *config.Config, id, key string)

Activate records credentials (when a key is given), makes the provider the active one, and points the default model at it when the current one doesn't belong to it. It mutates cfg but does not persist — the caller saves.

func Connected

func Connected(cfg *config.Config, id string) bool

Connected reports whether a provider already has a usable credential (an API key in config, a set key-env, or being a local provider that needs none).

func ContextWindow added in v0.3.0

func ContextWindow(model string) int

ContextWindow returns the known context window for a model id, or 0 if none is catalogued.

func FetchModels

func FetchModels(ctx context.Context, cfg *config.Config, providerID string) ([]string, error)

FetchModels queries a provider's /models endpoint for the model ids it offers, the same way the dashboard does. This surfaces models a custom or dynamic provider exposes even when they are not listed statically in the config.

Types

type Info

type Info struct {
	ID       string
	Label    string
	Kind     string
	KeyEnv   string
	BaseURL  string
	NeedsKey bool
	Models   []string
}

Info describes a provider users can connect to in one step.

func Catalog

func Catalog() []Info

Catalog returns the well-known providers, in display order.

func For

func For(id string) (Info, bool)

For looks up a catalogue entry by id.

Jump to

Keyboard shortcuts

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