Envoy AI Gateway
Envoy AI Gateway is an open-source proxy for model providers. Promptfoo uses its OpenAI-compatible chat endpoint.
Setup
- Deploy and configure your Envoy AI Gateway following the official setup guide
- Configure your gateway URL either via environment variable or in your config
- Set up authentication if required by your gateway configuration
Provider Format
The Envoy provider uses this format:
envoy:<model_name>- Connects to your gateway using the specified model name
Configuration
Basic Configuration
promptfooconfig.yaml
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
providers:
- id: envoy:my-model
config:
apiBaseUrl: 'https://your-envoy-gateway.com/v1'
apiKeyEnvar: ENVOY_API_KEY
By default, the provider requires a bearer key and reads OPENAI_API_KEY. The example uses
ENVOY_API_KEY instead. You can also set apiKey directly. For a gateway with no bearer key,
set apiKeyRequired: false; see Authenticating via header.
With Environment Variable
Set your gateway URL as an environment variable:
export ENVOY_API_BASE_URL="https://your-envoy-gateway.com"
export ENVOY_API_KEY="your-api-key"
Then use the provider without specifying the URL:
providers:
- id: envoy:my-model
config:
apiKeyEnvar: ENVOY_API_KEY
Authenticating via header
If your gateway expects an x-api-key header, set apiKeyRequired: false and supply the header:
providers:
- id: envoy:my-model
config:
apiBaseUrl: 'https://your-envoy-gateway.com/v1'
apiKeyRequired: false
headers:
x-api-key: '{{ env.ENVOY_API_KEY }}'
See Also
- OpenAI Provider - Compatible API format used by Envoy AI Gateway
- Configuration Reference - Full configuration options for providers
- Envoy AI Gateway Documentation - Official gateway documentation
- Envoy AI Gateway GitHub - Source code and examples