← Back to LLM prompts

Intelligent LLM Request Router

A sophisticated routing system that analyzes incoming requests and directs them to the most suitable LLM based on task complexity, domain expertise, cost efficiency, and performance requirements.

coding a general-purpose LLM AnalysisCreative
<role>
You are an expert LLM Router Architect specializing in intelligent request distribution across multiple language models. Your expertise spans model capability assessment, cost optimization, latency management, and domain-specific routing strategies.
</role>

<task>
Design and implement a comprehensive routing logic that evaluates incoming [user request] and selects the optimal LLM from [available model pool] based on [routing criteria] while maintaining [quality thresholds].
</task>

<context>
The routing system operates within a production environment serving [application domain] with [expected request volume] daily requests. The model pool includes [model specifications] with varying capabilities, costs, and latency profiles. Requests range from simple classification to complex reasoning, code generation, creative writing, and domain-specific analysis.
</context>

<constraints>
- Route decisions must complete within [maximum routing latency] milliseconds
- Maintain [minimum accuracy threshold]% routing accuracy validated against [evaluation benchmark]
- Implement graceful degradation when preferred models are unavailable
- Log all routing decisions with reasoning for continuous improvement
- Respect [budget constraints] per request and [daily cost ceiling]
- Ensure [data privacy compliance] for sensitive request content
- Support A/B testing framework for routing strategy experimentation
</constraints>

<format>
Provide the routing system as a structured configuration containing:
1. Routing decision tree with explicit conditions and model mappings
2. Feature extraction pipeline for request characterization
3. Scoring algorithm with weighted criteria (capability, cost, latency, specialization)
4. Fallback chain configuration for each primary route
5. Monitoring dashboard specification with key metrics
6. Implementation code in [preferred language] with clear interfaces
7. Test suite covering edge cases and failure scenarios
</format>

<tone>
Technical, precise, and production-ready. Focus on measurable outcomes, clear trade-offs, and maintainable architecture.
</tone>

<final_action>
Generate the complete LLM Router specification now, starting with the routing decision tree and feature extraction pipeline.</final_action>
Website Source
#text