Token Lab검색

← 모든 실험
모델 라우팅과 폴백 / 5 OF 5

기본 모델 장애 없음

Expected cost is a weighted average without retries.

로컬 계산 / 시뮬레이션

외부 API 없는 로컬 교육용 실험입니다. 합성 데이터는 운영 환경 측정이 아닙니다.

Study guide & lesson outlineLEARNING CONTRACT

Understand → implement → investigate

Goal: explain the mechanism in this lesson, reproduce one example and test a failure case. Reading alone does not mark mastery.

02 · 예측 및 설정

기술 설명, 매개변수 이름과 참고 답변은 현재 영어입니다.

03 · 근거 확인

실행하면 결과가 표시됩니다.

방법과 참고 문헌

Analytical expectation with user-supplied synthetic per-request prices and latencies, not current provider rates. Sequential one-time fallback; failed primary attempts are charged; fallback always succeeds. No quality prediction, queueing, correlated failures or tail-latency model.

Text / 原始公式
E[C]=s(Ccheap+f×Cstrong)+(1−s)Cstrong; E[T]=s(Tcheap+f×Tstrong)+(1−s)Tstrong

A cheaper route may violate task-quality requirements; this estimator does not measure quality.

AWS Builders Library · timeouts, retries and backoff ↗

연습 문제

routing-5 / 01What does “No primary failures” test?

Expected cost is a weighted average without retries.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 02Which computation produces the result in “No primary failures”?

E[C]=s(Ccheap+f×Cstrong)+(1−s)Cstrong; E[T]=s(Tcheap+f×Tstrong)+(1−s)Tstrong

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 03What is the baseline configuration for “No primary failures”?

{"requests":1000,"cheap":0.8,"failure":0,"cheapCost":0.001,"strongCost":0.02,"cheapMs":200,"strongMs":1000}

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 04What numerical result should you check for “No primary failures”?

{"Expected USD/request":0.0048,"Expected total USD":4.8,"Expected latency (ms)":359.99999999999994,"Fallback calls":0}

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 05How would you run a controlled comparison for “No primary failures”?

Keep the supplied fixture and other settings fixed; change failure. Compare expected cost, mean latency and fallback volume with observed production traces.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 06What failure could invalidate a conclusion from “No primary failures”?

A cheaper route may violate task-quality requirements; this estimator does not measure quality.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 07Is “No primary failures” a benchmark of a deployed language model?

No. Analytical expectation with user-supplied synthetic per-request prices and latencies, not current provider rates. Sequential one-time fallback; failed primary attempts are charged; fallback always succeeds. No quality prediction, queueing, correlated failures or tail-latency model.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 08Which evidence should you report for “No primary failures”?

Compare expected cost, mean latency and fallback volume with observed production traces. Export inputs, engine, result and method; distinguish synthetic fixtures from observed production data.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 09How can another researcher reproduce “No primary failures”?

Open routing-5, reset the preset, retain the exact inputs and run. The calculation is deterministic for identical inputs.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
routing-5 / 10What is the next validation step after “No primary failures”?

A cheaper route may violate task-quality requirements; this estimator does not measure quality. Test the hypothesis on a representative held-out workload and document a baseline, success metric and stopping rule before claiming deployment readiness.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

실험 열기 →
MATHEMATICAL REVIEW · 2026-10-26

Assumptions, implementation & acceptance

Failed cheap calls are billed and fallback is assumed successful. Expected latency is serial and excludes queues; aggregate expectation is not p95 latency.

Engine formulas, scenario presets and numerical safeguards reviewed. Seeded synthetic inputs are not a production benchmark.

Classify cheap vs strong route → Charge attempted cheap call → Failure → sequential fallback → Weighted expected cost and latency
Mechanism map: follow the transformations from top to bottom.

Before running: predict a boundary case

Expected cost is a weighted average without retries.

Hint: isolate the assumption

Keep the baseline input fixed, change one parameter or boundary, and compare both the numerical result and the claimed units. A passing example verifies this fixture only.

Minimal executable example

Save the example and linked modules in one folder. Use Node.js 22 or newer, then run node routing-5.mjs. No third-party runtime dependencies.

import {calculate,network} from './academy-core.mjs';
const params={
  "requests": 1000,
  "cheap": 0.8,
  "failure": 0,
  "cheapCost": 0.001,
  "strongCost": 0.02,
  "cheapMs": 200,
  "strongMs": 1000
};
const result=calculate('routing',params);
console.log(result.metrics);

Test and transfer

Expected cost is a weighted average without retries.

Record input, code version, expected result and observed result in the notebook below. Then construct a counterexample that violates the assumption above and explain why the original conclusion no longer follows.

Download complete kit (.tar.gz) · Complete reference kit and regression checks

Predict, test and keep evidence

Before revealing an answer, predict one result. After the exercise, record the discrepancy and a transfer test. Saved locally across language editions.

Open notebook / export / clear →

The mathematical review scope is recorded per lesson. It does not establish empirical paper reproduction; report suspected errors in your notes. Review scope