Routing, Fallbacks, and Graceful Degradation

Michael BrenndoerferDecember 2, 202623 min read

Build a three-tier LLM cascade with acceptance gates, eligibility checks, provider failover, partial service, and abstention. Compare routing policies on cost and accuracy.

Language AI HandbookAll chapters
Part 64 of 67Compound AI System Design
Chapter 486Routing, Fallbacks, and Graceful Degradation
Reading the full chapter · 10 sections · 23 min10 sections · 23 min

All 10 sections · 23 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Routing, Fallbacks, and Graceful Degradation

A support assistant can still show an official return policy if the component that normally summarizes it is down. The same fallback may be useless for a question that depends on a personal order record. The router needs to know which components are permitted to see the request, which are available, and what information would make a response useful. Those checks lead to different branches.

We will build a three-tier cascade for fictional support answers. A seeded simulation compares fixed policies on identical candidate responses, then separate fixtures test provider unavailability, eligibility, partial service, and abstention. The notebook uses local Python 3.11 records and Matplotlib through the repository's locked runtime. It calls no model or network service.

The Economic and Reliability Case for Routing

Query routing chooses a first tier using information known before generation, such as the intent or whether the model supports the required context length. A cascade escalates after examining a candidate. FrugalGPT is an example of an LLM cascade. Here every eligible, available tier is tried in a fixed order until one passes an acceptance gate.

A route is an application policy written around a service contract. A request for the shipping schedule can go to a small model if that model accurately recognizes the narrow task. An order-status request might need a model capable of combining structured order data with a short explanation. In either case the workload determines whether a second tier is useful. Compare costs after defining which information the caller is permitted to send to each tier.

Model Cascades

One common policy starts with the least expensive candidate generator and gives it the opportunity to answer. If the result passes the gate, the expensive generator does no work. If the result fails, the next generator receives the request. The gate controls whether you pay for one tier, several, or every tier. An invalid output that requires a more expensive second call incurs both costs.

Model cost and correctness vary by request. A cascade can save inference cost when enough requests pass an inexpensive tier. Even when it saves cost in aggregate, an individual request that escalates through several sequential calls waits for those calls in sequence.

A Worked Example: A Three-Tier Support Assistant

Three model tiers are enough to expose the difference between reaching a tier and stopping at it. Assume each choice in the following cost calculation has met the same privacy and availability requirements. The table-free calculation treats each attempt as one fixed cost, so it remains valid without estimates of prompt or answer length.

Consider a three-tier example with fixed attempt costs c1=1c_1=1, c2=4c_2=4, and c3=12c_3=12 credits. Assume every request reaches tier 1 and the fractions stopping at each tier are 70%, 25%, and 5%, respectively. Then 30% reach tier 2 and 5% reach tier 3, so the mean attempt cost is 1+0.30⋅4+0.05⋅12=2.81+0.30\cdot4+0.05\cdot12=2.8 credits per request.

More generally, let CC be the total attempt cost for one request. Let rir_i be the probability that tier ii is attempted. Each tier is attempted at most once and its cost is fixed in this model. Average the per-tier costs, weighted by how often each tier runs.

E[C]=∑irici\mathbb{E}[C] = \sum_i r_i c_i

If every request reaches every tier, the same cascade costs 17 credits per request, compared with 12 for a single last-tier attempt. Add verifier costs to the accounting when the verifier has its own cost. If attempt costs vary, a tier contributes its attempt probability times its mean cost conditional on being attempted.

Why Acceptance Functions Are Hard

Check eligibility first. A provider can be healthy and still be disallowed from processing a request, for example because the policy restricts where private order details can go. Check availability before submitting. A candidate from the remaining tiers must meet any required structural checks, and may also need a score above a threshold.

An acceptance score is a feature for the decision. A score of 0.8, for example, does not mean eight in ten candidate answers are correct unless calibration supports that interpretation on the population under discussion. You can build a score from a verifier, an answer's structure, or features of the request and response, then evaluate the gate on labeled outputs of every tier it will inspect. A false acceptance exposes a wrong answer. A false rejection can add cost, increase latency, or lead to an unnecessary abstention.

A structured answer can pass a type check while still asserting the wrong fact. A stronger check might look for evidence for the answer's main proposition. Each verifier creates a different tradeoff. Deterministic checks are appropriate for conditions you can write down directly, such as requiring a field. Any condition whose answer depends on an imperfect scorer needs separate evaluation. Include failures from the tier that creates the candidate, since a scorer that has seen only large-tier outputs may miss errors common at the small tier.

Implementing a Routing Harness

Simulating the Routing Problem

The benchmark builds one candidate for each request and tier. The request includes a synthetic difficulty dd between 0 and 1. For each tier, the simulator samples whether its candidate is correct using probability pp. The function p = easy - drop * d uses the tier's easy-case correctness easy and its full-range decrease drop. The score is drawn around 0.82 for a correct candidate and around 0.43 for a wrong one, with uniform noise from −0.25 to 0.25, then clipped to the unit interval. The score distributions overlap, so the gate can reject a correct response or accept a wrong one.

The simulation uses the hidden label to construct a noisy score on purpose. A real scorer would have to infer quality at decision time. The benchmark uses a local pseudorandom generator and seed 27. The same materialized rows feed every policy. Results are synthetic policy checks.

PythonIn [3]
CollapseExpand
from dataclasses import dataclass
from random import Random


@dataclass(frozen=True)
class Tier:
    name: str
    cost: int
    easy: float
    drop: float


@dataclass(frozen=True)
class Candidate:
    score: float
    correct: bool

Modeling Model Tiers

The three tiers in this simulation have different intercepts and slopes in the difficulty model. Small starts at 0.88 on the easiest requests and falls to 0.38 at difficulty 1. Middle falls from 0.94 to 0.59. Large falls from 0.98 to 0.78. These differences are choices in the fixture. The purpose of the rates is to reveal what the router does with different candidates, while the benchmark makes no claim that real providers have those rates.

PythonIn [4]
CollapseExpand
TIERS = (
    Tier("Small", 1, 0.88, 0.50),
    Tier("Middle", 4, 0.94, 0.35),
    Tier("Large", 12, 0.98, 0.20),
)
PythonIn [5]
CollapseExpand
def make_rows(seed: int, count: int) -> tuple[tuple[Candidate, ...], ...]:
    rng = Random(seed)
    rows = []
    for _ in range(count):
        d = rng.random()
        candidates = []
        for tier in TIERS:
            correct = rng.random() < tier.easy - tier.drop * d
            center = 0.82 if correct else 0.43
            score = min(1.0, max(0.0, center + rng.uniform(-0.25, 0.25)))
            candidates.append(Candidate(score, correct))
        rows.append(tuple(candidates))
    return tuple(rows)

The curve below evaluates the assumed probability function directly. It records the expected behavior at a given difficulty before any correctness or score draws. The larger tier is assigned a higher probability throughout the plotted range. That assumption makes this a useful comparison fixture, and it does not follow mechanically from the fact that its attempt price is higher.

PythonIn [6]
CollapseExpand
difficulty_grid = tuple(step / 20 for step in range(21))
tier_rates = {
    tier.name: tuple(tier.easy - tier.drop * d for d in difficulty_grid)
    for tier in TIERS
}
VisualizationOut [7]
CollapseExpand
Three declining correctness-probability lines over synthetic difficulty.
The simulator assigns each tier a linearly declining probability of a correct candidate as difficulty increases. These rates are assumed.

The Acceptance Function

The correctness rates say how often each model gets its request right. They do not, by themselves, say which answer the router should accept. We model that separate signal with synthetic scores. Take the same candidate rows that will enter the comparison and collect their scores by correctness. All three tiers are pooled in this figure. The histogram is evidence about the simulated scorer and can illustrate where threshold mistakes come from without assuming a particular tier's score distribution in real traffic.

PythonIn [8]
CollapseExpand
from collections import Counter

rows = make_rows(seed=27, count=2_000)
score_bins = Counter(
    (candidate.correct, min(9, int(10 * candidate.score)))
    for row in rows
    for candidate in row
)
score_left = tuple(i / 10 for i in range(10))
score_correct = tuple(score_bins[True, i] for i in range(10))
score_incorrect = tuple(score_bins[False, i] for i in range(10))
assert sum(score_correct) + sum(score_incorrect) == 3 * len(rows)
VisualizationOut [9]
CollapseExpand
Overlapping synthetic score counts by correct and incorrect candidate.
Counts of synthetic scores pooled across all three tiers. The classes overlap, including in the bins nearest the example gate's threshold.

Baseline: Always Use the Large Model

The small-only and large-only baselines accept every candidate from one tier. The cascade accepts the first score greater than or equal to 0.65 and abstains if every tier misses. The benchmark assumes all tiers are eligible and available. We will vary those conditions separately so the comparison measures policy choice under a common workload.

For binary correctness, coverage is the fraction of all requests answered. Accuracy on answered requests divides correct delivered answers by the number answered. If that denominator is zero, conditional accuracy is undefined. The distinction is the same one that motivates the risk–coverage tradeoff in selective classification. We also report correct delivered answers divided by all requests so a policy that abstains often cannot appear to solve more requests merely by reducing its denominator.

PythonIn [10]
CollapseExpand
def choose(
    row: tuple[Candidate, ...], order: tuple[int, ...], threshold: float
) -> tuple[int | None, int]:
    cost = 0
    for index in order:
        cost += TIERS[index].cost
        if row[index].score >= threshold:
            return index, cost
    return None, cost

The denominator choices are encoded directly in the measurements. measure is pure when rows, order, and threshold are fixed. That lets us compare policies on an identical workload and keep the scoring model unchanged across comparisons.

PythonIn [11]
CollapseExpand
@dataclass(frozen=True)
class Benchmark:
    coverage: float
    answered_accuracy: float | None
    correct_fraction: float
    mean_cost: float


def measure(
    rows: tuple[tuple[Candidate, ...], ...],
    order: tuple[int, ...],
    threshold: float,
) -> Benchmark:
    if not rows:
        raise ValueError("measurement requires at least one request")
    answered = correct = total_cost = 0
    for row in rows:
        index, cost = choose(row, order, threshold)
        total_cost += cost
        if index is not None:
            answered += 1
            correct += row[index].correct
    n = len(rows)
    return Benchmark(
        answered / n,
        correct / answered if answered else None,
        correct / n,
        total_cost / n,
    )
PythonIn [12]
CollapseExpand
comparison = {
    "Small only": measure(rows, (0,), 0.0),
    "Gated cascade": measure(rows, (0, 1, 2), 0.65),
    "Large only": measure(rows, (2,), 0.0),
}
PythonIn [13]
CollapseExpand
def format_benchmark(name: str, metric: Benchmark) -> str:
    answered = (
        "undefined"
        if metric.answered_accuracy is None
        else f"{metric.answered_accuracy:.1%}"
    )
    return (
        f"{name:14} coverage={metric.coverage:.1%}, answered accuracy={answered}, "
        f"correct per request={metric.correct_fraction:.1%}, "
        f"mean cost={metric.mean_cost:.2f} credits"
    )


for name, metric in comparison.items():
    print(format_benchmark(name, metric))
ConsoleOut [13]
CollapseExpand
Small only     coverage=100.0%, answered accuracy=62.7%, correct per request=62.7%, mean cost=1.00 credits
Gated cascade  coverage=96.1%, answered accuracy=96.4%, correct per request=92.7%, mean cost=4.84 credits
Large only     coverage=100.0%, answered accuracy=87.8%, correct per request=87.8%, mean cost=12.00 credits

Here, the gated cascade answers fewer requests than large-only but returns more correct answers per request. It also spends fewer synthetic credits. The simulator builds an informative score from the correctness label, so this comparison shows how that score shapes selection on these fixtures. An abstention is excluded from answered accuracy, but remains in the denominator of correct answers per request. Whether that trade is acceptable depends on the cost of returning an incorrect answer and what happens after an abstention.

Reading the policy comparison

The left panel reports coverage and correct answers per request on the same denominator. The right panel reports mean cost in synthetic credits per request. The two views use the same request rows, so the differences come from replaying different selection rules on those rows.

PythonIn [14]
CollapseExpand
plot_names = tuple(comparison)
plot_coverage = tuple(comparison[name].coverage for name in plot_names)
plot_correct = tuple(comparison[name].correct_fraction for name in plot_names)
plot_cost = tuple(comparison[name].mean_cost for name in plot_names)
VisualizationOut [15]
CollapseExpand
Side-by-side bar charts for small only, gated cascade, and large only. The left compares answer coverage and correct answers per request. The right compares mean synthetic credits.
On fixed synthetic requests, the gated cascade answers fewer requests than either single-tier baseline and costs fewer credits per request than always using the large tier. The left panel counts answered and correctly answered cases over all requests.

Choosing a threshold

The next cell sweeps a different synthetic sample for development. The comparison above keeps its predefined threshold. When you tune a real gate, select a policy on validation data and report outcomes on separate data. Evaluate coverage and errors by request type where the cost of bad answers varies.

Holding the candidate rows and tier order fixed, increasing the threshold never causes an earlier acceptance. Coverage is nonincreasing, and mean cost is nondecreasing for these positive fixed per-attempt costs. Accuracy on the answers that survive can go either way. A stricter gate changes both the set of answered requests and which tier answers them.

PythonIn [16]
CollapseExpand
development_rows = make_rows(seed=12, count=800)
sweep = [
    (threshold, measure(development_rows, (0, 1, 2), threshold))
    for threshold in (0.40, 0.55, 0.65, 0.75, 0.90)
]
for threshold, metric in sweep:
    print(
        f"{threshold:.2f}: coverage={metric.coverage:.1%}, "
        f"mean cost={metric.mean_cost:.2f} credits"
    )
assert all(
    a.coverage >= b.coverage and a.mean_cost <= b.mean_cost
    for (_, a), (_, b) in zip(sweep, sweep[1:])
)
ConsoleOut [16]
CollapseExpand
0.40: coverage=100.0%, mean cost=1.95 credits
0.55: coverage=99.9%, mean cost=2.71 credits
0.65: coverage=96.1%, mean cost=4.75 credits
0.75: coverage=85.4%, mean cost=7.25 credits
0.90: coverage=59.0%, mean cost=11.23 credits

A two-axis decision can conceal where the price of additional attempts is paid. The development sweep prints separate columns for service coverage and mean cost. The following plot adds conditional accuracy as a third curve on the same percentage panel as coverage, while keeping currency-free cost in its own panel. Look for points where a policy serves fewer requests despite spending more. That pattern can occur when a higher threshold produces rejections after earlier tiers have already run.

PythonIn [17]
CollapseExpand
sweep_threshold = tuple(threshold for threshold, _ in sweep)
sweep_coverage = tuple(metric.coverage for _, metric in sweep)
sweep_accuracy = tuple(metric.answered_accuracy for _, metric in sweep)
sweep_cost = tuple(metric.mean_cost for _, metric in sweep)
VisualizationOut [18]
CollapseExpand
Threshold sweep with coverage and answered accuracy at left and cost at right.
On the development rows, raising the gate threshold lowers coverage and increases attempt cost. Accuracy is conditional on requests answered at each threshold.

Deterministic Fallbacks and Provider Failover

A retry attempts the same operation again. A fallback takes a different path. With a fixed attempt budget, retry only when the failure might be transient and another attempt fits the budget. Google SRE's guidance on cascading failures recommends limiting retries, spreading them with randomized exponential backoff, and checking the remaining deadline before starting another stage. A timeout is an observation about waiting. For operations with side effects, require a verified idempotency guarantee before attempting them again.

In the acceptance benchmark we already have a candidate for every tier. In an actual request, the application can encounter an unavailable dependency before there is any candidate to score. The router still needs to distinguish a known unavailable route, which it can skip, from a call that consumed budget before failing. Record the reason in the trace so causes such as an eligibility restriction, an outage, and a low-confidence answer do not get merged in evaluation.

A deterministic fallback can be a stored message or an extract from an approved source. A fallback to another model retains all of the ordinary requirements, including which data that model may receive. The next code example also demonstrates a budget for attempts even though the in-memory fixture makes every branch fast. A remote implementation would combine its attempt count with a deadline and apply a separate policy for retries.

The next fixtures use a finite attempt limit and no actual delays. Each tier has a scripted policy-eligibility flag, an availability flag, and an optional candidate. An eligible, available tier whose candidate is absent consumes one attempt. An ineligible or unavailable tier consumes none. We return at most one accepted candidate and record its tier.

Partial Service: Returning a Reduced but Honest Result

If the attempt budget is exhausted or no tier passes, an allowed public policy excerpt yields a partial answer. This path says what is missing. Otherwise the router abstains. Withheld synthesis and missing evidence are different states. A private request cannot use the public excerpt path unless the caller has already determined that the excerpt is appropriate to return.

PythonIn [19]
CollapseExpand
from enum import Enum


class Outcome(Enum):
    COMPLETE = "complete"
    PARTIAL = "partial"
    ABSTAIN = "abstain"


@dataclass(frozen=True)
class Option:
    tier: str
    eligible: bool
    available: bool
    candidate: tuple[str, float] | None


@dataclass(frozen=True)
class ServiceResult:
    outcome: Outcome
    text: str
    tier: str | None
    attempted: tuple[str, ...]


def serve(
    options: tuple[Option, ...],
    *,
    safe_excerpt: str | None,
    max_attempts: int,
    threshold: float = 0.65,
) -> ServiceResult:
    attempts = []
    for option in options:
        if len(attempts) >= max_attempts:
            break
        if not option.eligible or not option.available:
            continue
        attempts.append(option.tier)
        if option.candidate is None:
            continue
        text, score = option.candidate
        if score >= threshold:
            return ServiceResult(
                Outcome.COMPLETE, text, option.tier, tuple(attempts)
            )
    if safe_excerpt:
        return ServiceResult(
            Outcome.PARTIAL,
            "Public policy excerpt only. Summary unavailable.\n" + safe_excerpt,
            None,
            tuple(attempts),
        )
    return ServiceResult(
        Outcome.ABSTAIN, "I couldn't verify an answer.", None, tuple(attempts)
    )
PythonIn [20]
CollapseExpand
primary = Option("Primary", True, False, None)
backup = Option(
    "Backup", True, True, ("Fictional returns period: 30 days.", 0.82)
)
unapproved = Option("Unapproved", False, True, ("Unverified answer", 0.99))
timeout = Option("Transient failure", True, True, None)
excerpt = "The demo store accepts unopened returns within 30 days."

complete = serve(
    (unapproved, primary, backup), safe_excerpt=None, max_attempts=2
)
partial = serve((timeout, backup), safe_excerpt=excerpt, max_attempts=1)
abstain = serve((unapproved, primary), safe_excerpt=None, max_attempts=2)

assert complete.outcome is Outcome.COMPLETE and complete.attempted == (
    "Backup",
)
assert partial.outcome is Outcome.PARTIAL and partial.attempted == (
    "Transient failure",
)
assert abstain.outcome is Outcome.ABSTAIN and abstain.attempted == ()
assert serve((backup,), safe_excerpt=None, max_attempts=0).attempted == ()
borderline = Option("Exact threshold", True, True, ("Fixture answer", 0.65))
assert (
    serve((borderline,), safe_excerpt=None, max_attempts=1).outcome
    is Outcome.COMPLETE
)
no_answers = measure(rows, (0, 1, 2), 1.1)
assert no_answers.answered_accuracy is None
assert "answered accuracy=undefined" in format_benchmark(
    "Always abstain", no_answers
)
for result in (complete, partial, abstain):
    print(
        f"{result.outcome.value} | tier={result.tier} | attempts={result.attempted}"
    )
ConsoleOut [20]
CollapseExpand
complete | tier=Backup | attempts=('Backup',)
partial | tier=None | attempts=('Transient failure',)
abstain | tier=None | attempts=()

These fixtures prove the route and outcome for their scripted conditions. They do not estimate real availability. If F1F_1 and F2F_2 are the failure events for two attempts, joint failure is P(F1)P(F2∣F1)P(F_1)P(F_2\mid F_1) when P(F1)>0P(F_1)>0. If P(F1)=0P(F_1)=0, joint failure is zero. It equals the product of marginal failure rates under independence. A shared network, region, or upstream dependency can make failure on the backup more likely given failure on the primary.

Abstention: Knowing When to Decline

Abstention is a deliberate outcome for a request the service could not answer under its current policy. That is different from an unclassified exception. The caller receives a response with an outcome, suitable for offering search or a human handoff in a real product. Keep the reason visible to the operator, because a high abstention rate can reflect an outage, a stricter verification rule, or straightforward gaps in content.

For the benchmark, choose returns no tier exactly when every score is below the threshold. We can replay the fixed large-tier answer on those cases to get a diagnostic. Its denominator is the set of abstentions. A zero denominator means that there were no abstentions to analyze.

PythonIn [21]
CollapseExpand
withheld = tuple(row for row in rows if choose(row, (0, 1, 2), 0.65)[0] is None)
if withheld:
    alternative_correct = sum(row[2].correct for row in withheld)
    print(
        f"Large tier correct on withheld cases: {alternative_correct}/{len(withheld)}"
    )
else:
    print("No withheld cases")
ConsoleOut [21]
CollapseExpand
Large tier correct on withheld cases: 43/78

Separating availability and acceptance in a trace

The benchmark code has one ordered tuple for candidates and a single predicate for acceptance. The service example uses a different record at the boundary. Each option has two flags the orchestrator knows before a candidate arrives. The request can be parked until one option becomes available, or it can move immediately to the backup, depending on the deadline. In this notebook, the policy moves on immediately when it sees a false availability flag. It keeps a counter of attempted options, which means an unavailable tier skipped before execution has a different effect on the counter from an attempted tier whose call timed out.

For diagnosis, give those cases different names. “Rejected answer” implies that the router had a candidate to evaluate. “Unavailable provider” identifies a dependency that did not offer a candidate at all. If logging both as one generic “fallback” event, a dashboard might show worse traffic to the backup without giving you enough information to decide whether the acceptance threshold changed behavior or the primary lost capacity. To isolate a schoolbook example, vary a flag while keeping the candidate and threshold fixed.

Consider another pair of fixture inputs. An eligible small provider returns a low score. An available but unapproved provider returns a higher one. The execution should consume an attempt for the low-score candidate and skip the unapproved provider without using up the remaining budget. If there is an approved excerpt, returning it advertises its limited scope. If the caller supplies none, the same gate failure leaves the router without an allowed answer.

PythonIn [22]
CollapseExpand
low_score = Option("Eligible, low score", True, True, ("Unverified", 0.41))
for allowed_excerpt in (excerpt, None):
    outcome = serve(
        (low_score, unapproved), safe_excerpt=allowed_excerpt, max_attempts=2
    )
    assert outcome.attempted == ("Eligible, low score",)
    assert outcome.tier is None
    print(outcome.outcome.value, outcome.text.splitlines()[0])
ConsoleOut [22]
CollapseExpand
partial Public policy excerpt only. Summary unavailable.
abstain I couldn't verify an answer.

In production, the caller should give that fallback a provenance boundary too. For example, a catalog service that retains a read-only copy of the storewide return policy may expose its source and freshness when it uses an excerpt. A policy document about consumer returns may be inappropriate for a managed business account. More coverage would then be a misleading success metric, even if the fallback always returns text. A label tells readers what returned, and the eligibility check determines when that path is appropriate in the first place.

A threshold chosen on a single success rate can hide a distribution problem. On a workload dominated by frequently asked questions, an inexpensive route may pass enough easy examples to make its average look strong. Look at structured order queries and requests missing key details on their own as well. A useful evaluation records when each route was both permitted and available, so reviewers can distinguish an improvement in candidate correctness from a change to the policy that filters requests before attempts.

Limitations and Impact

The candidate scores, per-tier costs, and correctness rates were assigned by construction. They let us test the policy using repeatable inputs. To evaluate a deployed router, collect graded candidates from the tiers allowed to serve each request type. Log attempt count, the route, whether the outcome was complete or partial, and whether an answer was withheld. Compare latency and correctness against single-tier baselines.

The benchmark can inspect the simulator's withheld candidates, but a deployment generally cannot know how an unchosen route would have performed without evaluating it separately. A useful offline diagnostic is strong-tier correctness on the subset where the cascade abstained. That diagnostic answers a narrower question than whether the abstention was wrong overall, since the unchosen answer might still have violated an eligibility rule or failed verification.

A routed path also changes what “version of the system” means. Identifying the selected tier and acceptance threshold is part of understanding the result. If either model or verifier changes, rerun the labeled evaluation before drawing a comparison. Performance of the service depends on which route served which request. In the benchmark all that state is represented by the fixed array. In a deployed system it belongs in a request trace with appropriate controls on what the trace retains.

Summary

  • Query routing selects a starting component. A cascade uses an acceptance gate to decide whether to escalate.
  • Compare policies on the same inputs and report coverage, accuracy among answered requests, correct answers per request, and cost.
  • Check eligibility and availability before consuming an attempt. Bound the number of attempts and the time you spend waiting.
  • Give partial service its own outcome. When no allowed route can provide even a useful partial result, abstain.

The next chapter develops the evaluation sets and regression checks that make these outcomes measurable as the system changes.

Quiz

Ready to test your understanding? Take this quick quiz to reinforce what you've learned about routing, fallbacks, and graceful degradation.

Routing, Fallbacks, and Graceful Degradation

Question 1 of 80 of 8 completed
In the three-tier worked example, attempt costs are c₁=1, c₂=4, and c₃=12 credits. Every request reaches tier 1, and the fractions stopping at each tier are 70%, 25%, and 5%. What is the mean attempt cost per request?
Join the discussionAsk a question or share what you learned.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

A different angle
All writing
Language AI Handbook · Vol. 20

Reliability and Cost Engineering

Design reliable, cost-aware AI services with SLOs, retries, idempotency, Little's law, caching, and fault injection under real deadlines.

29 min read
Language AI Handbook · Vol. 20

Evaluation-Driven Development

Build an offline evaluation harness for language systems: versioned task suites, traces, slice scores, and regression gates that block hidden drops.

27 min read
Language AI Handbook · Vol. 20

Versioning Models, Prompts, Data, and Tools

Version AI systems with typed manifests, compatibility checks, canary rollouts, and lineage records that connect requests to their recorded configurations.

28 min read

About the author

Reference

Citation details

Cite or share this article.

BIBTEXAcademic
@misc{brenndoerfer2026routingfallbacks, author = {Michael Brenndoerfer}, title = {Routing, Fallbacks, and Graceful Degradation}, year = {2026}, url = {https://mbrenndoerfer.com/writing/llm-routing-fallbacks-graceful-degradation-cascades}, organization = {mbrenndoerfer.com}, note = {Accessed: 2026-12-03} }
APAAcademic
Michael Brenndoerfer (2026). Routing, Fallbacks, and Graceful Degradation. Retrieved from https://mbrenndoerfer.com/writing/llm-routing-fallbacks-graceful-degradation-cascades
MLAAcademic
Michael Brenndoerfer. "Routing, Fallbacks, and Graceful Degradation." 2026. Web. December 3, 2026. <https://mbrenndoerfer.com/writing/llm-routing-fallbacks-graceful-degradation-cascades>.
CHICAGOAcademic
Michael Brenndoerfer. "Routing, Fallbacks, and Graceful Degradation." Accessed December 3, 2026. https://mbrenndoerfer.com/writing/llm-routing-fallbacks-graceful-degradation-cascades.
HARVARDAcademic
Michael Brenndoerfer (2026) 'Routing, Fallbacks, and Graceful Degradation'. Available at: https://mbrenndoerfer.com/writing/llm-routing-fallbacks-graceful-degradation-cascades (Accessed: December 3, 2026).
SimpleBasic
Michael Brenndoerfer (2026). Routing, Fallbacks, and Graceful Degradation. https://mbrenndoerfer.com/writing/llm-routing-fallbacks-graceful-degradation-cascades
Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy