What is a Custom Provider?
A custom provider is a per-workspace configuration that tells the MetrixLLM gateway to route requests to your own endpoint instead of built-in providers. Custom providers:- Are per-workspace — each workspace can have its own custom endpoints
- Support the OpenAI chat completions format (
/v1/chat/completions) - Can be local (no API key needed) or remote (with authentication)
- Appear alongside built-in providers in routing configuration
- Support model registration so you can track costs and capabilities
Supported Servers
Any server implementing the OpenAI API format works:Setup
1. Add a Custom Provider
Navigate to Settings > Custom Providers in your workspace dashboard and click Add provider. Fill in:- Provider Name — A human-readable label (e.g., “My Local Llama”)
- Base URL — The server’s base URL (e.g.,
http://localhost:11434/v1) - API Key — Optional. Leave empty for local servers without authentication
2. Register Models
After adding a provider, expand it and click Add model. For each model:- Model ID — The model name the server expects (e.g.,
llama-3.3-70b) - Display Name — A human-friendly name (e.g., “Llama 3.3 70B (Local)”)
- Context Window — Maximum context length (e.g.,
128K)
3. Test the Connection
Click Test on your provider to verify connectivity. The gateway will hit the/v1/models endpoint to confirm the server is reachable and list available models.
Using Custom Providers
Via the Gateway API
Send requests to the MetrixLLM gateway with your registered model name:Via the Dashboard Playground
- Go to Playground
- Select your custom model from the model dropdown
- Send a test message
Via the Drop-in Endpoint
Use the OpenAI SDK with the MetrixLLM base URL:How Routing Works
When a request arrives at the gateway:- The gateway looks up the model name in
admin_models(built-in providers) - If not found, it checks your workspace’s custom providers
- If a match is found, the request is forwarded to your custom endpoint
- The response is parsed using OpenAI format and returned to the client
Caching and Invalidation
Custom provider configurations are cached in the gateway for 60 seconds. When you update a provider in the dashboard, the cache is invalidated immediately via NATS pub/sub.Limitations
- Custom providers only support the chat completions format (
/v1/chat/completions) - Embedding endpoints are not yet supported for custom providers
- Web search injection is not available for custom provider models
- Custom provider models are workspace-scoped — other workspaces cannot see them