Contents
  1. Request management
    1. Gateways and routing decisions
    2. Origins of mediation and selection
  2. Contracts and eligibility
    1. The gateway interface
    2. Compatible destinations
    3. Authority and information recipients
  3. Admission and selection
    1. Admission and shared allowances
    2. Choosing an eligible endpoint
    3. Suitability by task
    4. Predicting model suitability
  4. Additional attempts
    1. Escalation after an answer
    2. Recovery by failure cause
    3. Bounded retries and recovery probes
      1. Circuit states
  5. Delivery and continuity
    1. Partial output and commitment
    2. State that binds a route
  6. Accounting and evidence
    1. One request, several attempts
    2. Explaining the actual route
  7. Verification and change
    1. Testing the enforced contract
    2. Evaluating routing usefulness
    3. Maintaining a valid policy
  8. Check understanding
  9. Open questions
  10. Selected talks
  11. References
  12. Talk library
← All topics

Model Routing and LLM Gateways

Model routing chooses which model and provider should handle a request. It lets an application match models to tasks and change destinations when capacity or availability changes. An LLM gateway provides the shared interface through which those requests pass. The choice must respect required behavior, permission to receive the information, and remaining time and spending limits. Routing is useful when it improves task results, cost, or responsiveness within those constraints—not simply when it adds more destinations.

Request management

Gateways and routing decisions

A large language model generates responses from supplied input. A provider operates an endpoint that serves a model. An LLM gateway mediates the application’s requests to those endpoints; a router chooses a destination. One service can implement both responsibilities, but forwarding a request does not imply that it predicts which model will answer well.

The distinction becomes practical when something changes. Initial selection chooses before generation. Quality escalation invokes another model after assessing an inadequate answer. Operational fallback changes destination because an attempt failed or could not proceed. A request policy specifies which of these actions are permitted and under what conditions. Each additional attempt must preserve the caller’s requirements.

Mediation and destination choice

Example

The request’s data path and the router’s control decision are separate.

One possible decomposition: the gateway checks the request, routing supplies a destination decision, and dispatch forwards data to the selected endpoint. The branches represent alternatives, not two simultaneous calls.
Read the diagram as text
  • Application.
  • Gateway enforcement. Checks request requirements and authority.
  • Routing decision. Chooses within the eligible set.
  • Gateway dispatch.
  • Model A / provider X.
  • Model B / provider Y.
  • ApplicationGateway enforcement: Data: request.
  • Gateway enforcementRouting decision: Control: eligible choices.
  • Gateway enforcementGateway dispatch: Data: admitted request.
  • Routing decisionGateway dispatch: Control: selected destination.
  • Gateway dispatchModel A / provider X: Data: if A selected.
  • Gateway dispatchModel B / provider Y: Data: if B selected.

Central mediation can keep provider secrets outside the application’s agent environment. In What if the network was the sandbox?, Aperture supplies provider credentials while identifying the calling workload through its network identity. This simplifies shared control, but introduces another request-path dependency and concentrates sensitive credentials in the proxy. Its availability and custody controls therefore matter alongside those of the providers.

The gateway owns the request-management boundary. Inference Engineering explains execution inside a serving system; AI Platform Engineering covers the broader shared services and their ownership. Here, the central obligation is narrower: determine where this request may go and preserve its contract throughout the resulting work.

Origins of mediation and selection

Request mediation predates model APIs. The January 1997 HTTP/1.1 specification distinguished a proxy acting on behalf of clients from a gateway receiving requests as though it were the origin server and mediating access to another server. Forwarding and representation translation were already established intermediary responsibilities. This is historical terminology, not an invention date or the current HTTP specification.

Managed API services brought common operational controls into that boundary. AWS’s July 9, 2015 announcement of Amazon API Gateway combined traffic management, authorization, monitoring, and API version management in front of backend applications. Those responsibilities remain useful when the backend generates language, even though successful delivery no longer establishes a useful answer.

A parallel problem concerned choosing the right algorithm for an individual input. SATzilla’s June 2008 paper described selecting solvers for Boolean satisfiability: deciding whether Boolean constraints can all hold. It learned performance predictions from representative problems and candidate solvers. Computing input features itself cost time, so the system included short preliminary runs and a backup when feature computation timed out. Selection had both overhead and a failure path.

LLM selection added a consequential choice about when to gather evidence. FrugalGPT, submitted in May 2023, assessed generated answers before continuing through a model cascade. RouteLLM’s 2024 work selected from the query before generating an answer. The former purchases answer-specific evidence; the latter tries to avoid unnecessary generation. These approaches address complementary problems rather than marking a universal replacement of one method by another.

Contracts and eligibility

The gateway interface

A gateway interface should express what the caller needs independently of the provider’s field names. An adapter is translation code between those representations. A model alias names a logical service whose deployment can change; it does not identify the endpoint that actually served a request. Keep required behavior separate from preferences that the router may trade away.

The following is a proposed application contract, not a universal gateway API.
Contract areaWhat to specify or preserve
Task and generationMessages, media, generation options, and required output behavior.
Destination choiceRequested model or alias, required features, preferences, and explicit substitution permission.
Identity and authorityRequest identifier and server-derived caller, tenant, and policy context; never trust a payload’s claim of privilege.
TimeAn overall deadline: the point after which the caller stops waiting.
Delivery and resultContent or events, completion state, served identity, usage evidence, and actionable failure details.

A familiar request shape can hide lost guarantees. Claude’s documented OpenAI SDK compatibility layer ignores response_format and strict function-calling settings: requests to constrain the answer’s format or tool arguments do not enforce those constraints through this layer. It also combines system/developer messages at the start. An adapter must reject unsupported requirements or offer an explicitly agreed alternative.

Keep refusal, incomplete generation, and invalid output distinct. Claude, for example, distinguishes natural completion from reaching an output cap or exhausting context capacity, including within successful API responses. A complete response can still fail application validation. Recognize a complete response develops these acceptance boundaries.

Compatible destinations

Provider capability means support for an operation and its relevant semantics. Eligibility requires all mandatory capabilities in the same endpoint configuration. Record the model, provider, endpoint, version, region, and configuration being assessed, together with the evidence date. A model’s general ability cannot compensate for a serving interface that drops required input or ignores an output constraint.

These documented limitations apply specifically to Claude’s OpenAI compatibility layer. They do not describe its native API.
Required behaviorCompatibility-layer behaviorEligibility consequence
Audio input preservedAudio input strippedNot eligible for this requirement
response_format enforcedField ignoredNot eligible for this guarantee
Other feature combinationsNot established by these entriesRequire separate evidence

Capacity is another hard constraint. Tokens are the units a model processes and generates, not necessarily words. The context window bounds a complete invocation: input and generated output, including applicable reasoning tokens, share capacity. Reserve output space and respect separate output limits before accepting input. Counting complete requests explains the accounting. Quietly truncating input to fit a replacement can change the task.

A schema describes permitted machine-readable values; a tool request is generated data proposing an operation. Neither term guarantees that every endpoint supports the same schema subset or tool behavior; see Data, requests and effects. OpenRouter’s require_parameters setting filters for supplied-parameter support, whereas default routing can permit unsupported parameters to be ignored. Advertised support should lead to contract tests, especially after endpoint or adapter changes.

Authority and information recipients

Authentication establishes identity; authorization determines permitted access. A tenant is an independently authorized customer or organizational partition. Derive that scope from trusted application state. A caller’s model preference, generated routing instruction, or possession of a gateway credential must not grant arbitrary upstream access. Attach provider credentials only after validating the destination and the caller’s permission.

Aperture obtains identity through a tailnet, Tailscale’s identity-bearing private network, rather than trusting a request field. It resolves the requested model to a configured provider and injects authentication headers. A shared external-access bridge represents its callers under the bridge’s identity, so individual attribution is lost unless another trusted mechanism preserves it.

Every recipient needs approval

Example

Auxiliary selection and assessment can disclose request information too.

This example checks each proposed disclosure separately. Allowed transmissions can reach a selector, generator, or judge; denied transmissions stop before sending. Approval for one recipient does not authorize the others.
Read the diagram as text
  • Proposed payload and recipient. May contain a prompt, answer, or both.
  • Trusted identity and handling policy.
  • Check this disclosure.
  • Selector service.
  • Generator endpoint.
  • Judge service.
  • Deny transmission.
  • Proposed payload and recipientCheck this disclosure: Data: proposed disclosure.
  • Trusted identity and handling policyCheck this disclosure: Control: applicable conditions.
  • Check this disclosureSelector service: Data: allowed selector input.
  • Check this disclosureGenerator endpoint: Data: allowed generation input.
  • Check this disclosureJudge service: Data: allowed assessment input.
  • Check this disclosureDeny transmission: Control: conditions not met.

Effective permission depends on how rules combine. Aperture’s grants are additive: their union supplies access. A narrow grant cannot remove permission supplied by a broad one, and its shipped configuration grants all users access to all models. To revoke access, narrow or remove every grant that supplies that access. Separately, constrain credential scope and lifetime and provide rotation and revocation procedures; Credentials and communication explains the custody boundary.

Permission also concerns information recipients. A selector reading the prompt and a judge reading the answer receive data, just as the generator does. Check approved recipients, processing location, retention, and training use before each disclosure, including fallback. If no destination qualifies, deny the request rather than relax its conditions.

Zero data retention, or ZDR, is a commitment not to retain request and response data after processing, within the service’s stated scope. OpenRouter’s ZDR control tracks policies by endpoint, treats unknown policies conservatively, and excludes enabled plugins and tools. Its interpretation permits implicit in-memory prompt caching. Check these boundaries separately from processing location and training use: approval of an inference endpoint does not cover every recipient. Changed destinations or terms require approval under the changed conditions.

Admission and selection

Admission and shared allowances

Permission to perform work does not establish capacity to start it. Admission decides whether a request starts, waits within a bound, or is rejected. A rate limit bounds consumption over time; a quota allocates an allowance within a stated scope and period; a concurrency limit bounds simultaneous work. Always specify units and reset behavior because provider terminology varies.

One request can encounter application, tenant, credential, model, and provider limits. Claude distinguishes requests, input tokens, and output tokens per minute from monthly spending allowances. Its token bucket replenishes capacity continuously, allowing bursts only within available capacity. Organization limits still apply alongside workspace restrictions. Passing one check does not establish that every other allowance remains available.

For a shared hard allowance, gateway instances need coordinated admission. Independently allowing each instance the full quota multiplies the effective allowance. Envoy distinguishes local limiting from coordinated global limiting and can use local token buckets to absorb bursts before global checks. Request-rate coordination alone does not reserve model tokens or money.

Completed spend also omits work already underway. Consider an allowance of ten units and two simultaneous requests estimated at six units each. Both can pass an unchanged balance check; reserving six atomically for the first leaves only four for the second. LiteLLM documents estimated maximum-cost reservation before execution and replacement with priced consumption afterward. This requires a usable estimate; its documentation identifies routes that cannot be fully priced in advance.

Aperture documents a different contract: applicable quota buckets must have positive balances, then estimated cost is deducted after completion. That is not a strict reservation guarantee for concurrent work. Distinguish the configured behavior from the desired spending bound.

Bound waiting by queue capacity and the remaining deadline, and prevent one tenant from exhausting shared service. If authoritative allowance state is unavailable, define whether affected work must stop; silently assuming unlimited capacity defeats the control. These gateway decisions are separate from the engine scheduling covered in Admission and fair service.

Choosing an eligible endpoint

Model selection chooses behavior; provider selection chooses where it is served. They can be implemented jointly, but hard constraints still come first. Selection then orders the eligible candidates using the evidence the policy actually has.

StrategyDecision basisWhat it does not establish
Fixed assignmentConfigured destinationSuitability for every task
Priority orderFirst eligible preferenceExclusion of unlisted fallbacks unless configured
Weighted distributionConfigured traffic sharesQuery-specific quality
Least busyOngoing call countsEqual work per call
Latency awareRecent observed latencyFuture latency or answer correctness

LiteLLM groups configured deployments behind aliases. Its latency routing uses an observation window and can distribute traffic within a buffer around the fastest deployment. These are operational placement signals. Keep their age visible, and do not equate two endpoint names with independent capacity: Claude, for example, shares a rate-limit pool across inference_geo values.

Measure the interaction that matters. In Voice In, Visuals Out, a smaller, cheaper model still missed the application’s responsiveness needs; the serving platform mattered too. The comparison was workload-specific, not a lasting provider ranking. AI Cost and Performance Engineering explains how to set and measure those targets.

Suitability by task

Task segmentation groups work whose requirements or observed outcomes differ meaningfully. First choose the routing unit: one request, an entire conversation, or an application-declared step. A conversation-level assignment favors continuity; a step-level policy can distinguish extraction from explanation. Such distinctions are design choices to evaluate, not evidence that one model necessarily excels at either task.

A workload slice is a subset defined by relevant conditions, such as language, input length, schema requirements, domain, or error consequences. These conditions guide testing; none is a universal difficulty score. Prefer task labels supplied by trusted application logic when available. If a classifier infers the label, measure its mistakes separately from the models it selects. Coverage of the intended workload explains how to choose representative cases.

Keep information available before dispatch separate from later outcomes. Input length is available before generation; an answer’s factual error is not. Suitability evidence comes from evaluating completed work under specified conditions. RouterBench compares routing policies on shared tasks. Its learned routers beat a simple mixture based on aggregate model performance on some task collections, but lost to it on others. A router therefore needs evidence for the task slices it will actually handle, not just a favorable overall result.

Lessons from building GenAI based applications emphasizes evaluating replacements inside the application. Record both supported task slices and unmeasured conditions. An empty cell in that evidence is a reason to limit the routing claim, not an invitation to fill it with a leaderboard rank.

Predicting model suitability

An explicit task rule uses a known label to select a model. A learned selector instead predicts a selection-relevant outcome from request features—information describing the input—using examples of model outcomes. It earns its complexity only if it assigns requests better than a fixed choice or a simple rule after its own overhead is included.

RouteLLM estimates from the query how likely the stronger model’s answer is to be preferred to the weaker model’s. It selects the stronger model when that estimate exceeds a threshold, before seeing either answer. Lowering the threshold sends more requests to the stronger model. The useful tradeoff depends on which requests change destination and how their answers perform, not just the traffic shares.

Selection before generation

Example

A predictive selector uses request information; no candidate answer exists yet.

Illustrative policy: supported inputs receive a score and threshold decision between eligible models. Inputs outside the validated scope use a separately defined conservative route or abstention.
Read the diagram as text
  • Request features.
  • Validated input scope.
  • Selection score s. Higher scores favor model A; threshold t is chosen during development.
  • Eligible model A.
  • Eligible model B.
  • Conservative route or abstain. Defined separately; not an automatic unfamiliar-input guarantee.
  • Request featuresValidated input scope: Inspect available information.
  • Validated input scopeSelection score s: Within validated scope.
  • Validated input scopeConservative route or abstain: Outside validated scope.
  • Selection score sEligible model A: s ≥ t.
  • Selection score sEligible model B: s < t.

Preference probability and task-correctness probability describe different events. Calibration asks whether a claimed probability matches observed frequencies for its specified event. A useful ranking score need not be calibrated, and calibration on familiar inputs need not transfer to changed conditions. What confidence predicts explains the distinction.

Define behavior outside the selector’s validated scope. An application can use a conservative fixed assignment or decline unsupported work, but must test how that scope is recognized. SATzilla’s backup for failed feature computation illustrates the older principle: the selection mechanism itself needs a bounded cost and failure path.

Additional attempts

Escalation after an answer

An escalation cascade first generates an answer, then assesses whether to accept it or ask another model to try. Unlike selection before generation, this decision can use the answer itself, but it incurs the cost of both generation and checking. FrugalGPT scores each query-answer pair and stops when the score exceeds that stage’s acceptance threshold; otherwise it continues to another model. Its average API-cost constraint is not a per-request spending ceiling.

The checker introduces its own mistakes. False acceptance lets an inadequate answer through. Unnecessary escalation spends more on an answer that was already acceptable. A structural validator may miss factual errors; a model judge adds another inference call and can misclassify the result. In selective image processing, unnecessary intervention can even degrade an already good image. Additional computation needs a task-specific reason.

An answer can justify another attempt

Example

Escalation depends on an existing answer and can still end without acceptance.

A two-stage application design. Assessment may accept either answer. Continuing requires an eligible destination and remaining resources; otherwise the cascade abstains.
Read the diagram as text
  • First generation.
  • Assess first answer.
  • Accept answer.
  • Check continuation conditions. Capability, permission, disclosure, time, spend, and attempt allowance.
  • Second generation.
  • Assess second answer.
  • Abstain.
  • First generationAssess first answer: Completed answer.
  • Assess first answerAccept answer: Acceptance criteria met.
  • Assess first answerCheck continuation conditions: Acceptance criteria unmet.
  • Check continuation conditionsSecond generation: Continuation permitted.
  • Check continuation conditionsAbstain: Continuation blocked.
  • Second generationAssess second answer: Completed answer.
  • Assess second answerAccept answer: Acceptance criteria met.
  • Assess second answerAbstain: Criteria unmet; stages exhausted.

Choose the next model for the unmet requirement, not simply for greater size. Decide whether it receives only the original task or also the first answer and feedback; these are different inputs and need separate evaluation. Every stage must satisfy capability, recipient, authority, remaining-time, and spending conditions. Bound the number of attempts. If continuation is impossible or no answer passes assessment, the cascade must be able to abstain: stop without presenting an answer as accepted.

Later stages receive a selected population: cases rejected earlier. Measure the checker and subsequent model on that population, not only on all requests. Coverage is the fraction accepted; selective risk is error among accepted results. Report both, with the treatment of deferred work, as described in Deferral, risk and review capacity. Broader verification and search belong in Reasoning and Test-Time Compute.

Recovery by failure cause

A retry is another attempt. Operational fallback switches to an approved alternative because an attempt failed or could not proceed. These decisions need the cause, not merely a generic failure flag. LiteLLM, for example, documents fallback to another model group after configured retries; that mechanism alone does not establish that the replacement preserves the application contract.

Use provider-specific error details to apply this cause-based recovery policy.
CauseAppropriate next decision
Temporary throttlingHonor retry hints; retry within remaining limits or select another eligible destination.
Exhausted allowanceStop or use independently available, authorized capacity; immediate retries do not replenish it.
Authentication or permission failureRepair or reauthorize access; do not repeatedly replay invalid credentials.
Unsupported or oversized requestReject or explicitly revise the contract; do not silently remove requirements.
Overload or transient service failureConsider bounded retry or eligible fallback.
Timeout or malformed deliveryPreserve known delivery and unknown upstream outcome before deciding whether another attempt is safe.

Even one status code can hide different causes. Claude documents 429 for temporary rate limiting and for exhausted monthly allowance; the latter lacks a retry-after hint. Refusal and inadequate content require separate interpretation. Switching providers must not become a way to evade the request’s authorization or handling policy.

Runtime routing controls can change future destination choices without an emergency deployment, as Agents Need Feature Flags describes. A changed flag is not evidence that an executing request stopped. When no permitted recovery remains, return the specific exhaustion or failure state.

Bounded retries and recovery probes

Retries consume capacity precisely when a dependency may be struggling. Independent retry layers multiply attempts: Amazon’s five-layer example with three attempts per layer produces 243 downstream attempts. Coordinate ownership across application, gateway, and client library. Use bounded attempts, capped exponential backoff—progressively longer waits—and jitter, which varies those waits to avoid synchronized retries.

A timeout is an allowed duration; a deadline is when waiting ends. Earlier attempts and backoff consume part of that allowance, so pass only the remaining time downstream. gRPC, a remote procedure call framework, documents this propagation principle. An HTTP gateway must implement it through its own adapters. When the deadline expires, notifying downstream code of cancellation is only part of stopping: that code must also stop any work it started.

Retries consume one time allowance

Example timings

Waiting reduces the time available for the next attempt.

Request allowance06 secondsDuration 6 seconds
First attempt02 secondsDuration 2 secondsWithin Request allowance
Backoff wait23 secondsDuration 1 secondsWithin Request allowance
Second attempt36 secondsDuration 3 secondsWithin Request allowance
Within a six-second allowance, the first attempt and backoff leave three seconds for the next attempt. Children describe contained intervals, not extra elapsed time: do not add the parent to its children or sum overlapping spans.
Read the diagram as text
  • Request allowance. Deadline at six seconds. 0 to 6 seconds; duration 6 seconds.
  • First attempt. 0 to 2 seconds; duration 2 seconds. Parent: Request allowance.
  • Backoff wait. 2 to 3 seconds; duration 1 seconds. Parent: Request allowance.
  • Second attempt. Must finish or stop waiting by the original deadline. 3 to 6 seconds; duration 3 seconds. Parent: Request allowance.

Circuit states

A circuit breaker temporarily suppresses calls to a repeatedly failing dependency.
StateAllowed behaviorTransition
ClosedNormal calls proceedFailure threshold reached → open
OpenCalls fail immediatelyWaiting interval expires → half-open
Half-openLimited recovery probesSuccessful probes → closed; failure → open

A breaker limits exposure; it neither repairs the dependency nor authorizes a fallback. Probe limits protect a recovering service. Recovery modes also need tests: Amazon cautions that breakers can complicate operation and delay recovery. Keep overall attempt and deadline limits even when a breaker changes state. Cancellation and state release explains why requesting a stop is separate from reclaiming execution resources.

Delivery and continuity

Partial output and commitment

Streaming delivers output incrementally, often through server-sent events: messages carried over a continuing HTTP response. Upstream generation, gateway receipt, caller-visible content, and confirmed completion are separate boundaries. From tokens to a stream explains the delivery mechanics. Buffering content before release preserves an opportunity to assess or replace it, but delays the caller’s first useful output.

Response commitment is the protocol or application boundary after which recovery cannot remain invisible. gRPC stops transparent retries after response headers arrive. A gateway application may additionally care about the first visible content. These are different boundaries. Once a prefix is visible, appending another model’s replacement as though it were the same answer violates the delivery contract.

Visible output survives interruption

Example

Stopping delivery cannot erase the prefix already received.

1 / 3 · Gateway receipt

Content has arrived at the gateway but has not been exposed to the caller.

The same request acquires a visible prefix, then incomplete delivery and an unconfirmed upstream outcome. A cancellation request does not establish that generation stopped.
Read the diagram as text
  • Request R.
  • Gateway.
  • Caller.
  • Gateway received a prefix.
  • Prefix delivered.
  • Delivery incomplete.
  • Cancellation requested.
  • Upstream completion unconfirmed.
  • Request RGateway: Request data.
  • GatewayGateway received a prefix: Receipt recorded.
  • Gateway received a prefixPrefix delivered: Content released.
  • Prefix deliveredCaller: Caller has prefix.
  • Request RDelivery incomplete: Delivery status.
  • Request RCancellation requested: Control action recorded.
  • Request RUpstream completion unconfirmed: Upstream evidence status.
  1. Gateway receipt. Content has arrived at the gateway but has not been exposed to the caller. Active: Request R, Gateway, Caller, Gateway received a prefix. New: Request R, Gateway, Caller, Gateway received a prefix.
  2. Caller delivery. The caller now has a prefix belonging to this response. Active: Request R, Gateway, Caller, Gateway received a prefix, Prefix delivered. New: Prefix delivered.
  3. Interrupted response. The prefix remains delivered. Incomplete delivery and cancellation are recorded separately from upstream completion. Active: Request R, Gateway, Caller, Gateway received a prefix, Prefix delivered, Delivery incomplete, Cancellation requested, Upstream completion unconfirmed. New: Delivery incomplete, Cancellation requested, Upstream completion unconfirmed.

OpenRouter documents ordinary HTTP errors before streaming and terminating error events after streaming has begun, when HTTP status remains 200. Its usage frame is accounting, not another completion. Preserve incomplete delivery and offer an explicit restart only if the application supports one. Cancellation stops processing and billing only for supported provider/streaming combinations.

A disconnect does not establish that upstream work stopped. OpenAI also documents that interrupted streamed Chat Completions may omit the final usage chunk. Missing consumption evidence remains unknown. If generated output proposes a tool operation, remember that a proposal and an executed effect are different records; Data, requests and effects explains that boundary. Cancellation cannot undo completed external effects.

State that binds a route

A later turn may depend on more than messages. An opaque identifier names state held elsewhere; it is not the contents of that state or proof that the caller may access it. Distinguish application-held content from provider-bound references before promising that a replacement endpoint can continue.

StateRouting consequence
Application-held messagesCan be reconstructed for another endpoint only if its input conventions and capacity preserve the task.
Provider file handleResolve within its supported scope or explicitly transfer authorized content; forwarding the identifier does not transfer the file.
Opaque continuation referenceRequire an explicit reconstruction contract; do not assume cross-provider import or portability.
Cache affinityPrefer a destination holding reusable state; do not treat that preference as durable conversation storage.

Claude’s Files API illustrates the access boundary: files are workspace-scoped, so applications must maintain their own user-to-file mapping rather than accept arbitrary file IDs. The API is ineligible for ZDR. A migration therefore needs both content access and handling approval, not just a destination that accepts the same field name.

Session affinity keeps related requests on a compatible destination. Workers AI’s documented affinity header seeks an instance with reusable prefix state while the application still supplies conversation input. Affinity can improve reuse, but binding required state to one destination limits recovery choices. When reconstruction is unavailable, refuse the switch explicitly. Reconstruct the next input covers input reconstruction; Agent Runtimes and Harness Engineering covers persistent execution.

Accounting and evidence

One request, several attempts

A logical request is the caller’s unit of requested work. It can own several separately identified attempts: selector inference, generation, checking, escalation, and recovery. Count the logical request once, but attribute all its work, including failed or cancelled attempts. Otherwise a route that recovers frequently can look inexpensive because only its final answer remains visible.

Keep an attempt ledger that can be joined to the logical request.
RecordPurpose
Request ID, attempt ID, purposeConnect all work without counting the task repeatedly.
Authorized scope and destinationAttribute consumption to the correct caller and allowance.
Reservation or estimateRecord admission assumptions separately from observed consumption.
Reported usage and evidence statusPreserve provider-defined categories and missing reports.
Billing reconciliation referenceConnect later provider totals without replacing attempt history.

Count the request once and retain its work

Example

A failed attempt remains part of the request even after another attempt succeeds.

Illustrative ownership graph. Edges identify attribution, not execution order. Missing usage on one attempt remains explicit alongside the other work.
Read the diagram as text
  • Logical request R.
  • Selector attempt S.
  • Generation attempt G1: failed.
  • Generation attempt G2: completed.
  • Checker attempt C.
  • G1 usage unresolved.
  • Logical request RSelector attempt S: Owns attempt.
  • Logical request RGeneration attempt G1: failed: Owns attempt.
  • Logical request RGeneration attempt G2: completed: Owns attempt.
  • Logical request RChecker attempt C: Owns attempt.
  • Generation attempt G1: failedG1 usage unresolved: Accounting evidence status.

Estimates, provider usage, and billing are different evidence streams. Anthropic’s usage and cost APIs have different category coverage, require pagination, and can report after request completion. They do not supply the application’s task-to-attempt mapping. Preserve unknown usage after interrupted delivery rather than interpreting an absent report as zero.

Categories can overlap: OpenTelemetry’s conventions include cached input within input totals and reasoning output within output totals. Adding those subcategories again double-counts consumption. Settlement should also apply each completion event once and survive a crash between consumption and reconciliation. Those are implementation requirements to verify, not consequences of merely having a budget setting. See Usage and cost attribution and AI Cost and Performance Engineering.

Explaining the actual route

A trace connects execution records. For routing, preserve the relationships between policy evaluation, destination selection, attempted execution, delivery, and later assessment. Identity across boundaries explains the instrumentation mechanics. The gateway’s responsibility is to make its decisions reconstructable, including rejected requests that never reached a provider.

EvidenceWhat it helps establish
Authenticated scope; requirementsWhose request was evaluated and what it required.
Policy and capability versions; exclusionsWhy a candidate was allowed, unsupported, forbidden, or unavailable.
Selection reason; attempt relationshipsWhy execution began or another attempt followed.
Requested, selected, and reported identitiesWhich destination was intended and what execution reported.
Timings; delivery; usage; assessmentSeparate operational completion, resource evidence, and answer quality.

Open Policy Agent, or OPA, evaluates rules against supplied input and returns a policy decision. Its decision logs can connect that decision to a trace, the input, the result, and the policy revision. The gateway must still enforce the result. Masking can remove sensitive fields, while filters and rate limits can drop entire records. Check both enforcement and record coverage before treating the logs as an audit history.

Identity fields also have limits. OpenTelemetry warns that compatible APIs and proxies can make the instrumented provider label differ from the actual provider. Requested model, response model, and server address add evidence, not independent attestation of served weights. Likewise, gateway-visible tool requests in Aperture’s demonstration do not prove execution or success.

Start with decision metadata. Capture sensitive payloads only for a defined diagnostic purpose, with restricted access and retention; never include credentials. Auditability requires sufficient evidence, not unrestricted copies of every prompt and answer.

Verification and change

Testing the enforced contract

An invariant is a property that must survive every permitted transition. Derive tests from those properties rather than waiting for production to encounter each failure. Deterministic policy tests examine decisions; adapter fixtures supply controlled dependency responses; concurrency tests exercise shared state; live checks establish behavior of actual configured endpoints. None substitutes for the others.

Fault injection deliberately supplies failures so tests can observe the resulting transitions.
InvariantExercise and assert
Authority survives reroutingPrimary, checker, escalation, and fallback cannot disclose data to a forbidden destination or attach another tenant’s credentials.
Requirements remain intactReject unsupported options and incompatible handles; do not silently weaken the request.
Shared work stays boundedRace concurrent admissions; inject nested retries and deadline exhaustion; inspect total admitted work.
Delivery is not rewrittenInterrupt after a visible prefix; reject malformed events and duplicate completion handling.
Unknown usage remains explicitDrop usage reports and duplicate settlement notifications; inspect retained accounting state.
Dependency failure preserves policyRemove policy or accounting availability; verify the declared suspension or bounded-staleness behavior.

Test controls have their own interface contracts. LiteLLM supports mock fallback triggers in direct Router tests, but strips corresponding flags from incoming Proxy requests starting with version 1.85.0. Triggering fallback establishes that a branch ran; assertions must still establish what it preserved. Test each guarantee separately develops this separation.

Evaluating routing usefulness

Passing enforcement tests makes a policy eligible for use; it does not show that routing helps. Compare complete policies on shared representative cases: eligible fixed models, simple task rules, predictive selection, and bounded cascades. Specify required outcomes and constraints first. Count selector and checker overhead, retries, and failed attempts alongside the final answer. Baselines, budgets and repeated attempts explains the comparison design.

Retain these dimensions for each policy and consequential task slice.
DimensionReporting boundary
Task qualityAssessed correctness and completeness; missing assessment remains unavailable.
AcceptanceAccepted, refused, deferred, and failed cases out of the same task population.
Additional workSelector/checker calls, retries, and escalation frequency per logical request.
TimeCaller-observed first content, completion, and deadline misses.
ExpenseAll attempt consumption, estimate provenance, and unresolved amounts.

Coverage is accepted cases divided by all cases. With zero-one error, selective risk is wrong accepted answers divided by accepted answers; it is undefined when none are accepted. Lower accepted-case error can accompany more deferral. Report both and inspect the deferred workflow through Deferral, risk and review capacity.

RouterBench’s Zero router mixes models using aggregate cost-quality information without predicting from each query. It is a useful simple baseline. Its cascade experiments used known answer scores with simulated scoring errors, so those results do not establish a deployed checker’s reliability. Evaluate the checker actually used by the application.

Ordinary route logs reveal the selected model’s outcome, not what unselected models would have produced. Authorized paired calls can fill that gap, but send information to additional recipients and consume additional resources. Mirrored execution is real secondary processing, not merely recording a proposed choice.

Finally, protect assessment from threshold tuning. Repeatedly selecting the best development score can select favorable noise. Cawley and Talbot demonstrated this mechanism in model selection: the selection criterion improved while independent performance deteriorated. Use development evidence to choose the policy, then independent evidence to assess the chosen policy.

Maintaining a valid policy

Review routing rules, selector versions, model aliases, adapters, capability evidence, and recipient approvals together. Drift is a change in the conditions those choices were tested for: new tasks can undermine model suitability, while endpoint changes can invalidate compatibility. Production outcomes help identify what needs revision. In Uber’s vision workflow, humans label sampled production data under the original guidelines. Mismatches trigger diagnosis and configuration tuning, and a candidate must pass a benchmark before the new version is registered. This connects observed errors to tested changes rather than promoting every proposed correction.

Distinguish exposure modes. Offline tests exercise retained cases. Decision-only shadowing records a proposed route without invoking it, so it cannot reveal that model’s answer. Shadow execution sends an additional request and therefore requires recipient approval and resource allowance. A canary serves a bounded portion of live traffic with the candidate. Choose exposure according to consequences: rollback cannot retract an answer already delivered.

Recovery must remain authorized

Example

A previously working version is only a recovery candidate until current eligibility is checked.

Proposed changes pass contract and workload checks before bounded exposure. Regression leads to a fresh recovery-eligibility decision: activate a permitted configuration or suspend affected work.
Read the diagram as text
  • Proposed policy version.
  • Contract and workload checks.
  • Approved bounded exposure.
  • Maintain candidate version.
  • Check recovery eligibility now.
  • Activate permitted configuration.
  • Withhold change or suspend work.
  • Proposed policy versionContract and workload checks: Submit version and evidence.
  • Contract and workload checksApproved bounded exposure: Requirements met; exposure approved.
  • Contract and workload checksWithhold change or suspend work: Requirements unmet.
  • Approved bounded exposureMaintain candidate version: Acceptance criteria hold.
  • Approved bounded exposureCheck recovery eligibility now: Regression detected.
  • Maintain candidate versionCheck recovery eligibility now: Later evidence invalidates use.
  • Check recovery eligibility nowActivate permitted configuration: Eligible recovery exists.
  • Check recovery eligibility nowWithhold change or suspend work: No eligible recovery.

A service can remain available while enforcing an outdated policy. OPA distributes policy and associated data in bundles. Updates are eventually consistent, so instances can temporarily use different revisions. With persistence enabled, an instance can restart from its last activated bundle while the bundle server is unavailable. Define how old a policy may be and when the application must fail closed—reject work because current permission cannot be verified. Restoring service with an older configuration must not restore revoked access.

Monitoring needs a named action and an owner who can take it.
Observed changeRequired response
Quality regression in a task slicePause promotion; reassess that slice or restore a currently permitted assignment.
Quota pressure or deadline missesReduce admitted work or adjust eligible placement; preserve hard requirements.
Unexpected destination or missing decision evidenceInvestigate actual routing and capture coverage before trusting aggregate success.
Permission or handling approval withdrawnRemove affected routes; suspend work if no authorized alternative remains.

Agents Need Feature Flags emphasizes runtime controls, change records, and regular shutdown drills. Give temporary rollout flags owners and removal dates; keep emergency controls maintained. Record who changed what and when. Use Make and maintain the decision for ongoing quality evidence, and AI Platform Engineering for responsibility beyond this service.

Open questions

  1. Routing evidence remains incomplete when only selected destinations receive traffic. Additional comparisons cost money and disclose data, while statistical correction cannot recover outcomes for choices never observed. Progress would provide useful policy comparisons with explicit coverage, uncertainty, and bounded additional execution.

  2. Reliable settlement after interrupted work requires more than a usage counter. Missing reports, duplicate notifications, and crashes can separate consumption from recorded completion. Progress would be a versioned, fault-tested contract that preserves unresolved liabilities and prevents both duplicate charging and premature release.

  3. Provider-held state limits interchangeable service. File identifiers, access scope, and retained processing state can bind a request to one endpoint. Progress would require explicit export and reconstruction contracts preserving content, authority, and handling conditions, with refusal when those conditions cannot survive transfer.

  4. A selector or checker can stop being useful when the workload changes. Detecting that change is difficult when trustworthy outcome labels arrive slowly. Progress would connect drift signals to fresh task evidence and conservative operating limits without mistaking a score or a successful response for correctness.

Follow the curated reading path through the speakers and demonstrations behind this entry.

24 min

AI Engineer Europe 2026 · 2026

What if the network was the sandbox?

Remy Guercio

Cited in this entry

A concrete gateway example connecting workload identity, centralized provider credentials, and request inspection. It makes the mediation boundary tangible without establishing quality-aware selection or complete execution visibility.

Watch talk
19 min

AI Engineer World's Fair 2026 · 2026

Agents Need Feature Flags

Sachin Gupta

Cited in this entry

Develops runtime model changes, canaries, kill switches, and the maintenance needed to keep those controls effective. Useful after understanding which request obligations a flag must preserve.

Watch talk

Explore more talks

The rest of the library, beyond the curated path. Cited talks support this entry; reviewed transcripts were processed in full. Metadata candidates have not been reviewed as sources or verified as topic members.

15 matching talks

TalkSpeakerEventYear
Dan Fu, Olive SongAI Engineer World's Fair 20262026
Louis-François Bouchard, Omar Solano, Samridhi VaidAI Engineer World's Fair 20262026
Security Firewall for Agents

Cited in this entry

Ryan DahlAI Engineer World's Fair 20262026
Lovina DmelloAI Engineer World's Fair 20262026
KP Sawhney, Ian BallantyneAI Engineer Europe 20262026
Robert BrennanAI Engineer Code 20252025
Mayank PantAI Engineer Europe 20262026
Merve NoyanAI Engineer Europe 20262026
Allen PikeAI Engineer World's Fair 20262026
Sandipan BhaumikAI Engineer Europe 20262026
Anju KambadurAI Engineer Summit 20252025
Bertrand CharpentierAI Engineer Europe 20262026
Raphael KalandadzeAI Engineer World's Fair 20262026
Mohak SharmaAI Engineer Summit 20252025
Jared JoselowitzAI Engineer World's Fair 20262026

References

Coverage and source review
Processed transcripts
19 processed in full · 4 in the curated path
Automated source review
Passed
Metadata candidates
0 unreviewed; not verified topic membership
Corpus version
1bd8e407b26a07b33815594e1b2db5f41827119a2b3cb6fbf240f9fc571fc767

Automated review checks source support; it is not publication approval.

A synthesis of selected conference talks and technical references. Citations link to the source material; they do not imply that every talk on this subject is included.

  1. How Aperture works

    Aperture obtains caller identity through Tailscale rather than trusting an identity supplied in the request. It extracts the requested model name, looks up its configured provider, forwards the request and injects provider authentication headers. Clients use the proxy as their API endpoint. If multiple people share one external-access bridge, their requests appear under that bridge's identity rather than separate individual identities.

  2. RouteLLM: Learning to Route LLMs with Preference Data

    RouteLLM selects a model from the query before seeing its generated response, unlike post-generation scoring or a sequential cascade. Its binary router predicts a preference outcome and applies a threshold controlling the fraction sent to the stronger model. Evaluation measures routed-answer quality alongside strong-model call share and varies the threshold to expose tradeoffs.

  3. FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance

    FrugalGPT invokes models sequentially and scores each generated answer with its query. A response exceeding that stage's threshold stops the cascade; otherwise another model is called. The learned sequence and thresholds optimize answer quality under an average API-cost constraint. Its HEADLINES case study used GPT-J, J1-L and GPT-4 with a DistilBERT scorer, reporting accuracy of 87.2% versus GPT-4's 85.7%, with aggregate API costs of $6.50 versus $33.10.

  4. LiteLLM: Fallbacks — Provider Failover

    LiteLLM documents fallback to another model group after the configured retries fail. Direct Router tests can deliberately trigger fallback with a mock flag. Starting with Proxy version 1.85.0, the corresponding mock fallback flags are stripped from incoming proxy requests and have no effect, while remaining available to direct Router tests.

  5. The Protection of Information in Computer Systems

    Saltzer and Schroeder describe complete mediation, fail-safe defaults and least privilege: check authority for accesses, deny absent permission, and limit a component’s granted powers. These principles apply during recovery as well as ordinary execution. In an agent loop, tool proposals and retrieved instructions must therefore pass an independently enforced authorization boundary before they can affect protected resources. Model capability does not establish the caller’s authority.

  6. What if the network was the sandbox?

    Aperture holds provider keys outside the agent sandbox and authorizes requests using the caller's tailnet identity.

  7. Security Firewall for Agents

    Proxy-side credential injection keeps production secrets out of the agent, but makes the proxy itself a sensitive credential holder.

  8. RFC 2068: Hypertext Transfer Protocol — HTTP/1.1

    The January 1997 HTTP specification distinguished a proxy, which makes requests on behalf of clients, from a gateway, which receives requests as though it were the origin server and mediates access to another server. These intermediary roles already allowed forwarding and representation translation before modern LLM services.

  9. Introducing Amazon API Gateway

    AWS announced Amazon API Gateway on July 9, 2015 as a managed entry point to backend services, combining traffic management, authorization, monitoring and API version management. The service separated these shared request-management responsibilities from application functionality running in Lambda, EC2 or other web applications.

  10. SATzilla: Portfolio-based Algorithm Selection for SAT

    SATzilla selected a solver for an individual propositional-satisfiability problem using inexpensive instance features and learned predictions of solver performance. Its construction procedure collected representative problems, ran candidate solvers, and fitted performance models. Short preliminary solver runs handled easy instances; a backup solver handled cases where feature computation timed out. Selection therefore had its own computation cost and failure path.

  11. LiteLLM: Router — Load Balancing

    LiteLLM groups deployments behind a caller-facing model alias while retaining deployment-specific model names, endpoints and API versions. Selection options include weighted distribution, least ongoing calls, observed latency and rate-limit-aware routing. Latency routing maintains a configurable observation window and can select within a buffer around the fastest deployment to avoid concentrating traffic on one endpoint. Redis can share usage and cooldown information across deployments.

  12. Claude Platform: OpenAI SDK compatibility

    Anthropic's OpenAI compatibility layer documents semantic differences despite accepting familiar request shapes. Function-calling strictness is ignored, audio input is stripped, response_format is ignored, and system/developer messages are moved and combined into one initial system message. Native Claude interfaces expose capabilities unavailable through this layer. Anthropic describes the compatibility layer primarily as a means to test and compare models.

  13. OpenRouter: Provider Routing

    OpenRouter documents that providers can ignore unsupported request parameters under default routing. Setting require_parameters restricts routing to providers supporting all supplied parameters. Provider ordering alone can still permit fallback to other providers; disabling fallbacks changes that behavior. Separate routing controls restrict providers according to data-collection policy. Provider base names can match multiple endpoint variants or regions.

  14. OWASP Access Control

    Authentication establishes identity; authorization decides which actions that identity may perform on particular resources. A user allowed to initiate a transfer must still be authorized for the source account. Least privilege limits the authority of running code and service accounts, while centralized checks reduce inconsistent enforcement. In an AI application, tool availability and a model-produced argument are therefore insufficient grounds to execute a business operation; the application must apply resource- and action-level policy.

  15. gRPC: Deadlines

    A deadline specifies when the caller stops waiting; a timeout specifies an allowed duration. gRPC can propagate the original deadline to downstream calls by subtracting elapsed time from the remaining timeout. Its published example spends 0.5 seconds of a two-second allowance before giving a downstream operation 1.5 seconds. Cancellation notification does not stop application-created work automatically; the server application must stop that work.

  16. OpenRouter: Streaming

    OpenRouter reports pre-stream failures through ordinary HTTP errors. Once tokens have been sent, HTTP status remains 200 and a mid-stream failure arrives as an SSE error event terminating the stream. Its Chat Completions usage frame repeats the finish reason and must be treated as accounting rather than a second completion. Cancellation stops processing and billing only for supported streaming-provider combinations; unsupported providers and non-streaming requests can continue to completion and remain billable.

  17. OpenTelemetry: Gen AI attribute registry

    OpenTelemetry warns that the provider attribute reflects instrumentation's best knowledge and may differ from the actual model provider when compatible APIs or proxies intervene. Requested model, response model and server address supply additional identifying evidence. Its usage conventions include cached input within input totals and reasoning output within output totals, avoiding double-counting those categories.

  18. Claude Platform: Stop reasons and fallback

    Claude distinguishes natural completion through end_turn from reaching the requested output cap through max_tokens and filling the context window through model_context_window_exceeded. These reasons can accompany successful API responses, so HTTP success does not establish that the answer is complete. During streaming, stop_reason begins as null and is supplied through message_delta.

  19. Conversation state: managing the context window — OpenAI

    The context window limits tokens used in one request, including supplied input and generated output; applicable reasoning tokens also consume capacity. Instructions, conversation history, retrieved material and tool results supplied to that invocation therefore share its input budget. A simple worked design reserves generated-token capacity before allocating remaining space to input, while also respecting the model's separate output limit. For a reasoning model, reserve space for hidden reasoning as well as the visible answer without counting the same output tokens twice. Persisting a conversation does not make its usable context unbounded.

  20. How Aperture grants work

    Aperture evaluates model access against grants matched to the connecting identity. Grants are additive: effective permission is their union, and revocation requires narrowing or removing every grant that supplies the access. Although unmatched requests are denied, the shipped configuration grants all users access to all models. A restrictive additional grant cannot subtract an existing broad permission.

  21. Your LLM Stack Is a 2008 Database With Better Marketing

    Give each account only the permissions it needs and use short-lived credentials.

  22. NIST Privacy Framework 1.0: lifecycle and minimized audit evidence

    The framework inventories data elements, processing purposes, actions, owners and flows. Policies define permitted uses and retention periods; the data lifecycle aligns with system development and operations. Authorizations must be maintained and revocable, access limited by least privilege, and deletion and destruction performed under policy. Audit records themselves must incorporate data minimization. Engineering application: define the decision evidence needed for review, its purpose, authorized readers, retention trigger and disposal method before logging. Retain the necessary decision, model and policy versions and relevant evidence without indiscriminately copying personal data into logs, prompts or backups. Where review requires sensitive evidence, constrain fields, access and retention rather than treating auditability as permission to keep everything. Assess removal and disclosure across downstream copies and service providers.

  23. Saltzer and Schroeder: Basic Principles of Information Protection

    Least privilege limits each program and user to the authority needed for its task, reducing the damage from error or compromise. Complete mediation requires authorization checks for every access, including lifecycle paths such as recovery, and reliable identification of the requester. Cached authorization decisions must account for changed permissions. Fail-safe defaults make access depend on explicit permission. Applied to an agent, these principles require enforcement where a proposed operation actually reaches a protected resource; a model promise or a tool description is not that enforcement.

  24. OpenRouter: Zero Data Retention

    OpenRouter tracks retention policies by endpoint because they can differ from a provider's general policy. A request-level ZDR setting cannot disable enforcement enabled by account or guardrail settings. Unknown policies are treated as retaining and training on data. Its ZDR routing control covers inference endpoints, but excludes enabled plugins and tools, which can have separate recipients and retention policies. OpenRouter permits implicit in-memory prompt caching under its ZDR interpretation.

  25. Claude Platform: Rate limits

    Claude distinguishes monthly spending allowances from rate limits measured in requests, input tokens and output tokens per minute. Its token-bucket mechanism replenishes capacity continuously rather than resetting only at fixed boundaries. Input consumption is initially estimated and adjusted; output rate limiting counts generated tokens in real time rather than reserving max_tokens. Organization limits remain applicable alongside workspace restrictions. Different inference_geo values share the same rate-limit pool.

  26. Google SRE: Handling Overload

    Admission controls and per-customer quotas limit resource consumption so one workload does not exhaust shared capacity. Resource usage can be a better capacity signal than requests per second because requests vary in cost. Graceful degradation reduces work by returning less complete results or using cheaper, potentially stale cached data. Client-side throttling can prevent rejected requests from consuming backend resources. Under extreme overload, even degraded computation may be impossible and explicit errors are necessary.

  27. OWASP LLM10:2025 Unbounded Consumption

    Uncontrolled inference can consume shared capacity or money without crossing a content-policy boundary. Long inputs, repeated requests, and expensive operations can make request count a poor proxy for work. OWASP recommends input limits, per-user quotas, resource management, timeouts, throttling, graceful degradation, and bounds on queued and total actions. For an agent, the engineering implication is to account for the whole task, including generated tokens and downstream calls, and enforce limits before repeated work expands beyond its budget.

  28. Envoy: Global rate limiting

    Envoy distinguishes local limiting from coordinated global limiting. Its global request limiter consults a rate-limit service, with a Redis-backed reference implementation. A separate quota-based design distributes allowances among Envoy instances using periodic load reports. Local token buckets can reject large bursts before requests reach the global limiter, reducing pressure on the coordination service.

  29. LiteLLM: Budgets, Rate Limits

    LiteLLM documents reserving estimated maximum request cost before provider execution, rejecting a reservation that would exceed the budget, and replacing it with priced consumption afterward. Disabling reservation permits concurrent requests to exceed a budget checked only against completed spend. Shared counters use Redis; stale restored counters can understate consumption. Optional fail-closed enforcement checks authoritative database spend and rejects requests when spend cannot be verified. Reservation cannot price some non-token routes or the complete contents of submitted batch files.

  30. Aperture configuration reference

    Aperture supports quota buckets scoped to a user, device or shared pool. Referenced buckets are enforced together: each must have a positive balance before a request proceeds, and estimated cost is deducted from every applicable bucket after completion. Overdraft chains can allocate one request across several buckets, with the final bucket allowed to become negative. Provider configuration separately specifies credentials, API compatibility and routing priority.

  31. Lessons from building GenAI based applications — Juan Peredo

    Evaluate models within the application throughout development and operation; benchmark strength alone does not establish suitability.

  32. Voice In, Visuals Out: The Agony and the Ecstasy

    Model size and price alone do not guarantee responsiveness; the serving platform's latency behavior also matters.

  33. Agents Need Feature Flags

    Make model selection and fallback runtime routing decisions.

  34. NIST AI RMF Playbook: Measure

    Construct validity asks whether an indicator measures the concept it claims to measure; external validity concerns generalization beyond development conditions. NIST calls for documented operating conditions, measurement assumptions, limitations and variance. Evaluations using human-subject data should reflect the population in the context of use. Applied to agent evaluation, define the deployment population and scenario dimensions before sampling, document exclusions, and compare sampled conditions with intended users, tasks and operating environments. A split within an unrepresentative dataset does not establish deployment coverage.

  35. Building Closed-Loop Evals for a Multimodal Agent at Uber Scale

    Treat the enhancement decision as a classifier over structured visual observations, and account for both missed problems and unnecessary edits.

  36. RouterBench: A Benchmark for Multi-LLM Routing System

    RouterBench records model outputs, assessed performance and costs on shared tasks so routing policies can be compared offline. Its Zero router mixes models without query-specific prediction using their aggregate cost-quality frontier. Learned routers exceeded this baseline on some task collections but underperformed on ARC-Challenge and MBPP, showing that usefulness depends on the workload. Cascade experiments used known answer scores with simulated scoring errors rather than a deployed quality checker.

  37. 20 days of compute vs 7 hours: rethinking what state-of-the-art means — Bertrand Charpentier, Pruna AI

    Consult multiple leaderboards rather than treating a single first-place model as universally best.

  38. RouteLLM: Learning to Route LLMs with Preference Data

    A router selects a model for each query, making quality depend on which queries go to which model. Sweep the routing threshold and evaluate the resulting quality–cost curve against always-strong, always-weak and cost-matched random routing. RouteLLM uses held-out evaluation, contamination checks and pairwise preference data; its experiments show routing performance varies with task distribution. Engineering formulation: evaluate Q=mean quality(Mr(x)(x),y) and C=mean total cost(x,r(x)) on the same representative cases, including router overhead. Individual model averages cannot establish that the router assigns difficult cases correctly.

  39. On Calibration of Modern Neural Networks

    Calibration asks whether predictions assigned confidence p are correct about proportion p of the time. Reliability diagrams compare observed accuracy with confidence in bins; expected calibration error averages absolute bin discrepancies weighted by bin population. Calibration differs from prediction accuracy. Selective risk instead measures errors among accepted predictions, and coverage is the accepted fraction. A threshold can alter risk and coverage without demonstrating calibrated probabilities.

  40. Lessons from building GenAI based applications — Juan Peredo

    A secondary classifier can screen requests or responses, but it adds latency and cost without guaranteeing correct classification.

  41. Building Closed-Loop Evals for a Multimodal Agent at Uber Scale

    Generate image-specific editing prompts and use bounded QA feedback iterations, accepting reduced enhancement coverage when edits remain unsafe.

  42. Selective Classification for Deep Neural Networks

    Selective prediction combines a predictor with a selection function that either accepts its prediction or abstains. Coverage is the probability of accepting a case; selective risk is expected loss conditional on acceptance. A risk-coverage curve shows how error among accepted cases changes as coverage changes. The paper selects confidence thresholds using labeled examples and derives risk bounds under independent, identically distributed sampling. The ranking score used for selection need not itself be a calibrated probability.

  43. Claude Platform: Claude API errors

    Claude distinguishes invalid requests, authentication failures, permission failures, missing resources, oversized requests, rate limiting, internal errors, timeouts and overload. A 429 can indicate either temporary rate limiting or an exhausted monthly allowance; the latter lacks a retry-after hint and persists until access resumes. Official SDKs retry selected transient failures twice by default, use exponential backoff and honor retry-after when present. Mid-stream failures can occur after HTTP 200.

  44. gRPC lifecycle: cancellation is not rollback

    Client and server can disagree about an RPC's success: the server may finish while its response arrives after the client's deadline. gRPC explicitly warns that cancellation does not roll back changes already made. Application implication: cancellation during a mutation may leave an unknown outcome. Retain an operation identifier, query authoritative status or reconcile the resulting state, and use an idempotent retry contract before resubmitting. If an effect must be reversed, that requires a separate supported compensating operation rather than assuming cancellation undid it.

  45. Agents Need Feature Flags

    Ship agent-wide and per-tool kill switches first, and ensure in-flight work checks them at the next decision point.

  46. Amazon Builders' Library: Timeouts, Wiederholungsversuche und Backoff mit Jitter

    Amazon explains that retries increase dependency load and can prolong overload. Independent retry layers multiply attempts: its five-layer example with three attempts per layer produces 243 database attempts. Recommended controls include bounded attempts, capped exponential backoff, jitter to spread retry timing, and choosing one retry point for suitable operations. The article also warns that circuit breakers introduce operating modes that can complicate testing and delay recovery.

  47. Azure Architecture Center: Circuit Breaker pattern

    A circuit breaker tracks recent dependency failures and temporarily stops calls likely to fail. In the closed state calls proceed; exceeding a failure threshold opens the circuit and subsequent calls fail immediately. After a waiting interval, a half-open state permits limited trial calls. Successful trials restore normal traffic; failure reopens the circuit. Limiting probes avoids flooding a recovering dependency.

  48. gRPC: Retry

    gRPC retries replace a failed call with a new call and replay its saved history. Configured retry behavior considers status, attempt limits and backoff. Receiving response headers commits the RPC: gRPC stops transparent retry handling and hands the call to the application. Retry controls therefore have a protocol-defined boundary beyond which recovery is no longer invisible to the caller.

  49. OpenAI: Reviewing API usage and costs

    For streamed Chat Completions, include_usage requests an additional final usage chunk before the done marker. That chunk has an empty choices array; other chunks carry null usage. An interrupted stream may never deliver the final usage chunk. Missing usage therefore does not establish that no tokens were consumed. Usage field names and token-detail categories vary across endpoints.

  50. Claude Platform: Files API

    Claude's Files API stores uploaded content and returns a file_id for reuse in later requests. File access is scoped to a workspace rather than an end user, conversation or session. The documentation requires applications to maintain their own user-to-file mapping and warns against accepting arbitrary file IDs from untrusted users. The Files API is marked ineligible for zero data retention.

  51. Cloudflare Workers AI: Prompt caching

    Workers AI documents an x-session-affinity header that routes related requests to the model instance holding reusable prefix state. The application still sends the conversation input; affinity increases the likelihood of cache reuse. This illustrates session affinity as destination continuity for performance, separately from an API that stores a conversation and accepts only an opaque continuation identifier.

  52. The Missing Layer After Launch

    An agent can finish successfully while hiding intermediate failures that deserve investigation.

  53. What if the network was the sandbox?

    A shared gateway can apply a common budget across providers and scope quotas to teams, individuals, or model choices.

  54. Claude Platform: Usage and Cost API

    Anthropic documents separate usage and cost reports for reconciling internal records with provider billing. Usage distinguishes uncached input, cache reads, cache creation, output tokens, and server-tool usage. Cost reports include token, web-search, and code-execution charges, with daily buckets. Coverage differs: code execution is absent from the usage endpoint, while Priority Tier costs are absent from the cost endpoint. Reports require pagination and can arrive after request completion.

  55. Open Policy Agent: Decision Logs

    OPA decision records can connect a decision identifier, trace and span identifiers, queried policy, input, result, timestamp and policy-bundle revision. Masking rules can remove or replace sensitive input and result fields before export, recording which paths were changed. Decision logs can also be dropped by configured filters or rate limits, so enabled logging does not establish a complete audit history.

  56. From Chaos to Choreography: Multi-Agent Orchestration Patterns That Actually Work — Sandipan Bhaumik

    The proposed Databricks architecture links each agent run to an append-only state version so debugging can connect execution telemetry with exact intermediate inputs and outputs.

  57. Context Engineering in 2026: Compaction, Memory & Cost

    Record per-turn token usage, cached tokens, cost, first-token latency, tool calls, and summarization events rather than judging defaults by appearance.

  58. The Missing Layer After Launch

    Evaluate whether the requested outcome is correct, not merely whether the agent completed its flow.

  59. What if the network was the sandbox?

    An LLM gateway can extract model-visible tool calls and associate request history with users or workload tags without depending on instrumentation inside the agent container.

  60. ReliabilityBench: Evaluating LLM Agent Reliability Under Production-Like Stress Conditions

    ReliabilityBench combines repeated executions, task-description perturbations, and injected tool failures. Its synthetic scheduling, travel, support, and shopping tools modify explicit state, which task-specific predicates assess afterward. A published travel fixture checks both confirmed reservation status and the expected passenger. Fault categories include timeouts, rate limits, partial responses, schema changes, and stale data. The method allows different action sequences when they satisfy the required final-state conditions.

  61. From Chaos to Choreography: Multi-Agent Orchestration Patterns That Actually Work — Sandipan Bhaumik

    Enforce explicit data contracts at agent handoff boundaries so invalid output fails before it propagates downstream.

  62. Open Policy Agent: Bundles

    OPA can update policy and associated data without restarting the policy service. Remote bundle distribution is eventually consistent. With persistence enabled, an instance can restart from its most recently activated local bundle when the bundle server is unavailable, then download and activate the latest bundle after communication returns. Recovery availability and policy freshness are therefore distinct properties.

  63. Lessons from building GenAI based applications — Juan Peredo

    Estimate cost across the full workflow and expected usage before setting product prices.

  64. Recommendations as Treatments: Debiasing Learning and Evaluation

    Observed feedback is selected by the process that decides which user-item pairs are exposed or rated. Averaging error only over those observations can favor a model that matches the selection bias. Inverse-propensity scoring weights an observed contribution by the inverse probability of its observation, correcting this bias under the paper’s assumptions. Very small propensities produce large weights and greater variability; estimating propensities adds another modeling problem. This makes coverage and uncertainty essential parts of counterfactual evaluation.

  65. Envoy: Route mirroring policies

    Envoy's published mirroring example forwards one incoming request to both its primary service and a mirror service. Configuration can choose the mirror statically or through a request header, and the example's logs show both recipients receiving requests. Shadow execution therefore involves additional delivery and processing, unlike merely recording which destination a proposed routing rule would select.

  66. On Over-fitting in Model Selection and Subsequent Selection Bias in Performance Evaluation

    Cawley and Talbot demonstrate optimization of a finite-sample selection criterion continuing to improve that criterion while independent test performance deteriorates. Their analysis separates a criterion's bias from its variance: even an approximately unbiased estimator can be exploited by selecting favorable noise. The selected development score therefore need not estimate the selected method's repeatable performance.

  67. Building Closed-Loop Evals for a Multimodal Agent at Uber Scale

    Use production-label mismatches to propose configuration changes, but benchmark those changes before registering a new production version.

  68. Agents Need Feature Flags

    Flags require ongoing drills, lifecycle ownership, and interaction testing.

  69. Agents Need Feature Flags

    Route cohorts to versioned prompts and promote a candidate only after observing its behavior against a baseline.

  70. Shipping AI to a Million Patients Without an A/B Test

    An already-delivered clinical utterance cannot be undone, so reactive rollout monitoring cannot substitute for evidence gathered before exposure.

  71. Agents Need Feature Flags

    Track mitigation effectiveness and record flag changes with enough context to reconstruct an incident.

  72. Context Engineering in 2026: Compaction, Memory & Cost

    Caching cannot solve a context-capacity limit; inputs that do not fit require compression or selective retrieval.

  73. From Chaos to Choreography: Multi-Agent Orchestration Patterns That Actually Work — Sandipan Bhaumik

    Use a circuit breaker to stop repeatedly calling a failing agent and probe for recovery after a waiting period.

  74. Mastering AI Pricing — Mayank Pant, Stripe

    Combine usage caps, advance notifications, explicit top-up choices, and rate limits.

  75. OWASP LLM06:2025 Excessive Agency

    Damaging agent actions can result from excessive functionality, permissions, or autonomy, whether the triggering model output is maliciously induced or merely mistaken. A summarizer does not need a send-mail operation; its downstream identity can also be read-only, and a separately permitted send operation can require approval. OWASP's complete-mediation recommendation places authorization in downstream enforcement, validating every request instead of asking the model whether it is allowed. Logging and rate limits can limit or reveal harm but do not remove excessive agency by themselves.