llm-router

Routes LLM tasks to providers based on task type, environment config, and fallback rules.

9|Updated May 8, 2026
One-click install
npx skills add https://github.com/simpletibr/simplicio-loop-marketing --skill llm-router-simpletibr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: llm-router
Source: https://github.com/simpletibr/simplicio-loop-marketing/tree/main/.skills/llm-router
Command: npx skills add https://github.com/simpletibr/simplicio-loop-marketing --skill llm-router-simpletibr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Hardcoding a specific LLM provider into every text-generating step makes pipelines brittle and expensive to maintain. This Skill centralizes provider selection so any task (caption, script, compliance, humanization) is routed to the right model based on a configuration matrix, with automatic fallback when a provider fails. ## Core Features & Use Cases - Task-based routing: Maps task types like caption, script, compliance, and humanization to default and fallback providers using a PROVIDERS.md matrix and .env keys. - Override support: Honors provider_override arguments and per-piece overrides declared in .specs/pieces/*.md files. - Fallback and logging: Retries with a fallback provider on network or quota errors and appends usage records (tokens, cost, outcome) to data/llm-usage.jsonl. - Use Case: A caption-generation skill calls the router with task: caption; the router resolves the configured provider (e.g., deepseek), verifies its API key exists, executes the call, and logs token usage and estimated cost. ## Quick Start Ask the agent to route a caption task with the prompt "Hook for IG reel about color analysis" through the LLM router and return the generated text with the provider used.

Frequently Asked Questions about llm-router

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I route LLM tasks to different providers dynamically?▼

Define a task-to-provider matrix in a PROVIDERS.md file and resolve provider keys from a .env file at runtime. The router looks up the task type, picks the default provider, and falls back to a secondary provider if the primary call fails.

How to make an LLM pipeline provider-agnostic?▼

Centralize all model calls behind a single routing layer that maps task types to providers via configuration instead of code. Callers pass only a task key and prompt, so swapping providers requires editing the matrix and .env, not the calling skills.

Can I force a specific LLM provider for one request?▼

Yes, pass a provider_override argument or declare provider_override.llm_text in a piece file. The override bypasses the routing matrix, but the provider id must be registered in PROVIDERS.md or the request is refused.

What happens when the primary LLM provider fails?▼

On network or quota errors, the router retries once with the configured fallback provider. If both fail, it surfaces the second error and writes a failure record with outcome "failed" to data/llm-usage.jsonl.

How do I track LLM token usage and cost per task?▼

Each routed call appends a JSON line to data/llm-usage.jsonl containing timestamp, task, provider used, tokens in and out, estimated cost in USD, and outcome. This log supports per-task cost analysis across providers.