Add a custom provider
Add a custom provider when your endpoint has no catalog preset. Set its name, dialect, and URL. Use this for a self-hosted server, an internal proxy, or a second instance of a known provider.
The whole thing
Section titled “The whole thing”Add this configuration:
providers: - name: vllm dialect: openai base_url: http://vllm.inference.svc.cluster.local:8000 api_key: ${secret:VLLM_API_KEY} models: ["llama-*", "qwen-*"]Set these fields:
nameidentifies the provider in routes, rules, budgets, logs, and metrics. It is required when you do not use a preset.dialectnames the protocol the endpoint speaks,openaioranthropic. It decides whether a request is forwarded byte-for-byte (the client spoke the same dialect) or translated on the way (it did not). A server that serves/v1/chat/completionsisopenai. One that serves/v1/messagesisanthropic. There is no third value, and no way to declare one from config. A dialect ships with a translator, a probe, and a coverage fixture.base_urlis the root the request path is appended to. Any absolute URL, includinghttp. Catalog endpoints must usehttps. Your deployment endpoint does not have to.api_key(orcredential) is sent upstream in the header the dialect expects, in place of the caller’s own credential. It is required wheneverauthis set even if the server ignores it. Without one, the gateway would forward the caller’s credential upstream. If you omitauth, omit this field to forward the caller’s credential unchanged.modelsgates what routes here, exact names or trailing-*prefixes. The gateway also uses this list forGET /v1/models.
Send a request and watch it arrive:
$ curl -s localhost:8484/v1/chat/completions \ -H "Authorization: Bearer $VIRTUAL_KEY" \ -d '{"model":"llama-3.1-8b","messages":[{"role":"user","content":"hi"}]}'Check GET /admin/v1/backends to inspect the resolved URL and
credential. Custom providers have one native channel named default.
Requests report it as pistra.channel.
What a custom provider is, to the router
Section titled “What a custom provider is, to the router”A preset includes catalog facts such as endpoint quirks and channel claims. A custom provider has one native channel in its declared dialect.
The gateway translates requests from the other dialect. Apply
on_fidelity_loss and require_caps as you would for any route. A
custom provider cannot declare a provider_compat channel. Add an
overlay when you need to publish
that claim with a source and verification date.
Preset with an override, or custom?
Section titled “Preset with an override, or custom?”Both point a known provider somewhere else. They keep different things.
| you want | write |
|---|---|
| OpenAI through a corporate proxy, Anthropic via a VPC endpoint, Bedrock in a region | preset: plus base_url:, the dialect, quirks and channel claims stay |
| the same provider twice, under two names or two keys | name: plus preset: twice, an unnamed provider is addressed by its preset, so the second needs a name |
| an endpoint that speaks the dialect but is not that provider | name:, dialect:, base_url:, no preset |
| a fleet of identical servers you reach directly | pool: instead of base_url:, see schedule a pool |
The line is whether the catalog’s facts about the provider are true of
your endpoint. A proxy in front of api.openai.com still strips the
fields OpenAI rejects. A vLLM serving the same paths does not want
them stripped. dialect cannot be set alongside preset for the same
reason. It is a fact the preset owns, not a default it suggests.
Three things that bite
Section titled “Three things that bite”- A server that rejects unknown fields. pistra adds
stream_options.include_usageto streamed OpenAI-dialect requests so usage can be metered, and removes the chunk it produces. A server that returns 400 on a field it does not know needsstream_usage: false, and its streamed requests then settle against the reservation estimate. - A path prefix the server does not serve. The incoming path is
appended to
base_urlas it is. A server that serves/chat/completionswithout the/v1has no config-side fix. It needs an overlay entry withstrip_path_prefix, or abase_urlwhose server adds the prefix back. regionwithout a preset. It fills a placeholder only a region-parameterized preset has. On a custom provider it is refused unless the credential isaws, where it is the SigV4 signing region.
From the console or the API
Section titled “From the console or the API”In the console, New provider offers Preset and Custom as peers: a preset from the deployed catalog, or a name, a dialect and a URL. Either way the object lands in the source you chose and is validated as the whole deployment on write.
Through the API it is one object write, naming the source only because the provider does not exist yet:
$ curl -s -X PUT 'localhost:8485/admin/v1/config/providers/vllm?source=team-a' \ -H "Authorization: Bearer $ADMIN" -H 'If-None-Match: *' \ -H 'Content-Type: application/yaml' \ --data-binary $'name: vllm\ndialect: openai\nbase_url: http://vllm:8000\napi_key: ${secret:VLLM_API_KEY}\nmodels: ["llama-*"]\n'See manage the configuration through the API for the precondition and what a refused write looks like.
When to promote it
Section titled “When to promote it”A custom provider is a fact about your deployment. When it is a fact
about the world, move it to an
overlay. That covers a public
provider with a stable endpoint, a documented compat surface, or
quirks other deployments would hit. In an overlay it gains
provenance, a validator, and a place in /admin/v1/catalog/report.
Nothing changes in the providers: entry except that it now says
preset: instead of dialect: and base_url:.
Related
Section titled “Related”- Passthrough, what “byte-for-byte” means when the dialects match.
- Channels and fidelity, why a custom provider has one channel and a preset may have two.
- Configuration reference,
every field on
providers[].