Skip to main content

Module providers

Module providers 

Source
Expand description

Universal provider routes — the request-path half of the universal-provider-framework (enterprise#7).

/providers/{id}/... forwards to the [[proxy.providers]] registry entry with that id, speaking the entry’s declared WireShape. A new OpenAI/Anthropic/Gemini-compatible endpoint (Azure AI Foundry, OpenRouter, Groq, vLLM, a corporate gateway…) is therefore pure configuration — no code change, no rebuild:

[[proxy.providers]]
id = "foundry"
shape = "openai"
base_url = "https://my-resource.services.ai.azure.com"
api_key_env = "FOUNDRY_API_KEY"   # optional: gateway-held credential

Shape ≠ identity: the proxy understands four wire dialects (the shapes) and any number of provider identities map onto them. Compression, introspection and usage metering all run exactly as they do for the built-in routes of the same shape.

When api_key_env is set, the gateway holds the upstream credential and the caller authenticates with the lean-ctx Bearer token only: every incoming credential header is stripped and replaced by the configured key (the caller never needs — or sees — the provider key). Without api_key_env the caller’s own credentials are forwarded verbatim, exactly like the built-ins.

Functions§

handler
schedule_connector
Select and schedule a connector through the real provider pipeline.