Skip to Content
Konduit docs

Routing and sovereignty

How `model` resolves to a deployment, and the `provider` policy that decides which deployments may serve a request at all.

konduit does not have one upstream. Every request is routed, per request, from konduit's own catalog: model says what you want, the optional provider object says where it may run, and price decides the rest.

How model resolves

konduit's catalog distinguishes a model (a set of weights) from a deployment (one operator serving those weights, in one variant, at one price). GET /v1/models lists deployments, and their ids look like provider/model or provider/model:variant.

Your model string is read most-specific-first:

You sendkonduit tries
scaleway/gpt-oss-120b — an id from /v1/modelsexactly that deployment
provider/model, for a model that has variantsevery deployment of that model from that provider, whatever the variant
model:variantevery provider's deployment of that model in that variant
gpt-oss-120bevery deployment of that model, from every provider (Scaleway and STACKIT)

An exact deployment id always wins. If you send back a string /v1/models published, it names one deployment and never a set that happens to contain it — that is what pinning is.

A slash is only a provider when it names one

The prefix before the first / is read as a provider only if konduit's catalog knows a provider by that name. Model ids that contain a slash — meta/llama-3 and friends — therefore keep working as model ids. The consequence, stated rather than hidden: if konduit ever onboards an operator called meta, that string starts meaning "the model llama-3, from meta". A deployment id from /v1/models is immune to this, which is the reason to prefer one when the answer has to be reproducible.

Deployments marked deprecated still serve. It means "do not start using this", not "stop working today" — a pinned deployment that stopped the moment it was marked would be an outage rather than a deprecation.

The provider policy

A single optional object next to model and messages:

{
  "model": "mistral-small-3.2",
  "messages": [{ "role": "user", "content": "…" }],
  "provider": {
    "require": ["iso27001"],
    "countries": ["DE", "FR"],
    "zero_retention": true,
    "order": ["scaleway", "ovhcloud"]
  }
}

It never reaches a provider. konduit reads it, removes it from the body, and forwards the rest — an operator seeing konduit's routing vocabulary would at best reject the request and at worst try to interpret it.

Why a body field and not a header

Because every OpenAI client library has a way to put an unknown field in a request body — extra_body in openai-python, a plain struct field in Go — and very few make it easy to add a header to a single call. A header would also be dropped by any proxy that normalises them, and this object decides which country a prompt is processed in.

completion = client.chat.completions.create(
    model="mistral-small-3.2",
    messages=[{"role": "user", "content": "Say hello in one word."}],
    extra_body={
        "provider": {
            "countries": ["DE", "FR"],
            "zero_retention": True,
        }
    },
)

The four fields

Three are filters and one is a preference. That boundary is what makes the whole thing predictable: a filter decides whether a deployment may serve the request at all, a preference only decides which of the survivors goes first. A preference can never widen what a filter narrowed.

require — filter

An array of certification types the serving operator must hold. All of them, not any: asking for two attestations means asking for an operator that has both. Matched case-insensitively against the type values published in /v1/models → sovereignty.certifications, each of which carries a link to its evidence.

{ "require": ["iso27001", "c5"] }

countries — filter

An array of ISO 3166-1 alpha-2 codes. Any of them is enough. Matched against the deployment's effective hosting country, so a deployment that overrides its operator's default is judged on its own value.

{ "countries": ["DE", "FR", "NL"] }

zero_retention — filter

true requires an operator that stores neither prompt nor completion.

false and absent mean the same thing: no constraint. There is deliberately no reading of zero_retention: false as "only operators that do retain", because nobody has ever wanted that.

order — preference

Provider ids in the order you would like them tried. A provider you do not name is not excluded; it simply sorts after every provider you did name. Within one rank the price rule still applies, so {"order": ["scaleway"]} means "Scaleway first, cheapest Scaleway deployment first", not an arbitrary pick.

What happens to the survivors

Everything the filters allowed is sorted cheapest first — the sum of the input and output price per million tokens, because konduit cannot know the shape of a completion before it exists and weighting the two would be a guess. Ties are broken by deployment id, so the same catalog produces the same decision every time.

konduit then tries them in that order. A candidate that fails before konduit has committed to an answer is replaced by the next one; you see one status and one body, and the Konduit-Provider header tells you who produced them. On a stream, that boundary is exact: it is the first flushed byte, after which a failure can only be reported inside the stream.

An empty array is not an empty filter set

{"countries": []} states no constraint, the same as omitting the field. Entries are trimmed and blanks dropped, so ["DE", ""] is the same policy as ["DE"] — an entry nobody meant cannot make a request unroutable.

An unknown field is an error

The rest of a request body travels to the provider unread: konduit forwards a sampling parameter it has never heard of, because that is the provider's business. provider is konduit's own field, and it fails closed instead.

{
  "error": {
    "message": "provider contains a field konduit does not recognise: allowed fields are require, countries, zero_retention and order",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_policy"
  }
}

The failure modes are not comparable. A typo in countries that konduit ignored would be a sovereignty filter that silently does not filter, and you would never learn that your prompt left the country you asked it to stay in.

When nothing is left

Two different refusals, both 404, and they have different fixes:

codeMeaningFix
model_not_foundkonduit's catalog knows no deployment under that name at all, or your API key is restricted to models that do not include it.Change the model, or the key's model list.
no_deployment_matches_policyThe model exists and konduit could serve it — your own provider policy excluded every deployment of it.Relax the policy.

A third case is konduit's own fault and answers 503 no_provider_configured: the catalog lists deployments for the model, and this gateway has no adapter built for any of the operators serving them. Retrying is the right thing to do.

What konduit changes in your request

Exactly four things, and they are all consequences of the above:

  1. provider is removed.
  2. model is replaced by the chosen operator's own name for the deployment — Scaleway has never heard of the string scaleway/mistral-small-3.2.
  3. On a streaming request, stream_options.include_usage is set to true. See Streaming for why, and for what you receive.
  4. For the few deployments whose chat template accepts only nine-character alphanumeric tool-call ids, every tool_calls[].id and tool_call_id in messages that is not already one is replaced by one — the same for a call and its result, so the pair stays linked. Without it such a deployment refuses any conversation that carries the call_… ids OpenAI-style clients send. Responses are not changed: the ids a provider returns already qualify.

Everything else is forwarded as the bytes it arrived as. A rewritten body may differ from yours in key order and whitespace and in nothing else. Because the first two and the fourth happen per candidate, a fallback re-renders the body for the operator it is now going to.

On this page