Control Theories // T21 · 6 min read

T21: Cost-Aware Multi-Model Routing

Provider choices require live verified prices and context/ability constraints. Grounded mathematical formulation, preconditions, falsification experiment, and closure contract for T21.

expected_cost = input_toks·pi + output_toks·po + retry_cost

Formal statement

expected_cost = input_toks·pi + output_toks·po + retry_cost

Thesis

Provider choices require live verified prices and context/ability constraints.

Executable interpretation

Local-first when suitable; cascade only after error, rate-limit or quality deficit. Where state is unknown, return UNKNOWN rather than inventing an observation. Every mutation must have a defined authorization tier, observability plan, budget and failure path.

Operational preconditions

  • A signed-or-recorded mission contract exists with a clear operator, scope and success tests.
  • All relevant sources carry stable IDs and provenance; generated conclusions are not silently promoted to source facts.
  • Cost/risk gates are hard constraints; optimization is secondary to permitted effects.

Discriminating experiment

USD per verified outcome, failover regret, latency. Evaluate on at least a frozen baseline and a controlled ablation; document task mix, environment, seeds, costs, failure traces and counterexamples. No benchmark claim may be promoted solely from this card.

Evidence & exit criteria

  1. Record observed before, proposed change, and observed after state separately.
  2. Reject unsupported success; choose blocked, partial or verified based on receipts.
  3. Log unsatisfied preconditions and stop conditions. Reattempt only within approved budget.

Failure modes

  • False confidence from a readable but stale RAG source.
  • Ambiguous permissions or excessive capability authority.
  • Using an internal simulation result as an external production or official evaluation score.

Closure contract

Pass only when the experiment has reproducible evidence, expected failure path is observed, the implementation is regression-safe and the operator has approved any high-risk action.

Repository Binding & Production Application

Theory T21 (Cost-Aware Multi-Model Routing) binds directly to alrazzi/cognition/ in the Al-Razzi OS Closure repository. Rather than treating LLM outputs as authoritative truth, engineering teams pair this control invariant with signed mission contracts and replayable regression suites.

Teams implementing T21 in production environments typically combine the open reference code with The 2026 Agentic Engineering Guide and the deployable MOUSSAIF XT Sovereign OS runtime.

Deploy This System — OS, eBooks & Services

Turn the principles in T21 into running infrastructure using verified Al-Razzi & Moussaif stack releases, technical manuals, and turnkey engineering services.

Continue Reading Across Al-Razzi OS