Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add LuuOW/meridian-mcp --skill multi-llm-routinggit clone --depth 1 https://github.com/LuuOW/meridian-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/luuow/meridian-mcp/multi-llm-routing)<a href="https://agentmods.dev/skills/luuow/meridian-mcp/multi-llm-routing"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/multi-llm-routing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/multi-llm-routing"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/multi-llm-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00047 | $0.02553 |
| Opus 5 | $0.00023 | $0.01277 |
| Sonnet 5 | $0.00009 | $0.00511 |
| Haiku 4.5 | $0.00005 | $0.00255 |
Grade A, and why
multi-llm-routing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 253 lines — stays where its author put it; the contents beside it link to each section on GitHub.
multi-llm-routing
Covers intelligent routing across multiple LLM providers: cost tiers, latency SLAs, provider health, fallback chains, and a unified client that hides provider-specific quirks.
1) Provider registry
from dataclasses import dataclass, field
from enum import Enum
class Provider(str, Enum):
ANTHROPIC = "anthropic"
OPENAI = "openai"
MISTRAL = "mistral"
GROQ = "groq"
@dataclass
class ModelSpec:
provider: Provider
model_id: str
context_window: int
cost_in: float # USD per 1M input tokens
cost_out: float # USD per 1M output tokens
avg_latency_ms: float # p50 from benchmarks
tier: int # 1=heavy, 2=standard, 3=fast/cheap
MODEL_REGISTRY: dict[str, ModelSpec] = {
"opus": ModelSpec(Provider.ANTHROPIC, "claude-opus-4-6", 200_000, 15.0, 75.0, 4000, 1),
"sonnet": ModelSpec(Provider.ANTHROPIC, "claude-sonnet-4-6", 200_000, 3.0, 15.0, 1500, 2),
"haiku": ModelSpec(Provider.ANTHROPIC, "claude-haiku-4-5-20251001", 200_000, 0.8, 4.0, 500, 3),
"gpt4o": ModelSpec(Provider.OPENAI, "gpt-4o", 128_000, 5.0, 15.0, 2000, 2),
"gpt4o-m": ModelSpec(Provider.OPENAI, "gpt-4o-mini", 128_000, 0.15, 0.6, 700, 3),
"mistral-l": ModelSpec(Provider.MISTRAL, "mistral-large-latest", 128_000, 2.0, 6.0, 1800, 2),
"llama3": ModelSpec(Provider.GROQ, "llama3-70b-8192", 8_192, 0.59, 0.79, 300, 3),
}
2) Routing logic
import asyncio, time
from typing import Literal
TaskType = Literal["reasoning", "extraction", "classification", "generation", "summarisation", "coding"]
TASK_TIER: dict[TaskType, int] = {
"reasoning": 1, # always use heavy model
"coding": 2, # standard
"generation": 2,
"summarisation": 3, # cheap is fine
"extraction": 3,
"classification": 3,
}
# Per-provider health state (updated by health-check loop)
_provider_health: dict[Provider, bool] = {p: True for p in Provider}
def select_model(
task: TaskType,
input_tokens: int,
budget_usd: float | None = None,
max_latency_ms: float | None = None,
prefer_provider: Provider | None = None,
) -> ModelSpec:
tier = TASK_TIER[task]
candidates = [
spec for spec in MODEL_REGISTRY.values()
if spec.tier >= tier
and _provider_health[spec.provider]
and spec.context_window >= input_tokens + 2048 # leave room for output
]
if prefer_provider:
preferred = [c for c in candidates if c.provider == prefer_provider]
if preferred:
candidates = preferred
if max_latency_ms:
candidates = [c for c in candidates if c.avg_latency_ms <= max_latency_ms] or candidates
if budget_usd:
candidates = [
c for c in candidates
if (input_tokens / 1_000_000 * c.cost_in) < budget_usd
] or candidates
# Pick lowest cost from acceptable candidates at target tier
target = [c for c in candidates if c.tier == tier] or candidates
return min(target, key=lambda c: c.cost_in + c.cost_out)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 253 lines · 47 tokens per session scan A 53d192e5c6c2
multi-llm-routing is a skill published in the GitHub repository LuuOW/meridian-mcp (0 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 2,553 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
pydantic-ai
Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.
lynkr
Universal LLM gateway with intelligent routing, Graphify code intelligence, Distill compression, routing telemetry, Code Mode, and 12+ provider support. 60-80% cost reduction for Claude Code, Cursor, and Codex.
liter-llm
Universal LLM API client for 165 providers with native bindings for 14 languages. Use when writing code that calls LLM APIs via liter-llm in Python, TypeScript, Rust, Go, Java, C#, Ruby, PHP, Elixir, WASM, or C, when running the OpenAI-compatible proxy, or when calling LLMs through the MCP server. Covers chat…
calling-llms
Use when sending chat completions through liter-llm and routing to a specific provider via the provider/model prefix. Covers the chat call shape, provider routing, modelhint, message roles, and error categories.
embeddings-and-search
Use when generating embeddings, calling the 12 web-search providers, or running OCR over documents with the 4 OCR providers through liter-llm. Covers embed, search, and ocr methods plus reranking.
running-the-proxy
Use when running the liter-llm api OpenAI-compatible gateway — virtual keys, per-key rate limits, budgets, cost tracking, and model routing. Covers the TOML config and the 22 REST endpoints.