skip to content

When a model gateway's target provider lacks a requested parameter or feature, should the gateway drop it, reject the call, or emulate it?

level: middleimportance: must knowfreq 50%

answer

  1. decide per field, not globally
  2. what does the caller lose?
  3. capability table before the call
  4. adjustments listed on the response
  5. strict mode turns drops into errors

basics

~20 s

Decide per field by what ignoring it costs: reject anything that changes the output's meaning or shape, emulate only what the gateway can reproduce exactly, drop only harmless hints, and report every drop or emulation on the response.

solid answer

~50 s

No single policy fits every field. Silent dropping is the worst default: a caller who set a seed believes output is repeatable, and one who set a stop sequence believes output ends there. Rejection, with an error naming the field, the resolved target model and what is supported, is the safe default for anything that changes what comes back, such as tool definitions, a required tool choice or an output format; the gateway should raise it from its own capability table before the call, so it reads the same whichever provider sits behind an alias. Emulation fits where the gateway can reproduce the feature exactly, such as stop sequences by truncating and cancelling upstream. Harmless hints may be dropped. Every drop or emulation is listed on the response, and a strict flag per route turns drops into rejections.

go deeper

for a junior

Recall the three behaviours, drop, reject and emulate, and why silent dropping is the dangerous default.

for a middle

Explain the per-field test, give a field that suits each behaviour, and show how stop sequences are emulated by truncating and cancelling upstream.

for a senior

Show how a capability table, a pre-flight rejection and an adjustments list on every response keep behaviour visible, especially after an alias is repointed.

for a principal

Weigh strictness against convenience: which routes run strict, who owns the capability table, and how much emulation the platform is willing to support and pay for.

## The problem A **shared model gateway** accepts one request shape and translates it for each provider behind it. Providers do not support the same features: one accepts a **seed** for repeatable sampling and another has none, one supports **stop sequences** and another does not, one can return several alternative completions in one call and another returns exactly one. Whenever a request names something the resolved target cannot do, the gateway must pick a behaviour. Picking one behaviour for every field, usually by accident, is how teams get surprised. ## The three behaviours | behaviour | what happens | caller's risk | good fit | |---|---|---|---| | **drop** | field removed, call proceeds | believes the feature applied | hints whose absence leaves output valid | | **reject** | gateway returns a client error naming the field | must change the request or the target | anything changing the output's meaning or shape | | **emulate** | gateway reproduces the feature itself | may be inexact or cost more | features it can reproduce exactly and cheaply | **Dropping silently** is the behaviour many gateways drift into because the call "works". It is the most dangerous one: the failure surfaces later, far from its cause, as non-repeatable output or an answer that ran past where it should have stopped. **Rejecting** is the safe default for features that change what comes back and that the gateway cannot reproduce: tool definitions, a required tool choice, a structured output format. A good rejection: - names the field, the **resolved target model** and the supported alternative; - comes from the gateway's own **capability table** before the call goes out, not from relaying the provider's error afterwards, so the same mistake reads the same whichever provider is behind the alias (some providers also ignore unknown fields without any error, which makes relying on their errors worse); - uses one stable error code that callers can branch on. **Emulating** fits when the gateway can reproduce the semantics: - **Stop sequences**: scan the outgoing text, truncate at the match and **cancel the upstream generation** so no further tokens are paid for. Hold back a few characters at each chunk boundary, because a stop string can straddle two deltas. - **Several choices per request**: fan out separate calls. The result is equivalent, but cost and rate-limit use multiply, and the caller should be told. - **An output format imitated through prompt instructions** plus a validation step is *not* exact. Making structured output dependable is its own subject; a gateway that does this must label it best-effort, never present it as the native feature. ## Deciding per field Put the policy in the capability table, one row per field per target model, and decide it with a short test: 1. **What does the caller lose if the field is ignored?** If the answer is correctness or the shape of the output, reject. 2. **Is it a preference?** An end-user identifier passed for provider-side abuse tracking or a latency-priority hint the provider has no tier for can be dropped, with a note. 3. **Can the gateway reproduce it exactly?** Then emulate, with a note and its cost. 4. **Let routes tighten the policy.** A **strict** flag per route or per request turns every drop into a rejection for teams that need certainty, such as an evaluation harness. The capability table is itself a maintenance burden: providers add and retire features, so it needs an owner, a test per row, and a review whenever a new model is added behind any alias. ## How the caller finds out Every response should carry an **adjustments** list naming each field dropped or emulated and why, and the gateway should count adjustments per route as a metric. That list matters most after an alias is **repointed**: a field honoured yesterday can be dropped today because the new target lacks it, and the adjustments list is how a team notices without reading the gateway's config. ```json { "gateway": { "resolved_model": "provider-b-small-v4", "adjustments": [ {"field": "sampling.seed", "action": "dropped", "reason": "unsupported by target"}, {"field": "stop", "action": "emulated", "reason": "truncated and cancelled at gateway"} ] } } ``` (Field names here are illustrative, not any product's.) ## What is not decided here Which sampling controls a given endpoint accepts, and how a product changes its sampling when one is refused, is a question about decoding controls. The general shape of an adapter that cannot fully satisfy the interface it implements is a design-pattern question. Here the subject is the gateway's policy across many providers, and how it tells each caller what it actually did.

  • Why raise the rejection from the gateway's capability table instead of relaying the provider's error?
    Providers disagree: some return a client error with their own wording, some ignore unknown fields without any error. Relaying them makes the same mistake look different on each provider and invisible on some. A pre-flight check gives one error code and message naming the field and resolved target, and it avoids paying for a call that was never going to honour the request.
  • When is emulating several choices per request by fanning out separate calls a bad idea?
    When cost or rate limits are tight, because the fan-out multiplies tokens and request counts by the number of choices, and when the caller relied on one call's latency, since the gateway must wait for the slowest. It is semantically sound, as each call samples independently, but the caller must see the adjustment and its cost.

A travel adapter that cannot supply an earth pin should refuse to fit, not let you plug in a heater that needs one; a plain phone charger may fit fine without it.

  • Silently dropping unsupported fields is safest because the call still succeeds.
  • Relaying each provider's own error is enough; the gateway needs no capability table.
  • Emulation always beats rejection because callers get what they asked for.
  • One global drop-or-reject policy for every field is good enough.
  • Prompting the model to emit a format emulates a native structured-output mode exactly.