Contents
  1. Purpose and development
    1. What a routing layer does
    2. Origins and turning points
  2. Interfaces and eligibility
    1. Preserve the request contract
    2. Check the concrete service path
    3. Authorize every recipient
  3. Admission and selection
    1. Admit bounded work
    2. Choose among eligible routes
  4. Quality-aware decisions
    1. Route by task evidence
    2. Escalate after inspecting an answer
  5. Failure and continuity
    1. Interpret the failure before recovery
    2. Bound retries and alternate routes
    3. Respect committed output and state
  6. Accounting and explanation
    1. Account for all attempted work
    2. Record why the route ran
  7. Evaluation and controlled change
    1. Evaluate the complete policy
    2. Release policy without restoring old authority
  8. Check understanding
  9. Open questions
  10. Selected talks
  11. References
  12. Talk library
← All topics

Model Routing and LLM Gateways

Model routing decides which service should handle a model request. The useful choice is not necessarily the most capable model or the cheapest endpoint: it must satisfy the task, support the requested behavior, be permitted to receive the data, and fit the available resources. A gateway provides a place to enforce those obligations across applications and providers. This chapter explains how selection, escalation, recovery, and accounting fit together without weakening the original request.

Purpose and development

What a routing layer does

A large language model, or LLM, generates responses from supplied inputs. A provider makes a model available through a serving endpoint. Choosing the model concerns its behavior; choosing the endpoint also concerns supported features, capacity, credentials, and operating conditions. Inference Engineering explains the complementary responsibility: executing the invocations that these choices create.

An LLM gateway mediates model calls; a router chooses their destination. A request policy governs both. Mediation alone does not predict answer quality.

These are independently configurable responsibilities, not mandatory consecutive stages.
ResponsibilityDecision inputResult
Gateway mediationRequest, identity, interface and policyA controlled provider interaction
Model selectionTask information available before generationA model chosen for the request
Quality escalationA generated answer and its assessmentAccept it, seek another answer, or defer
Failure fallbackAn execution failure and eligible alternativesAnother route attempted under bounded recovery

Shared mediation is useful when several applications need common access controls, provider credentials, and request records. In the Aperture demonstration, the gateway holds provider keys outside an agent sandbox and uses network identity to govern access. That reduces reusable provider secrets in clients, while concentrating authority and introducing another service dependency. The gateway sees traffic passing through it, not every local action or external effect.

Direct integration remains a reasonable design when one application can enforce its requirements without a shared intermediary. Add mediation for concrete benefits that justify its processing overhead and operating burden. A request-management service is also narrower than AI Platform Engineering, which addresses shared capabilities and their organizational ownership.

Origins and turning points

Modern routing brings together two continuing lines of work. Network intermediaries centralize access to services. Algorithm selection chooses different computation for different inputs. Their combination matters because model services can differ both operationally and in the answers they produce.

Dates identify the particular publication or announcement, not the invention of an entire field.
DevelopmentContribution
Rice's algorithm-selection report — July 1975John R. Rice formalized selecting algorithms using problem-instance features and performance criteria. Original report.
HTTP/1.1 intermediary roles — January 1997RFC 2068 distinguished proxies acting for clients from gateways presenting an entry point to another server. Historical specification.
Amazon API Gateway — July 9, 2015AWS's managed service combined authorization, traffic management, monitoring, and API version management ahead of backend applications. Announcement.
FrugalGPT — May 9, 2023Lingjiao Chen, Matei Zaharia, and James Zou developed answer-scored LLM cascades under an average API-cost constraint. Paper.
RouteLLM — June 26, 2024Isaac Ong and colleagues introduced preference-trained routing that chooses a model from the query before generating its answer. Initial preprint.

The older selection problem already contained a lasting limitation: extracted features discard information, so identical features need not imply identical algorithm performance. LLM routers inherit that prediction problem. Gateways solve a different problem by mediating access and preserving interfaces. Neither line makes the other obsolete, and chronological succession alone does not establish direct influence.

Interfaces and eligibility

Preserve the request contract

Define the application's obligations before choosing an adapter. A logical request is one application request with one intended outcome. A provider attempt is one execution toward that outcome. Retrying or changing models creates another attempt; it should not silently create a new deadline, spending allowance, or definition of success. This applies the broader principle of explicit interface obligations.

A gateway-facing contract should distinguish requested behavior from trusted operating context.
Contract elementMeaning
InputMessages, attachments, and references whose meaning must survive translation.
Selection and output requirementsRequested model or policy alias; required modalities, structure, and tool behavior.
Execution limitsGeneration allowance, overall deadline, and cancellation behavior.
Trusted contextAuthenticated caller and operator policy, obtained independently of request text.
CorrelationLogical request identity retained across distinct attempt identities.

An adapter translates between interfaces. A normalized envelope simplifies application code, but provider-specific behavior sometimes needs explicit extensions. Bedrock Converse, for example, combines common fields with model-specific additions and separately returns output, stop reason, usage, and metrics. Normalization should preserve those distinctions instead of collapsing them into a single success flag.

The response contract should retain content, proposed tool calls and their identities, destination information when available, completion disposition, and whether usage is known. A tool call is a proposed operation, not proof of execution. Streaming delivers incremental content before the terminal outcome is known; individual chunks are not completed answers. Preserve refusal, interruption, output-limit termination, and ordinary completion as distinguishable outcomes.

Check the concrete service path

Provider capability means supported behavior along a concrete path: model, endpoint, API version, adapter, and configuration. A matching JSON shape establishes much less. Anthropic's documented OpenAI SDK compatibility layer, for example, ignores response_format and function-calling strictness, strips audio input, and combines system/developer messages. Those limitations concern that compatibility layer, not Claude's native interface.

Check each required behavior separately: support for one feature cannot compensate for another missing feature. A schema describes the permitted structure of an output. In this example, the request requires image input, particular schema features, and a particular tool-call mode. Each endpoint's support is recorded as supported, unsupported, or unknown.

RequirementEndpoint AEndpoint B
Image inputSupportedSupported
Required schema featuresSupportedUnknown
Required tool modeUnsupportedSupported
EligibilityExcluded for this requestUnresolved until schema support is established

Neither endpoint currently qualifies: A lacks the required tool mode, while B's schema support still needs verification. Reject an incompatible request or negotiate a changed requirement explicitly; silently dropping a field changes the contract. Providers can support different subsets of schema features. Structured Outputs and Tool Calling explains how to test that coverage.

Capacity and references also belong in compatibility checks. Tokens are model-specific representation units, so changing models can change the input count; count the complete request and reserve room for generation. An opaque file identifier is different from its content. Claude's Files API returns workspace-scoped identifiers and requires applications to maintain user-to-file authorization. Copying an identifier to another route neither transfers the file nor establishes permission to read it.

Authorize every recipient

Authentication establishes caller identity; authorization decides what that identity may access. A tenant is the customer or organizational group whose data and allowance must remain separated. Credential brokering lets a gateway supply an upstream credential after checking access, rather than giving every client the provider key. Model access and permission to disclose particular data are separate decisions.

Keep credentials narrowly scoped. Rotation replaces a credential; revocation removes its authority or usability. Short lifetimes limit exposure but do not prevent disclosure. Request text and model-generated suggestions must not expand permissions. The enforcement boundary belongs in trusted code, as explained in Independent enforcement.

Inspect effective permissions rather than the apparent strictness of one rule. Aperture grants are additive: access is the union of matching grants. A narrow grant cannot subtract permission supplied by a broad one. Its shipped configuration grants all users all models, so a restrictive policy requires removing or narrowing the grants that actually confer access.

Data eligibility attaches to the actual processing path. A Bedrock geographic inference profile can dispatch beyond the API entry Region to other Regions in its designated geography. If that destination set conflicts with approval, reject the profile rather than automatically broadening permissions. Similarly, OpenRouter documents retention at endpoint granularity; its zero-data-retention routing control excludes enabled plugins and tools. An approved inference endpoint does not approve those additional recipients.

A remote routing classifier receives information before the answer model does. A remote checker, shadow execution, and alternate provider create further disclosures. Check each recipient before sending data, and treat unknown approval as insufficient permission. Separate approval for a remote selector from approval for every possible processing destination. A permitted API entry Region does not approve the whole destination set. Approve actual service paths develops the governance decisions these checks implement.

Example geographic policy. Selector disclosure has its own approval; a recommendation cannot authorize inference. The bracket shows possible processing destinations, not simultaneous executions. Rejecting the profile prevents the next disclosure but cannot undo an earlier selector disclosure. Approval must also account for other recipients such as tools or plugins.

Admission and selection

Admit bounded work

Permission to invoke a service does not establish room to do so. A rate limit bounds work over time; a quota allocates an allowance; a concurrency limit bounds simultaneous work; and a deadline sets the latest acceptable completion time. Their scopes can overlap. A tenant may have allowance remaining while its provider account has exhausted an input-token rate limit.

A token bucket is a rate-limiting mechanism whose capacity replenishes over time and can allow a bounded burst; its accounting tokens need not be language-model tokens. Claude documents separate request, input-token, and output-token limits, alongside spending allowances. Independent gateway-instance counters are not automatically one shared limit. Envoy distinguishes local limiting from coordinated global enforcement.

Admission control decides whether work may enter the bounded service. It can accept, wait within a limit, or reject. Waiting consumes the caller's time and must not become an unbounded substitute for capacity. Per-customer controls also limit a noisy neighbor's ability to exhaust shared resources. Scheduling and admission distinguishes accepting work from choosing which admitted work runs next.

Concurrent spending needs outstanding commitments, not only completed spend. LiteLLM documents reserving estimated maximum request cost before execution and replacing that reservation with priced consumption afterward. Aperture instead documents positive-balance admission followed by estimated deductions after completion. These are different contracts: the latter must not be interpreted as a strict reservation for all in-flight work.

For a small example, let a shared pool have 10 credits available and let requests A and B each require a 6-credit reservation. Independent balance checks can both see 10 and admit 12 credits of commitments. Coordinated check-and-reserve admits A, leaves 4 available, and makes B wait or fail admission. Credits are illustrative admission units.

A hard spending claim additionally depends on conservative pricing bounds, coordinated state, and defined failure handling. Unpriced work or delayed usage can weaken it into a soft limit. Retries and escalation must consume the same logical request's remaining allowance; changing the destination does not replenish the budget.

Choose among eligible routes

A route combines a model with a concrete serving path. First exclude paths that fail capability, authorization, disclosure, or resource requirements. Then apply preferences to the remaining candidates. A forbidden endpoint cannot compensate with a better latency score. If no route remains, return an explicit no-eligible-route disposition rather than quietly weakening a requirement.

A policy alias is a caller-facing name resolved through controlled configuration. It can name a logical service rather than one immutable deployment. LiteLLM groups deployments behind aliases and offers weighted, least-busy, latency-based, and rate-limit-aware selection. These operational strategies distribute work; none by itself establishes that a selected model will produce a better answer for this task.

Specify precedence rather than relying on incidental configuration order. One reasonable contract applies operator constraints first, then an explicit caller choice if allowed, then ordered task rules, then the configured placement strategy. Define tie handling where reproducibility matters. Treat health and latency observations as dated measurements: an apparently healthy endpoint can fail on the next request.

Session affinity keeps related requests on a destination, often to reuse cached state. It is a preference only while that path remains eligible. Affinity does not establish durable conversation storage or permission to retain data. These constraints leave a separate optimization question: whether cheaper or faster eligible routes meet the workload's quality targets. That comparison belongs with AI Cost and Performance Engineering.

Quality-aware decisions

Route by task evidence

A task segment is a subset of requests with meaningful shared requirements: language, output type, workflow role, difficulty, or consequence. Start with metadata the application already knows. For example, Factory's role-specific design distinguishes careful reasoning for planning, code fluency and creativity for implementation, and precise instruction following for validation. These requirements suggest what to test when assigning models; they do not establish a universal winner for each role. If evaluation supports stable assignments, explicit segment rules can make those choices without an extra predictive model.

A learned router predicts model preference from request features, or extracted properties. Its pairwise training labels identify which of two answers to the same query was preferred. That preference does not necessarily establish correctness or application success.

RouteLLM estimates from the query the probability of preferring the stronger model's answer over the cheaper alternative, before either generates. A score at least the configurable selection threshold t selects the stronger model; otherwise, the cheaper one. Raising t reduces strong-model use. Misrouting can waste resources or reduce answer quality.

Distribution fit matters. RouteLLM's February 2025 revision found that routers trained only on Chatbot Arena preferences could approach random-routing performance on MMLU and GSM8K; task-relevant training data improved routing. The revision also examined router throughput and resource costs. These findings motivate testing the selector on representative work, including unfamiliar segments, and measuring its own overhead. When evidence is insufficient, use a validated default or defer instead of interpreting a score as assurance.

Bedrock Intelligent Prompt Routing made this decision a managed interface. Its April 22, 2025 general-availability announcement described configurable model pairs and a quality-difference setting. AWS reported approximately 85 milliseconds of routing-component overhead at the 90th percentile in internal testing—not an end-to-end guarantee. Selection can reduce total latency while still adding work of its own.

Bedrock calls one quality-routing destination its fallback model even without a preceding execution failure. Classify the mechanism by its decision inputs, not the product label. Its documentation also describes English optimization and no adaptation from an application's own performance data. Evaluate the intended languages and domains, and distinguish a preference estimate from a calibrated correctness forecast.

Escalate after inspecting an answer

An acceptance gate assesses a generated candidate against requirements. An escalation cascade requests another candidate when that assessment is insufficient. It differs from pre-generation routing because an answer is now available as decision input, and from failure fallback because the first invocation may have completed normally. If no candidate qualifies, deferral explicitly declines automatic completion.

Chow's reject-option analysis, published in January 1970, formalized trading classification errors against withholding answers for exceptional handling. Rejection avoids some mistakes but also withholds answers that would have been correct. Its probability assumptions do not validate arbitrary LLM confidence scores; its enduring contribution is separating prediction from acceptance.

FrugalGPT applies response-conditioned selection to LLM calls: score the query and generated answer, stop above a stage threshold, otherwise invoke another model. Its HEADLINES experiment classified gold-price direction from financial headlines using GPT-J, J1-L, GPT-4, and a DistilBERT scorer. It reported 87.2% accuracy versus GPT-4's 85.7%, with aggregate API costs of $6.50 versus $33.10 under historical March 2023 prices. This demonstrates a workload-specific opportunity, not current prices, full operating costs, or a per-request spending ceiling.

The gate is itself fallible. False acceptance returns a candidate that violates the requirement; false rejection spends more or defers despite an adequate candidate. Valid structure is not correctness, and a stronger model need not repair a particular error. Measure coverage, the fraction accepted, alongside error among accepted cases. Raising a threshold helps only if its score usefully distinguishes failures. Deferral evaluation covers the resulting policy.

Every cascade request pays for its first invocation and applicable check. Rejected cases also pay for subsequent work, so predictably difficult requests or tight deadlines can favor direct selection. A bounded cascade must assess the second candidate too: exhausting attempts does not make the last answer acceptable. Verification and search methods are developed in Reasoning and Test-Time Compute.

Use the answer to decide whether to continue

Example

Once the request is admitted to this cascade, its first generation is required. Additional generation depends on rejection and remaining resources.

This example application policy permits at most two attempts; it is not an exact reconstruction of FrugalGPT. Each candidate faces acceptance. A first rejection permits another invocation only with an eligible route, time, and allowance; final rejection leads to deferral.
Read the diagram as text
  • Generate candidate A. First invocation for the task.
  • Assess candidate A. Evaluate the query and answer against acceptance requirements.
  • Generate candidate B. Another eligible invocation for the same task.
  • Assess candidate B. The last candidate still needs acceptance.
  • Return accepted candidate. Acceptance is a policy decision, not infallible correctness.
  • Defer automatic completion. No acceptable candidate within the permitted work.
  • Generate candidate AAssess candidate A: Candidate A and task input.
  • Assess candidate AReturn accepted candidate: Accept A.
  • Assess candidate AGenerate candidate B: Reject; route and resources available.
  • Assess candidate ADefer automatic completion: Reject; further work not permitted.
  • Generate candidate BAssess candidate B: Candidate B and task input.
  • Assess candidate BReturn accepted candidate: Accept B.
  • Assess candidate BDefer automatic completion: Reject B.

A Unified Approach to Routing and Cascading for LLMs, by Jasper Dekoninck, Maximilian Baader, and Martin Vechev, first appeared in October 2024 and was revised in May 2025. It combines selecting the next model with deciding whether further generation is worthwhile. Its conclusions depend on estimated quality and cost; experiments using simulated quality estimates or ground-truth tests do not establish that equivalent checkers are available in deployment.

Failure and continuity

Interpret the failure before recovery

Recovery starts by identifying what failed and what is known about execution. HTTP status is only one signal. Provider codes, stop reasons, stream events, and local validation can describe different outcomes. For example, Claude documents both temporary rate limiting and exhausted monthly allowance under 429; waiting briefly does not resolve the latter.

The next action remains subject to the original request policy.
Observed eventWhat it establishesAppropriate response
Invalid input or unsupported featureThe submitted request cannot be handled as specifiedCorrect or explicitly renegotiate; unchanged retry is not a repair
Authentication or authorization denialThe attempted access was not acceptedStop and repair authority; do not bypass the restriction
Temporary limit or overloadThe service could not accept or serve work normallyConsider bounded waiting or another eligible route
Exhausted spending allowanceAdditional work lacks the required allowanceStop or obtain an authorized allowance change
Refusal, filtering, or output limitGeneration ended with a nonordinary dispositionPreserve the reason; apply an explicit application policy
Malformed or semantically invalid answerThe candidate failed an output requirementReject or use bounded quality correction; do not label it a network fault
Timeout after dispatchThe caller lacks a confirmed outcomePreserve uncertainty and assess whether repetition is safe
Error after output beganA partial response exists, but normal completion failedExpose partial failure under the streaming contract

A refusal is a decision not to supply the requested answer, not evidence that another provider should automatically be tried. Likewise, an unknown outcome after dispatch is not known non-execution. Return stable, safe categories to applications while preserving detailed provider diagnostics in protected records. Keep secrets and sensitive policy details out of public error text. Failures need distinct meanings develops the adjacent generated-output boundary.

Bound retries and alternate routes

A retry is another execution attempt. Failure fallback chooses an alternate route after an execution problem. Both consume resources, and neither is automatically safe. Coordinate attempt limits across the client, gateway, and provider SDK. Independent layers multiply attempts: three attempts at each of two layers can produce nine downstream executions. Amazon's retry guidance recommends bounded retries and backoff, increasing the delay between attempts, with randomized jitter to avoid synchronized bursts.

Propagate remaining time rather than resetting a full timeout. In the illustrative timeline, a 2,000-millisecond request spends time on admission, a failed attempt, waiting, and an alternate attempt. When the alternate fails at 1,950 milliseconds, only 50 milliseconds remain. A policy requiring at least 100 milliseconds for another attempt must stop. Deadline propagation is an application obligation when the transport or adapter does not supply it automatically.

Recovery shares one deadline

Example timings

Waiting and failed work reduce the time available to every later attempt.

Logical request deadline02,000 msDuration 2,000 ms
Admission and selection0150 msDuration 150 msWithin Logical request deadline
Attempt A150850 msDuration 700 msWithin Logical request deadline
Backoff8501,100 msDuration 250 msWithin Logical request deadline
Alternate attempt B1,1001,950 msDuration 850 msWithin Logical request deadline
Unused allowance; stop at 1,950 ms1,9502,000 msDuration 50 msWithin Logical request deadline
Stop further attempts at 1,950 ms. The remaining 50 ms of this 2,000-ms allowance is unused, below the example policy’s 100-ms minimum for another attempt; it is not time that must be spent waiting. Parent and child spans overlap by containment: do not sum them as elapsed time.
Read the diagram as text
  • Logical request deadline. One overall allowance; it does not reset on a route change. 0 to 2,000 ms; duration 2,000 ms.
  • Admission and selection. Initial checks consume elapsed time. 0 to 150 ms; duration 150 ms. Parent: Logical request deadline.
  • Attempt A. Fails without committed output. 150 to 850 ms; duration 700 ms. Parent: Logical request deadline.
  • Backoff. Waiting before permitted recovery. 850 to 1,100 ms; duration 250 ms. Parent: Logical request deadline.
  • Alternate attempt B. Also fails without committed output. 1,100 to 1,950 ms; duration 850 ms. Parent: Logical request deadline.
  • Unused allowance; stop at 1,950 ms. Stop when attempt B fails at 1,950 ms. Leave the last 50 ms unused because another attempt requires at least 100 ms. 1,950 to 2,000 ms; duration 50 ms. Parent: Logical request deadline.

Honor provider retry guidance, including Retry-After where supplied, but never wait beyond the request's remaining allowance. A circuit breaker temporarily withholds traffic from a failing dependency. Closed permits calls; repeated failures open the circuit and fail new calls quickly; after a waiting interval, half-open permits limited probes. Successful probes restore traffic, while failure reopens the circuit. A breaker assesses dependency health, not answer quality, and does not repair the dependency.

Alternate capacity must survive simultaneous activation. Amazon describes a shipping-speed system around 2001 whose caches protected a database. When caches failed together, fallback traffic overwhelmed that database and affected other work. The lesson for model services is to examine shared dependencies and failover headroom: different endpoint names do not establish independent quota, infrastructure, or spare capacity.

Before every alternate attempt, recheck current capability, permission, disclosure policy, output state, and remaining resources. Switching models changes behavioral assumptions and requires an approved quality or degradation policy. If the gateway fails, a direct-provider bypass must not silently discard its controls. Safe repetition requires a contract, especially when the surrounding workflow can create external effects.

Respect committed output and state

Response commitment is the point beyond which replacement is no longer invisible under the chosen interface. Before consumer-visible commitment, a buffered candidate may be discarded and replaced if the rest of the contract permits it. After a prefix has been exposed, appending another model's independent answer does not generally produce a valid continuation. Report partial failure and use an explicit restart contract.

Protocol boundaries differ. gRPC commits transparent retry handling when response headers arrive; that is not a universal first-token rule. OpenRouter uses server-sent events, an HTTP event stream, to report failures after output begins while HTTP status remains 200. An idle timeout measures inactivity, whereas a maximum stream duration bounds total lifetime. Envoy documents these separately, so an active stream can avoid an idle timeout while still exceeding the application's overall deadline.

Buffering for a full-answer acceptance gate delays first visible output but permits rejection before exposure. Early delivery improves responsiveness while moving some failures into the consumer-visible state. Choose that tradeoff explicitly. Compare the same provider prefix and interruption under buffered and early delivery: the consumer has received content only in the second case.

Delivery changes what recovery must preserve

Hold the provider prefix P and interruption fixed. Only the gateway’s delivery policy changes. Events run downward; spacing does not measure time.

Buffered delivery
ProviderGatewayConsumer
Prefix P
Retain P internally
Interruption
Replacement remains conditional

Consumer: No content received

Replacing the internal candidate depends on the interface, remaining resources, and other obligations.

Early delivery
ProviderGatewayConsumer
Prefix P
Deliver P
Interruption
Partial-failure notification

Consumer: P remains observed

Preserve the exposed prefix and report partial failure. Any new answer requires an explicit restart.

The arrows carry output or notifications, not model continuation. Partial failure is neither normal completion nor proof that processing or billing stopped.

Content exposure changes the recovery obligation. Protocol commitment can occur earlier; first-token delivery is not a universal retry boundary.

Later turns introduce a different continuity problem. Portable message history can support reconstructing the next call, but provider-held sessions and file handles need a separate transfer contract. Performance affinity is different again: Workers AI's prompt-caching documentation routes related requests toward reusable prefix state while the application still supplies the conversation. Affinity does not make that state durable or portable.

Preserve tool-call identities through interruption and restart. A proposed call is not proof of an executed effect, and cancellation does not undo a completed operation. Nor does a disconnected consumer establish that provider processing or billing stopped; cancellation support varies by provider path. Reconcile unknown tool effects before resubmitting work that could repeat them.

Accounting and explanation

Account for all attempted work

Resource accounting follows executions rather than visible answers. Connect the logical request to every metered selector, checker, candidate generation, retry, and shadow call. Preserve tenant, destination, quantity, unit, outcome, and the applicable price reference. Rejected answers can still cost money, and an interrupted attempt can leave unresolved consumption. Cost-ledger mechanics explain the underlying attribution model.

This illustrative ledger follows request R1. It records evidence status rather than inventing usage totals.
ExecutionPurpose and outcomeReservationUsage evidence
R1/S1Remote selector completedEstimated before dispatchReported quantity and unit retained
R1/A1First answer attempt interruptedEstimated before dispatchFinal usage unavailable; unresolved
R1/A2Alternate answer returnedSeparate admission decisionReported quantity and unit retained

For streamed Chat Completions, OpenAI documents that an interrupted stream may never deliver its final usage chunk. Missing usage therefore means unknown consumption, not zero. Retain the attempt and its uncertainty until suitable evidence resolves it. A gateway must define how outstanding reservations are handled during that interval; there is no universal settlement rule that follows merely from the connection closing.

Provider reports are a separate reconciliation stream. Anthropic documents usage and cost endpoints with different coverage and delayed reporting; neither supplies the application's task-to-attempt mapping. Keep provider charges, internal quota deductions, and customer billing distinct. Deduplicating a ledger event prevents duplicate entries, not duplicate upstream execution. Broader decisions about cost per completed or useful task belong in workload economics.

Record why the route ran

A trace connects operations belonging to an execution. For routing, the essential connection is between the policy decision, the provider attempt, and its outcome. The requested alias alone cannot identify what ran. Record selected endpoints, requested and returned model identities when available, adapter versions, and the reason for each escalation or fallback. Trace mechanics and system identity provide the broader framework.

Join these records through explicit identifiers, not proximity in a log.
RecordWhat it explains
Decision ID, policy revision, trusted classificationWhich rules and inputs supported the decision
Eligibility exclusions and selection reasonWhy a candidate was rejected or selected
Attempt ID, endpoint, requested and returned modelWhich execution the outcome belongs to
Health/quality signal timestampsHow fresh the selection evidence was
Queue, selection, first-visible-output, and terminal eventsWhere elapsed time accumulated
Usage-record link and evidence statusWhat consumption is known or unresolved

Open Policy Agent (OPA) evaluates requests against policy. Its decision logs connect policy inputs, results, revisions, and trace identifiers. To establish that an allowed request actually ran, join that decision to the gateway's dispatch and provider outcome records. OpenTelemetry's telemetry conventions likewise distinguish identifying information from proof: a provider label can reflect a proxy or compatible API rather than the actual model provider.

Decision records need not retain full prompts. Exclude credentials, minimize sensitive fields, and use restricted payload references when investigation needs deeper evidence. OPA supports masking and can also drop logs through filtering or rate limits, so enabled logging does not prove completeness. Monitor missing records and preserve the retention and access policy for the evidence itself.

Evaluation and controlled change

Evaluate the complete policy

Evaluate the policy that will actually run: eligibility checks, selection, acceptance gates, attempt limits, and recovery. A baseline is the credible alternative for the same workload. Compare a fixed eligible route and simple segment rules before crediting learned routing or cascades with improvement. Use matched tasks, preserve consequential segments, and include selector and checker work.

Different checks establish different properties.
Test familyConcrete requirement
Policy invariantsA forbidden recipient stays forbidden through retries, escalation, and fallback
Adapter contractsRequired behavior is preserved or explicitly rejected, including ignored-field cases
Failure fixturesInjected timeouts, overload, and partial responses produce bounded attempts and correct terminal outcomes
Concurrent admissionOutstanding reservations participate in shared-limit checks; uncertain usage is not settled as zero
Task-quality comparisonAccepted-result quality, deferral, deadlines, and total work meet the intended workload requirements

RouterBench compares routing on shared task outputs and costs. Its non-query-specific Zero baseline mixes models using aggregate cost–quality information. Learned routers beat it on some task collections but underperformed on ARC-Challenge and MBPP. Its cascade experiments used known answer scores with simulated scoring errors, not a deployed checker. Replacing that simulated component can change the result materially.

Sweep routing thresholds and compare the resulting outcomes, not just the fraction of strong-model calls. For cascades, report accepted-result quality together with coverage, deferral, and all attempted work. Lower average expense cannot compensate for a prohibited disclosure or an unacceptable critical-segment regression. A successful fallback fixture is narrower still: LiteLLM documents ways to trigger fallback in direct Router tests, but reaching the alternate does not establish preserved authority, deadlines, or accounting.

Selective labels arise when existing routing decisions determine which outcomes are observed. The chosen model's answer does not reveal what an uncalled alternative would have produced. Representative, authorized comparison runs can fill some gaps; ordinary production logs cannot. Incomplete feedback explains why unknown alternatives must remain unknown rather than inferred successes.

Keep policy development separate from independent assessment. Repeatedly selecting the best threshold on one finite dataset can select favorable noise. Cawley and Talbot's model-selection analysis demonstrates that a development criterion can improve while independent performance deteriorates. More elaborate routing makes independent validation more necessary, not less.

Release policy without restoring old authority

The control plane publishes routes, capability declarations, and policy; the data plane handles requests using that configuration. Publishing a version does not mean every serving instance is using it. Envoy's xDS configuration-distribution protocol, for example, distinguishes acknowledgment of valid resources from successful runtime application. Verify the applied configuration, and publish dependencies in order: introduce a destination before switching routes to it, then retire the old destination.

A canary exposes a bounded live population to a candidate policy. Rollback restores a previous operating configuration when its assumptions remain valid. Runtime routing flags can move cohorts or select a stable alternative without an emergency code release. Record who changed the policy, the affected population, observed behavior, and the version actually serving requests; choose thresholds for the workload rather than adopting generic defaults.

Availability and authorization freshness are separate. OPA can restore a persisted policy bundle when its server is unavailable, while remote distribution is eventually consistent. That preserves operation with older policy, not proof of current permission. Define acceptable staleness and stop affected work when authority cannot be established. Rollback must reapply current revocations rather than restoring every grant bundled with an older release.

Restore routes without restoring revoked access

Route configuration
R1update →R2rollback →R1
Authorization
A1: B permittedrevoke B →A2: B excluded
Before dispatch: restored R1 + authority satisfying current freshness requirements

Reapply A2’s revocation even though R1 still lists B as a route candidate. Confirm the configuration serving this request.

Current authority established
B remains excluded. Dispatch only if another route passes every eligibility check; otherwise stop.

Authority unknown or too stale
Stop affected work. Restoring R1 does not restore B’s permission.

Version arrows indicate configuration changes, not request traffic or instant propagation. A distribution acknowledgment does not establish runtime application.

R1/R2 and A1/A2 are example versions. Even when routes and grants share a package, rollback must retain current revocations and verify the applied configuration. These are application obligations, not automatic OPA or xDS guarantees.

Distinguish decision-only shadowing, which records the route a candidate rule would select, from execution mirroring, which sends a second request. Envoy's mirroring example delivers the input to both primary and mirror services. Discarding the mirror response does not remove that disclosure or processing cost. Authorize the additional recipient and work before using live experiment designs.

Revalidation should target the assumption that changed.
ChangeRequired check
Model alias or adapter changesResolve actual identity; rerun capability and task-quality checks
Destination or retention approval changesRecompute every affected recipient path, including recovery and mirroring
Task mix changesReassess segment outcomes, selector fit, and acceptance thresholds
Dependencies fail togetherTest alternate-path headroom and coordinated attempt limits
Policy distribution failsCheck applied versions and the permitted freshness window

Keep a fixed route when it meets the requirements and additional selection does not earn its cost. Add segment rules when measured differences are stable and understandable. Introduce learned routing or cascades when their complete-policy results justify prediction, checking, and operational complexity. Remove them when that benefit no longer holds. Dependable routing preserves obligations first and optimizes within them.

Open questions

  1. Reliable routing under changing workloads remains difficult because model behavior, task mix, and observed labels change together. Progress would mean maintaining segment-level benefits against simple baselines while accounting for unobserved alternatives and the cost of collecting new comparisons.

  2. Production acceptance gates remain a limiting component of cascades. Benchmark access to known answer scores can hide the difficulty of recognizing a good answer at runtime. Progress would mean validated checkers that retain useful coverage under shift without consuming the savings or accepting consequential errors.

  3. Interrupted-request accounting needs explicit reconciliation contracts. Missing final usage and delayed provider reports make immediate exact settlement difficult. Progress would mean tested handling of concurrent reservations, late reports, repeated callbacks, and unresolved consumption without either double charging or inventing zero usage.

  4. Cross-provider continuity remains constrained by exposed output and provider-owned state. Progress would require explicit, testable restart and state-transfer interfaces that preserve tool identities, permissions, and already observed effects—not merely a common request shape.

  5. Fast revocation and resilient policy distribution can conflict during outages. Progress would mean observable, workload-appropriate freshness bounds and recovery procedures that restore service without resurrecting withdrawn authority.

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 identity-aware gateway example: centrally held provider credentials, workload access, and request inspection. Useful for understanding mediation without assuming quality-aware selection or complete action visibility.

Watch talk
19 min

AI Engineer World's Fair 2026 · 2026

Agents Need Feature Flags

Sachin Gupta

Cited in this entry

Develops operational control through cohort routing, runtime model changes, mitigation records, and rollback. Its suggested thresholds require workload-specific validation.

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.

22 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

Transcript reviewed

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
Juan PeredoAI Engineer Summit 20252025
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
Keegan McCallumAI Engineer World's Fair 20252025
Charles FryeAI Engineer Summit 20232023
Akele Reed, Dave Revere, Doug KellerAI Engineer World's Fair 20262026
Nishant GuptaAI Engineer World's Fair 20262026
Christopher Lovejoy, Saul HowardAI Engineer World's Fair 20262026
Nishant GuptaAI Engineer World's Fair 20262026

References

Coverage and source review
Processed transcripts
26 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. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  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. 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.

  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. The Algorithm Selection Problem — John R. Rice, CSD-TR 152

    John R. Rice's July 1975 Purdue report formulated algorithm selection through problem instances, candidate algorithms, performance measures and a selection mapping. Its feature-based formulation extracts properties of an instance before choosing an algorithm; performance can involve speed, accuracy and other criteria. Rice distinguishes selecting one algorithm for a class of problems from selecting differently for individual instances. He also observes that identical extracted features rarely imply identical algorithm performance, exposing the information lost by a selector's representation.

  10. 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.

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

    FrugalGPT was authored by Lingjiao Chen, Matei Zaharia and James Zou, affiliated with Stanford University.

  12. 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.

  13. RouteLLM: Learning to Route LLMs with Preference Data

    RouteLLM's authors are Isaac Ong, Amjad Almahairi, Vincent Wu, Wei-Lin Chiang, Tianhao Wu, Joseph E. Gonzalez, M. Waleed Kadous and Ion Stoica. The inspected revision shows that routers trained only on Chatbot Arena preferences can approach random-routing performance on MMLU and GSM8K; adding task-relevant training data improves routing. It also measures router throughput and estimates infrastructure and embedding costs, making the selection mechanism's own resource consumption explicit.

  14. 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.

  15. 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.

  16. Amazon Bedrock Runtime: Converse

    Converse combines common message and inference fields with explicit model-specific request extensions and requested response fields. Model-specific response fields are selected using JSON Pointers: malformed pointers produce an error, while valid pointers absent from the response are ignored. Successful responses separately expose output, stop reason, usage and metrics. Stop reasons include normal completion, tool use, output limits, filtering and malformed model output. Prompt-routing trace data can identify the invoked model.

  17. 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.

  18. 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.

  19. 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.

  20. 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.

  21. 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.

  22. 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.

  23. 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.

  24. Kubernetes: Multi-tenancy

    A tenant can represent an internal team or an external customer; its meaning depends on the deployment. Kubernetes separates access controls from resource-sharing controls. Namespace-scoped authorization restricts access, while quotas constrain resource consumption and object creation. A noisy neighbor is a tenant whose activity degrades other tenants' workloads. Quotas reduce this risk but do not cover every shared resource, including network traffic. Containers exceeding resource limits can be throttled or killed depending on the resource.

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

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

  26. 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.

  27. 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.

  28. Amazon Bedrock: Geographic cross-Region inference

    A geographic cross-Region inference profile can send a request to multiple destination Regions within its designated geography. The Region receiving the API request therefore need not be the processing Region. AWS documents permissions involving the inference profile and models in the source and destination Regions; organizational Region restrictions must also accommodate the profile's destinations. Prompts and outputs may move from the source Region, and data retained for abuse detection may be stored in a destination Region.

  29. 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.

  30. 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.

  31. 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.

  32. 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.

  33. 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.

  34. 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.

  35. 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.

  36. 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.

  37. 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.

  38. 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.

  39. The Multi-Agent Architecture That Actually Ships — Luke Alvoeiro, Factory

    Choose models by role-specific strengths and interacting failure modes, an approach the team calls 'droid whispering.'

  40. Use Amazon Bedrock Intelligent Prompt Routing for cost and latency benefits

    AWS's April 22, 2025 release account describes Intelligent Prompt Routing becoming generally available after a December preview. The managed endpoint predicts response quality before selecting a model. General availability added configurable pairs within a model family and a response-quality-difference setting, moving these choices into a managed request interface. AWS reported approximately 85 milliseconds of added routing-component overhead at the 90th percentile in its internal testing, illustrating that selection has a latency cost even when the resulting model choice reduces overall latency.

  41. Amazon Bedrock: Intelligent prompt routing

    Bedrock's prompt router selects between two models in the same family using predicted response quality and a configured quality-difference criterion. Its term fallback model denotes the designated model used when the routing criterion is not met; this does not require a preceding transport or provider failure. The documentation states that routing is optimized for English and cannot be trained or adapted using an application's own performance data.

  42. A Unified Approach to Routing and Cascading for LLMs

    Jasper Dekoninck, Maximilian Baader and Martin Vechev of ETH Zurich formulate routing and cascading within a common quality–cost framework. Their cascade-routing approach combines choosing which model to invoke with deciding whether further generation is worthwhile, rather than requiring one fixed model sequence for every query. The paper derives policies under estimated quality and cost and evaluates them on routing, coding and mathematical tasks. Figure 1 contrasts direct routing, ordered cascading and cascade routing.

  43. 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.

  44. On Optimum Recognition Error and Reject Tradeoff

    C. K. Chow's January 1970 paper formalized the tradeoff between classification errors and withholding a classification for exceptional handling, such as rescanning or manual inspection. Rejection removes some potential errors but also withholds some answers that would have been correct. Under the paper's probabilistic assumptions, thresholding the largest posterior class probability gives an optimal error–rejection tradeoff. The contribution explains why accepting every available answer is not necessarily the right objective.

  45. 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.

  46. 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.

  47. 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.

  48. Instructor: Retry Logic with Tenacity

    Instructor documents selecting retryable exception types and imposing attempt or elapsed-time stop conditions. Failed attempts are passed to reask handlers for contextual correction feedback, and retry exhaustion exposes attempt history. Its runtime-context example checks that an extracted quotation occurs in supplied source text. This demonstrates a deterministic check beyond field types, followed by bounded regeneration when validation fails.

  49. 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.

  50. 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.

  51. 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.

  52. 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.

  53. Amazon Builders' Library: Avoiding fallback in distributed systems

    Amazon's account describes a shipping-speed system around 2001 whose per-server caches protected a database that could not sustain normal website traffic directly. When caches failed around the same time, fallback requests converged on that database and overloaded it, affecting both the website and fulfillment. A recovery path that works for an isolated failure can therefore fail when many callers activate it together. The article also explains why rarely exercised fallback paths can conceal defects.

  54. 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.

  55. Envoy: How do I configure timeouts?

    Envoy distinguishes receiving the client's request, waiting for an upstream response, stream inactivity and total stream lifetime. Its route timeout begins after the complete downstream request has been received. A per-try timeout applies before a response has been sent downstream and can permit another attempt when a response has not begun. An idle timeout measures lack of activity, whereas maximum stream duration bounds the stream's lifetime.

  56. 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.

  57. Lessons from building GenAI based applications — Juan Peredo

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

  58. 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.

  59. 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.

  60. Agents Need Feature Flags

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

  61. 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.

  62. Why Your Enterprise Tech Stack Isn't Ready for AI Agents - And What to Build Instead

    Separate orchestration events from immutable, schema-driven objects containing sensitive data.

  63. 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.

  64. 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.

  65. 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.

  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. Envoy: xDS REST and gRPC protocol

    An xDS ACK indicates that resources were considered valid and that the client intends to apply them; it does not prove successful application. A NACK indicates that at least one resource was invalid, not necessarily that no resources were accepted. Because related configuration updates can be eventually consistent, a route can temporarily reference an unavailable cluster. Envoy describes introducing the new cluster before switching routes and removing the old cluster. Optional resource lifetimes can expire configuration, subject to client and resource support.

  68. Agents Need Feature Flags

    Make model selection and fallback runtime routing decisions.

  69. 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.

  70. Lessons from building GenAI based applications — Juan Peredo

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

  71. 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.

  72. Dream Machine: Scaling to 1m users in 4 days — Keegan McCallum, Luma AI

    Use product-defined service-level objectives to age jobs, then rank urgency by the fraction of each job's SLO already consumed.

  73. 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.

  74. 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.