- Solution Blueprints
- LLM Router
LLM Router
Prompt router that classifies requests and sends them to the best LLM endpoint using configurable routing rules.
Overview

Finding the right Large Language Model (LLM) for a task can be difficult. While the perfect model would be accurate, fast, and inexpensive, real-world systems often force a choice between these competing factors.
This blueprint design presents a routing system that automates this choice. When a user submits a prompt, the system follows this process:
- Applies a Routing Policy: The system uses a defined strategy, such as classifying the prompt by its task type or complexity level.
- Classifies the Prompt: The system analyzes the incoming prompt and assigns it to the correct category from the policy. Two classification approaches are supported: embedding-based and LLM-based (described below).
- Routes to the Optimal LLM: Based on this classification, the system automatically proxies the original prompt to the LLM backend best suited for that specific category—whether optimized for accuracy, speed, or cost.
For example, under a task classification policy, user prompts are analyzed, categorized, and seamlessly sent to the most appropriate model for execution.
| User Prompt | Task Classification | Route To |
|---|---|---|
| “Create a quicksort in go language” | Code Generation | secondary-llm |
| “Based on these three facts: First, water boils at 100°C. Second, ice melts at 0°C. Third, evaporation occurs at various temperatures. What general conclusion can be drawn about states of matter and temperature?” | Summarization | primary-llm |
| “Hello” | Unknown | primary-llm |
AMD Solution Blueprints are packaged as Helm charts for deployment on a Kubernetes cluster. For development or further exploration, the source code is public and available in the Solution Blueprints GitHub repository.
Architecture


The LLM Router is composed of the following components:
| Component | Role |
|---|---|
| Router Controller | A proxy-like service responsible for routing OpenAI-compatible requests |
| Router Classifier | A service that analyzes and classifies the user’s prompt. Supports two classification approaches: embedding-based and LLM-based |
| UI (Gradio) | Web interface for testing routing policies and sending prompts |
| Embedding AIM | Embedding-based classifier backend (default: intfloat/multilingual-e5-large-instruct on Instinct and Radeon) |
| Primary AIM | Lighter-workload backend (default: GPT-OSS 20B on Instinct, Llama 3.1 8B Instruct on Radeon) |
| Secondary AIM | Heavier-workload backend (default: Llama 3.3 70B Instruct on Instinct, Qwen3-VL 8B Instruct on Radeon) |
When deployed with demonstration LLMs (deployDemonstrationLLMs=true), the chart deploys the primary and secondary AIM backends listed in the table above. You can point the models at existing external LLM endpoints instead.