Fallback ladder
preferred model + RAG
→ smaller approved model + RAG
→ retrieval/search only
→ human escalation
→ explicit unavailable- Every fallback has quality and policy expectations.
Design fallbacks, routing, concurrency and service objectives so the AI feature can handle traffic, failures and budget limits while making explicit trade-offs between quality, latency and cost.
Engineering focus: Production architecture, economics and reliability
Design fallbacks, routing, concurrency and service objectives so the AI feature can handle traffic, failures and budget limits while making explicit trade-offs between quality, latency and cost.
The rest of this module introduces the formal terminology and production controls behind that idea. You are not expected to memorize the vocabulary before using it.
Carry the same support assistant forward: approved KB, source citations, explicit insufficient-evidence fallback and one bounded read-only asset lookup. Reuse prior artifacts so each module adds evidence to one production AI system.
If the preferred model or retrieval dependency is unavailable, the product should define what remains useful: a smaller model, search-only results, cached approved answer, human escalation or explicit temporary unavailability.
Some requests need high reasoning quality; others are extraction, classification or lookup. Routing can reduce latency and cost if evaluation proves the smaller path meets the contract.
Cache deterministic embeddings and stable retrieval where appropriate. Response caching is riskier when user identity, authorization, freshness or personalized context changes the answer.
Long conversations and broad retrieval increase latency and workload. Summarize state, cap histories, deduplicate evidence and make context budgets observable.
Local GPU memory/concurrency or remote rate limits can be the bottleneck. Load tests should model prompt/output sizes and tool/retrieval dependencies, not just requests per second.
A service can return HTTP 200 quickly while producing unusable answers. Pair operational objectives with evaluated task-success, fallback correctness or groundedness targets for the feature.
preferred model + RAG
→ smaller approved model + RAG
→ retrieval/search only
→ human escalation
→ explicit unavailablerequest workload ≈ input/context units + output units + embedding/retrieval + tool calls
monthly cost/capacity = request mix × per-path workloadGoal: Design a measurable production decision table rather than a hard-coded 'always use biggest model' rule.
cat > /tmp/ai-routing.json <<'EOF'
[
{"task":"classification","route":"small-local","fallback":"rules","p95_ms":700},
{"task":"grounded_support","route":"quality-model","fallback":"search-only","p95_ms":1800},
{"task":"privileged_change","route":"none","fallback":"human","p95_ms":0}
]
EOFpython3 - <<'PY2'
import json
x=json.load(open('/tmp/ai-routing.json'))
assert all(r.get('fallback') for r in x)
assert next(r for r in x if r['task']=='privileged_change')['fallback']=='human'
print('PASS: every route has fallback')
PY2For each AI route, record expected context/output size, concurrency, accelerator/API quota and the threshold that triggers load shedding or a fallback route.
Production AI reliability is a property of routing, dependencies, capacity, policy and fallback—not only the model endpoint.
Run a short and long-context request and record timing/counters; use the result to discuss context budgets, not to declare a universal benchmark.
MODEL=${MODEL:-qwen3:8b}; python3 - <<'PY2' > /tmp/long-context.txt
print('approved support evidence ' * 1200)
PY2wc -c /tmp/long-context.txtecho 'Run one short and one long-context request against your approved local model; record total_duration, prompt_eval_count and eval_count.'Concept and scenario checks. Reveal the answer only after you commit to a decision.
Core safety, authorization and evidence contracts, even if capability or presentation degrades.
Different tasks can meet their quality target with different model/cost/latency profiles.
Identity, authorization, freshness and personalized context may change what answer is allowed or correct.
No; operational health alone does not satisfy the feature's outcome reliability objective.
Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.
Attempt the core lab and knowledge checks before marking the module complete.