Skip to main content

Module static_providers

Module static_providers 

Source
Expand description

Static-key provider connection metadata, owned by the credential broker.

This table is the broker-side source of truth for where a static API key may be discovered (env vars / login config) and where broker-proxied requests for that provider are allowed to go. Runtime code never resolves these secrets itself — it references providers by key and the broker applies the credential.

The engine-side model catalog (runtime::openai::registry) joins on key for model listings; base URLs and credential discovery live here so the broker can pin proxy destinations and never accept attacker-supplied URLs for static-key providers.

Structs§

StaticProviderSpec
Connection/credential metadata for one static-key provider.

Constants§

LOCAL_DEFAULT_BASE_URL
Default URL for the local endpoint when nothing is configured.
LOCAL_PROVIDER_KEY
The local OpenAI-compatible endpoint pseudo-provider (Ollama, LM Studio…). Its endpoint URL is non-secret user configuration; its optional key is still broker-owned.
OPENAI_COMPAT_ALLOWED_PATHS
Proxy endpoint allowlist for OpenAI-compatible providers (and the local endpoint). The typed broker proxy may only reach these relative paths — a signed proxy request can never be steered at other same-host endpoints (key-management, billing, admin APIs, …).
STATIC_PROVIDERS
All known static-key providers. Broker-owned metadata; no secrets here.

Functions§

allowed_proxy_paths
The per-provider proxy path allowlist. Every static provider in the table is OpenAI-compatible today, so they share one catalog; the lookup is per-provider so a future non-uniform provider gets its own list instead of a widened shared one. Unknown providers get an empty allowlist (fail closed).
is_static_provider
True if key names a static-key provider (not local, not OAuth).
static_provider
Look up a static provider spec by key.