Documentation
¶
Overview ¶
Package providers exposes a small driver-style registry of provider constructors. It lets callers ask for a provider by name without hand-coding a switch over every shipped provider package.
Each provider sub-package registers itself in init() so importing `_ "github.com/erain/glue/providers/nvidia"` makes that provider resolvable via providers.New("nvidia"). The registry holds factory functions, not constructed providers, so registration is cheap and has no I/O or credential side effects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyAvailable ¶
KeyAvailable reports whether the registered provider's env var is non-empty in the process environment. Returns false for unknown providers and for providers registered without an EnvKey.
func Known ¶
func Known() []string
Known returns the registered provider names, sorted for stable output in error messages and CLI help text.
Types ¶
type Factory ¶
type Factory struct {
// New returns a fresh provider configured with package defaults
// (no explicit API key — falls back to the provider's env var).
New func() loop.Provider
// DefaultModel is the model id callers should use when they have
// no opinion. The registry exposes it so a CLI agent can present
// `--model` defaults that vary by provider.
DefaultModel string
// EnvKey is the environment variable the provider reads when
// APIKey is empty. Used by KeyAvailable.
EnvKey string
}
Factory describes one registered provider.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package codex is a glue.Provider that routes through the Codex Responses endpoint at chatgpt.com/backend-api/codex/responses, authenticated with a ChatGPT subscription via OAuth tokens read from the upstream Codex CLI's auth.json (run "codex login" once outside glue).
|
Package codex is a glue.Provider that routes through the Codex Responses endpoint at chatgpt.com/backend-api/codex/responses, authenticated with a ChatGPT subscription via OAuth tokens read from the upstream Codex CLI's auth.json (run "codex login" once outside glue). |
|
auth
Package auth handles ChatGPT-subscription OAuth tokens for the providers/codex transport.
|
Package auth handles ChatGPT-subscription OAuth tokens for the providers/codex transport. |
|
Package gemini adapts Google's Gemini API to Glue's provider interface.
|
Package gemini adapts Google's Gemini API to Glue's provider interface. |
|
Package nvidia implements a Glue provider for the NVIDIA build inference API (https://build.nvidia.com), which exposes an OpenAI-compatible chat-completions endpoint at https://integrate.api.nvidia.com/v1.
|
Package nvidia implements a Glue provider for the NVIDIA build inference API (https://build.nvidia.com), which exposes an OpenAI-compatible chat-completions endpoint at https://integrate.api.nvidia.com/v1. |
|
Package openaicompat implements the shared streaming, tool-call, and convert logic for OpenAI-style chat-completions endpoints used by the concrete providers under providers/.
|
Package openaicompat implements the shared streaming, tool-call, and convert logic for OpenAI-style chat-completions endpoints used by the concrete providers under providers/. |
|
Package openrouter implements a Glue provider for OpenRouter (https://openrouter.ai), an OpenAI-compatible aggregator that routes requests across many underlying model providers.
|
Package openrouter implements a Glue provider for OpenRouter (https://openrouter.ai), an OpenAI-compatible aggregator that routes requests across many underlying model providers. |