Build an LLM Router in 12 Steps and 85 Min A tutorial published by Shattered.io walks through building a custom LLM router in under 400 lines of Python 3.12 plus a 93-line test file, designed to cut API costs by sending easy prompts to cheaper models and hard prompts to more expensive ones. The router classifies prompts into tiers, walks a fallback chain across OpenAI, Google and Anthropic, trips a circuit breaker on repeated failures, enforces per-call and daily budgets, and can ask a second vendor's model to verify the first model's answer. The build cites a 4x output-price spread among flagship APIs — GPT-6.2 Sol at $10 per million output tokens, Gemini 4 Neon at $15, and GPT-6.2 Astra and Claude Fable 5.2 at $40 — and ships a fifth GLM-5.4 slot switched off because Zhipu's API access was not confirmed as of December 2, 2026. Four flagship-class API models now sit inside a 4x output-price band. GPT-6.2 Sol lists at $10 per million output tokens, Gemini 4 Neon at $15, and both GPT-6.2 Astra and Claude Fable 5.2 https://platform.claude.com/docs/en/models/fable-5-2/overview at $40. An LLM router turns that spread into savings by sending easy prompts to the cheap end and hard prompts to the expensive end, then falling back to another vendor when one returns a 429. The router built below is under 400 lines of Python 3.12 plus a 93-line test file. It classifies each prompt into a tier, walks a fallback chain across OpenAI, Google and Anthropic, trips a circuit breaker on repeat failures, refuses requests that would break a per-call or daily budget, and can ask a model from a second vendor to check the first model’s answer. A fifth slot for GLM-5.4 ships switched off, because Zhipu’s API access was not confirmed as of December 2, 2026. An earlier Claude and GPT router build https://shattered.io/build-llm-router-claude-gpt-2026/ covered the two-vendor case. This version adds Gemini 4 Neon, a spend ledger, the cross-vendor verifier, and the model lineup that shipped in November. Everything runs offline in demo mode first, so you can test the logic before you spend a cent. Don't miss new tech stories on Google Add Shattered once in the Google app and our stories show up in your news suggestions. Add now https://www.google.com/preferences/source?hl=en&q=https%3A%2F%2Fshattered.io%2F What an LLM Router Does and When It Pays Off A router sits between your application and the model APIs. Your code calls one function. The router decides which model answers, what happens when that model fails, and how much the call costs. Those three jobs choose, survive, account are the whole product, and every router from a 50-line script to a hosted gateway does some version of them. Choosing is the part people notice. A prompt that says summarize this paragraph does not need the most expensive model on the market, and a prompt that asks for a root-cause analysis of a flaky distributed system does not belong on the cheapest. Surviving matters more in production than the choice itself. Every vendor has rate limits, regional incidents and the occasional bad deploy, and a router that retries on a second vendor turns a page at 3 a.m. into a log line. Accounting is what keeps the bill honest. Without a ledger, nobody can say which feature burned the budget. The arithmetic is simple. Take a request with 2,000 input tokens and 500 output tokens. On GPT-6.2 Sol that costs $0.009. On GPT-6.2 Astra it costs $0.036, exactly four times more. If 70% of your traffic is light and 30% is hard an illustrative mix, so measure your own , routing light work to Sol and hard work to Astra costs noticeably less per request on average than the $0.036 of sending everything to Astra, with no change to the hard answers. A router does not pay off everywhere. If your product runs one narrow task, a single well-tested model usually beats a routed pair, because you evaluate once instead of per model. If you make a few hundred calls a month, the engineering time costs more than the savings. And if a regulator or customer contract pins you to one vendor, a cross-vendor chain is off the table. Build or Buy Hosted aggregators such as OpenRouter https://openrouter.ai/google/gemini-4-neon already list Gemini 4 Neon behind one API key, and open-source https://shattered.io/open-source-llm-leaderboards-disagree-kimi-k3-1-pro-glm-5-3-2026/ gateways like LiteLLM and Cloudflare AI Gateway https://shattered.io/cloudflare-ai-gateway-setup-2026/ add routing, caching and logging. Buy when you want that breadth fast. Build when you need policy those products do not express, such as a verifier from a second vendor on high-risk answers, your own spend ledger, or a hard rule that certain prompts never leave a given provider. The code below is small enough that building costs an afternoon. The Routing Table: Four Models, Four Price Points Every number in the router’s config comes from vendor pricing pages checked on December 2, 2026. Prices are per million tokens in US dollars. | Model | Vendor | API ID | Input | Cached input | Output | Status on Dec 2, 2026 | |---|---|---|---|---|---|---| | GPT-6.2 Astra | OpenAI | gpt-6.2-astra | $8 | $0.40 | $40 | Released | | GPT-6.2 Sol | OpenAI | gpt-6.2-sol | $2 | $0.10 | $10 | Released | | Gemini 4 Neon | | gemini-4-neon | $3 | $0.15 | $15 | Released, 1M-token context | | Claude Fable 5.2 | Anthropic | copy from the Fable 5.2 docs | $8 | $0.20 cache read | $40 | Released | | GLM-5.4 | Zhipu AI Z.ai | not confirmed | not published | not published | not published | Coding Plan only, API not confirmed | Several details in that table trip people up. OpenAI separates the product from the endpoint: GPT-6.2 is what ChatGPT calls its chat model, while API users pick GPT-6.2 Astra or GPT-6.2 Sol. OpenAI’s API guidance reportedly points Astra at the most demanding tasks and Sol at complex work at lower cost. There is no standalone gpt-6.2 endpoint to route to. OpenAI also describes promotional pricing on the Astra and Sol variants as available at least through December 31, 2026, so treat the table as a snapshot and keep prices in config, not scattered through code. Anthropic announced Claude Fable 5.2 on November 9 alongside Claude Mythos 5.2. It cut the price from Fable 5.1’s $10 input and $50 output to $8 and $40, and Anthropic says Fable 5.2 generates output up to 30% faster than 5.1. An optional fast mode costs $16 input and $80 output per million tokens and generates up to 2.5 times faster. Fable 5.1 is now the older version, so the router does not include it. Google positions Gemini 4 Neon https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-neon/? bhlid=82dbf16e7aaec18dc4d53ab394a5edfb95dc4c95 between Gemini 4 Hydrogen and Gemini 4 Carbon. Its $0.15 cached-input rate is a 95% discount on the $3 base input price, according to Google, and it exposes four reasoning levels: low, medium, high the default and xhigh. That cache discount makes Neon the natural home for prompts that repeat a long system prompt. GLM-5.4 is the odd row. Zhipu reportedly describes it as its first flagship built on a Loop Transformer, a roughly 750B-scale design that runs 28 layers twice. As of December 2 it is available through the GLM Coding Plan https://shattered.io/glm-5-4-vs-glm-5-3-no-open-weights-coding-plan-from-18-nov-26/ and partner coding tools, but Zhipu reportedly said its API would open only after a safety evaluation, and a third-party model tracker entry https://minutesofai.com/model-tracker/z-ai-glm-5-4 does not change that. The router therefore ships a disabled GLM slot with no prices, and you flip it on when the API goes live. Prerequisites and Versions Set these up before step 1. The versions below are the ones the code was tested against. - Python 3.12 or newer. The code uses X | None type hints and was tested on 3.12.3. - httpx 0.29.0. Any recent 0.27+ release should work. The router uses AsyncClient only. - pytest and pytest-asyncio. Needed for the test suite in step 11. - Three API keys for the live run: OPENAI API KEY , GEMINI API KEY and ANTHROPIC API KEY . Demo mode needs none of them. - The exact Claude Fable 5.2 model ID, copied from Anthropic’s model overview page and exported as FABLE MODEL ID . The router refuses to guess it. - A spending cap on every vendor dashboard. The live smoke test in step 12 costs well under $2, but a loop bug can cost more. - A Linux, macOS or WSL shell. Windows PowerShell users swap source .venv/bin/activate for .venv\Scripts\Activate.ps1 . - About 85 minutes, most of it reading the code you paste. You also need basic comfort with async / await . The router awaits one HTTP call at a time, so there is no concurrency to reason about, but every provider method is a coroutine. Router Design: Tiers, Fallback Chains, Breakers and Budgets The design has five moving parts, and each maps to one file. Tiers. A cheap heuristic scores every prompt as light, standard or hard. It looks at word count, code fences and trigger words such as refactor or trade-offs. A heuristic is deliberately dumb. It costs nothing, it never fails, and you can read its decisions in a log. Teams that outgrow it can swap in a small model as the classifier later, and the rest of the router does not change. Chains. Each tier maps to an ordered list of models. The first available model answers. If it fails with a retryable error, the router moves down the list. The order encodes policy: light prompts start at Sol, standard ones at Neon, hard ones at Astra. Circuit breaker. Three consecutive retryable failures open the breaker for a model, and it stays open for 60 seconds. During that window the router skips the model without calling it, which saves latency and keeps you from hammering a vendor that is already struggling. Budget guard. Before each call the router computes a worst-case cost from the prompt length and the output cap. A model whose worst case exceeds $0.50 is skipped for that request. A ledger file totals the last 24 hours of spend, and the router stops at $20. Verifier. For answers that matter, a second call goes to a model from a different vendor, which grades the first answer as pass or fail with a one-sentence reason. Using another vendor avoids the habit models have of approving their own work. OpenAI’s model selection guide https://developers.openai.com/api/docs/guides/model-selection covers picking among one vendor’s models, and a router extends the same trade-off across vendors. | Tier | First choice | Fallback order | Typical prompts | Why this order | |---|---|---|---|---| | light | Sol | Neon, Fable, Astra | Summaries, extraction, reformatting | Lowest price at $2 in and $10 out | | standard | Neon | Sol, Fable, Astra | Question answering with context, drafting, mid-size code edits | Cheap cached input and a 1M-token window | | hard | Astra | Fable, Neon, Sol | Architecture reviews, root-cause analysis, multi-step plans | Strongest tier first, cross-vendor second | The hard chain puts Fable second on purpose. If OpenAI is down, the next-best answer should come from a different vendor, not from Sol on the same failing API. Steps 1 to 3: Project, Model Table, Task Classifier Step 1: Create the project and virtual environment Make a folder, a virtual environment, and install the three dependencies. Pin the versions in a requirements file so a teammate gets the same behavior. mkdir llmrouter && cd llmrouter python3 -m venv .venv source .venv/bin/activate pip install httpx==0.29.0 pytest==9.2.0 pytest-asyncio==1.5.0 mkdir llmrouter tests touch llmrouter/ init .py printf ' pytest \nasyncio mode = auto\nasyncio default fixture loop scope = function\n' pytest.ini pip freeze requirements.txt The pytest.ini line matters. With asyncio mode = auto , every async def test runs without a decorator, and the fixture-scope line silences a deprecation warning from pytest-asyncio. Step 2: Write the model table Create llmrouter/config.py . It holds the price table, the tier chains, and the four numeric limits. Nothing else in the project hard-codes a price. python import os from dataclasses import dataclass @dataclass frozen=True class Model: key: str provider: str model id: str in per m: float out per m: float cached per m: float enabled: bool = True long ctx tokens: int = 0 def build models - dict str, Model : return { "astra": Model "astra", "openai", "gpt-6.2-astra", 8.00, 40.00, 0.40, long ctx tokens=272 000 , "sol": Model "sol", "openai", "gpt-6.2-sol", 2.00, 10.00, 0.10 , "neon": Model "neon", "gemini", "gemini-4-neon", 3.00, 15.00, 0.15 , "fable": Model "fable", "anthropic", os.environ.get "FABLE MODEL ID", "SET FABLE MODEL ID" , 8.00, 40.00, 0.20, enabled="FABLE MODEL ID" in os.environ, , "glm": Model "glm", "zai", os.environ.get "GLM MODEL ID", "SET GLM MODEL ID" , 0.0, 0.0, 0.0, enabled=os.environ.get "GLM API OPEN" == "1", , } CHAINS = { "light": "sol", "neon", "fable", "astra" , "standard": "neon", "sol", "fable", "astra" , "hard": "astra", "fable", "neon", "sol" , } MAX REQUEST USD = 0.50 DAILY BUDGET USD = 20.00 BREAKER THRESHOLD = 3 BREAKER COOLDOWN S = 60 Two design choices deserve attention. First, the Fable model ID and the GLM slot read from the environment, and each model’s enabled flag follows whether you supplied the ID, so a missing ID disables the model instead of sending a bad request. Second, GLM carries zero prices and stays off until you set GLM API OPEN=1 . A zero price would otherwise make GLM look free to the cost guard, which is exactly the wrong signal. Step 3: Write the task classifier Create llmrouter/classify.py . The scoring is intentionally crude, and every rule is visible. python import re HARD = re.compile r"\b prove|derive|formal|architecture|refactor|security review|" r"root cause|migrate|optimi sz e|multi-step|trade-?offs? \b", re.I LIGHT = re.compile r"\b summari sz e|translate|rewrite|classify|extract|tl;?dr|" r"fix typo|format \b", re.I def classify prompt: str - str: words = len prompt.split score = 0 if words 400: score += 2 elif words 120: score += 1 if " " in prompt: score += 1 score += 2 len HARD.findall prompt score -= len LIGHT.findall prompt if score = 3: return "hard" if score <= 0 and words < 80: return "light" return "standard" Walk through the logic once. A prompt over 400 words adds 2 points, over 120 words adds 1, and a code fence adds 1. Each hard-keyword hit adds 2, and each light-keyword hit subtracts 1. A score of 3 or more is hard. A score of 0 or less on a short prompt is light. Everything else is standard. Summarize this paragraph scores minus 1 and lands in light. A request to review an architecture and its trade-offs, then refactor, scores 6 and lands in hard. Resist the urge to tune these numbers on a hunch. Log the tier for every request, review a week of traffic, and adjust against real misroutes. Steps 4 and 5: Provider Adapters and the Spend Ledger Step 4: Write the provider adapters Create llmrouter/providers.py . Two adapter classes cover three vendors. OpenAICompat speaks the chat-completions format, which OpenAI uses natively and which Gemini offers through an OpenAI-compatible endpoint, so one class serves both with a different base URL, key variable and token-limit parameter name. AnthropicMessages speaks Anthropic’s Messages format. python import os import time from dataclasses import dataclass import httpx class ProviderError Exception : def init self, msg: str, retryable: bool : super . init msg self.retryable = retryable @dataclass class Completion: text: str in tokens: int out tokens: int cached tokens: int latency s: float def key env: str - str: try: return os.environ env except KeyError: raise SystemExit f"Missing {env}. Export it or run with --demo." from None def raise for resp: httpx.Response - None: if resp.status code < 400: return retry = resp.status code in 408, 409, 429 or resp.status code = 500 raise ProviderError f"HTTP {resp.status code}: {resp.text :200 }", retry class OpenAICompat: def init self, base url: str, key env: str, token param: str : self.base url, self.key env, self.token param = base url, key env, token param async def complete self, model id, system, prompt, max tokens, client=None : msgs = {"role": "system", "content": system} if system else msgs.append {"role": "user", "content": prompt} body = {"model": model id, "messages": msgs, self.token param: max tokens} hdr = {"Authorization": f"Bearer { key self.key env }"} t0 = time.monotonic try: async with client or httpx.AsyncClient timeout=120 as c: r = await c.post f"{self.base url}/chat/completions", json=body, headers=hdr except httpx.TransportError as e: raise ProviderError str e , True from e raise for r d = r.json u = d.get "usage", {} cached = u.get "prompt tokens details" or {} .get "cached tokens", 0 return Completion d "choices" 0 "message" "content" or "", u.get "prompt tokens", 0 , u.get "completion tokens", 0 , cached, time.monotonic - t0 class AnthropicMessages: url = "https://api.anthropic.com/v1/messages" async def complete self, model id, system, prompt, max tokens, client=None : body = {"model": model id, "max tokens": max tokens, "messages": {"role": "user", "content": prompt} } if system: body "system" = system hdr = {"x-api-key": key "ANTHROPIC API KEY" , "anthropic-version": "2023-06-01"} t0 = time.monotonic try: async with client or httpx.AsyncClient timeout=120 as c: r = await c.post self.url, json=body, headers=hdr except httpx.TransportError as e: raise ProviderError str e , True from e raise for r d = r.json u = d.get "usage", {} text = "".join b.get "text", "" for b in d "content" if b "type" == "text" return Completion text, u.get "input tokens", 0 , u.get "output tokens", 0 , u.get "cache read input tokens", 0 , time.monotonic - t0 def default providers - dict: return { "openai": OpenAICompat "https://api.openai.com/v1", "OPENAI API KEY", "max completion tokens" , "gemini": OpenAICompat "https://generativelanguage.googleapis.com/v1beta/openai", "GEMINI API KEY", "max tokens" , "anthropic": AnthropicMessages , "zai": OpenAICompat os.environ.get "ZAI BASE URL", "https://example.invalid" , "ZAI API KEY", "max tokens" , } Five details in this file carry most of the weight. The ProviderError.retryable flag decides everything downstream. Rate limits, request timeouts, server errors and dropped connections are retryable. A bad request, a rejected key, a forbidden call or an unknown model ID is not. Those mean your request, your key or your model ID is wrong, and falling through to the next vendor would only hide a bug that will bite you again tomorrow. The token-limit parameter differs by vendor. OpenAI’s adapter sends max completion tokens and the Gemini adapter sends max tokens . If a vendor rejects the parameter name with a 400, the fix lives in one constructor argument. Cached tokens come back in different places. OpenAI-style responses report them under usage.prompt tokens details.cached tokens , while Anthropic reports cache read input tokens . The adapters normalize both into Completion.cached tokens , which lets the cost function treat them identically. Anthropic’s adapter sends no thinking or effort parameters. Anthropic’s Fable 5.2 documentation says adaptive thinking is the only thinking mode on that model, so there is no manual budget to set. If you later add reasoning controls for Neon’s low, medium, high and xhigh levels, keep them in the vendor adapter and out of the router. The key helper turns a missing environment variable into a one-line message instead of a stack trace. You will hit it the first time you forget to export a key. Step 5: Write the spend ledger Create llmrouter/ledger.py . The ledger appends one JSON line per successful call and sums the last 24 hours on demand. python import json import time from pathlib import Path class Ledger: def init self, path: str = "spend.jsonl" : self.path = Path path def record self, row: dict - None: row = {"ts": time.time , row} with self.path.open "a" as f: f.write json.dumps row + "\n" def spent today self - float: if not self.path.exists : return 0.0 cutoff = time.time - 86400 total = 0.0 for line in self.path.read text .splitlines : row = json.loads line if row "ts" = cutoff: total += row.get "usd", 0.0 return total A flat file looks primitive next to a database, but it survives restarts, you can read it with tail , and you can load it into a spreadsheet at month end. The cost is that spent today reads the whole file on every call. At a few thousand calls per day that takes milliseconds. Past that, rotate the file daily or move the totals into SQLite, which is a one-class change because nothing else touches the file. Steps 6 to 8: Router Core, Circuit Breaker and Cost Guard Step 6: Write the router core Create llmrouter/router.py . This file holds the whole decision loop: check the daily budget, pick a tier, walk the chain, skip anything unavailable or too expensive, call the provider, record the spend. python import time from dataclasses import dataclass, field from . import config from .classify import classify from .ledger import Ledger from .providers import Completion, ProviderError class BudgetExceeded Exception : pass class AllModelsFailed Exception : pass @dataclass class RouteResult: text: str model: str tier: str usd: float attempts: list = field default factory=list verdict: str | None = None def long ctx m: config.Model, tokens in: float - tuple float, float : if m.long ctx tokens and tokens in m.long ctx tokens: return 2.0, 1.5 return 1.0, 1.0 def usd cost m: config.Model, c: Completion - float: im, om = long ctx m, c.in tokens fresh = max c.in tokens - c.cached tokens, 0 return im fresh m.in per m + c.cached tokens m.cached per m + om c.out tokens m.out per m / 1 000 000 def worst case usd m: config.Model, prompt: str, max tokens: int - float: est in = len prompt / 4 + 50 im, om = long ctx m, est in return im est in m.in per m + om max tokens m.out per m / 1 000 000 class Router: def init self, models, providers, ledger=None, clock=time.monotonic : self.models, self.providers = models, providers self.ledger = ledger or Ledger self.clock = clock self.fails: dict str, int = {} self.open until: dict str, float = {} def available self, key: str - bool: m = self.models.get key if m is None or not m.enabled: return False return self.clock = self.open until.get key, 0.0 def trip self, key: str - None: self.fails key = self.fails.get key, 0 + 1 if self.fails key = config.BREAKER THRESHOLD: self.open until key = self.clock + config.BREAKER COOLDOWN S self.fails key = 0 async def route self, prompt, system=None, tier=None, max tokens=1024, only: str | None = None : if self.ledger.spent today = config.DAILY BUDGET USD: raise BudgetExceeded "daily budget spent" tier = tier or classify prompt chain = only if only else config.CHAINS tier attempts = for key in chain: if not self. available key : attempts.append key, "skipped: disabled or breaker open" continue m = self.models key if worst case usd m, prompt, max tokens config.MAX REQUEST USD: attempts.append key, "skipped: over per-request cap" continue try: c = await self.providers m.provider .complete m.model id, system, prompt, max tokens except ProviderError as e: attempts.append key, f"error: {e}" if e.retryable: self. trip key continue raise self.fails key = 0 usd = usd cost m, c self.ledger.record {"model": key, "tier": tier, "usd": usd, "in": c.in tokens, "out": c.out tokens} attempts.append key, "ok" return RouteResult c.text, key, tier, usd, attempts raise AllModelsFailed attempts Read the route method top to bottom once. It first refuses outright if the ledger says you have spent the daily cap. It then resolves the tier, using your explicit tier if you passed one and the classifier otherwise. The loop that follows visits each model in the chain. A model that is disabled, in breaker cooldown, or too expensive for this request gets a skip note in attempts and the loop moves on. A retryable error gets recorded, counts against the breaker, and moves on as well. A fatal error raises immediately. A success records the spend and returns. The attempts list is the most useful debugging tool in the project. Every result carries the full trail of what the router tried, in order, with the reason for each skip. When a user asks why a request took four seconds or why it cost more than expected, the answer sits in that list. The only argument forces a single model and skips the chain. The verifier uses it in step 9 to pin the check to a specific second-vendor model. Step 7: Understand the circuit breaker The breaker lives in three lines of the class, and it is worth reading closely because the behavior is subtler than it looks. php def available self, key: str - bool: m = self.models.get key if m is None or not m.enabled: return False return self.clock = self.open until.get key, 0.0 def trip self, key: str - None: self.fails key = self.fails.get key, 0 + 1 if self.fails key = config.BREAKER THRESHOLD: self.open until key = self.clock + config.BREAKER COOLDOWN S self.fails key = 0 The failure counter resets to zero on every success, so the threshold of 3 means three failures in a row, not three failures per hour. When the breaker opens, open until is set 60 seconds out and available returns false until the clock passes it. The clock is injectable, which is how the test in step 11 jumps forward 61 seconds without sleeping. This is a simplified breaker. A production-grade one has a half-open state that lets exactly one probe request through after the cooldown, and it only closes fully if that probe succeeds. Here, the first request after cooldown goes through with a fresh counter, so a still-broken vendor needs three more failures to trip again. For a router that falls back on every failure anyway, that costs you three slow requests every minute, which is acceptable. If it is not, add the half-open probe. Tune the two numbers against vendor behavior. Rate-limit storms often clear in seconds, so a 60-second cooldown can be too long for a workload dominated by rate limits. Regional outages last minutes to hours, so 60 seconds is too short for those. Many teams settle on a short cooldown for rate limits and a longer one for server errors, which means passing the status class into trip . Step 8: Understand the cost guard The guard has two layers. The per-request layer is worst case usd , which estimates input tokens at one per four characters plus 50 for message framing, adds the full max tokens output allowance, and prices the sum at the model’s rates. If that worst case exceeds MAX REQUEST USD , the router skips the model for this request. The daily layer is the ledger total, which stops everything at DAILY BUDGET USD . The estimate runs pessimistic on output, since it assumes the model uses every allowed token, and approximate on input, since four characters per token is a rule of thumb that drifts for code and non-English text. That is fine for a guard. It does not need to be exact, it needs to catch a 300,000-token prompt before it reaches an expensive model. The long-context multiplier in long ctx exists because of a pricing rule on OpenAI’s GPT-6.2 Astra model page. For requests above 272K input tokens, input and cache rates double and output costs 1.5 times the short-context rate for the whole request. A guard that ignores this would estimate a 300K-token Astra call at about $2.40 for input when the real figure is closer to $4.80. The test test long context surcharge pins the behavior. OpenAI’s Sol page may carry its own thresholds, so check it before you extend the rule to that model. Pick the per-request cap from your own traffic. At $0.50, an Astra call with a modest output survives until the prompt gets very long, because the input is what dominates the cost. That suits most chat and coding workloads and blocks accidental whole-repository pastes. Steps 9 and 10: Cross-Vendor Verifier and Command-Line Entry Point Step 9: Add the cross-vendor verifier Create llmrouter/verify.py . After a model answers, the verifier asks a model from a different vendor to grade the answer and return strict JSON. python import json from .router import RouteResult, Router VERIFIER SYSTEM = "You are a strict reviewer. Reply with JSON only: " '{"verdict": "pass" or "fail", "reason": "