Skip to content

LLM Router

Prompt router that classifies requests and sends them to the best LLM endpoint using configurable routing rules.

Publisher
AMD

Deployment guide

Getting Started

This is a quick start guide on how to deploy the blueprint. For advanced options, such as connecting to existing LLM endpoints, configuring routing rules, enabling HTTPRoute access, or running the embedding service on CPU instead of GPU, see Deploying Solution Blueprints with Helm or explore the advanced deployment guide.

Prerequisites

System Requirements

This blueprint can be deployed on AMD Instinct (default) and AMD Radeon. The blueprint requires the following cluster resources by default, depending on the hardware being used:

ResourceInstinctRadeon
GPUs11
CPUs4 CPU cores4 CPU cores
RAM192 Gi32 Gi

For demo deployment with self-hosted LLMs (deployDemonstrationLLMs=true), plan for 3 GPUs total (2 demonstration LLMs + 1 embedding service). You can run the embedding service on CPUs instead to reduce the number of GPUs used; see Running the Embedding Service on CPU. If you use external LLM endpoints via models configuration, GPU requirements for those services are defined by their own deployments.

To deploy to the Kubernetes cluster, ensure the following prerequisites are met:

  • kubectl: Installed and configured to communicate with the cluster
  • Helm 3.16 – 4.2.0: Installed on your local machine

Deployment

Solution Blueprints are packaged as OCI-compliant Helm charts in the Docker Hub registry and can be deployed to a Kubernetes cluster with a single command. Define the name (deployment name) and the namespace (Kubernetes namespace), then pipe the output of helm template to kubectl apply -f -.

Find the deployment command below. The examples set deployDemonstrationLLMs=true to deploy with self-hosted AIM backends.

Note: You can create a namespace using kubectl create namespace <my-namespace>.

Terminal window
name="my-deployment"
namespace="my-namespace"
helm template $name oci://registry-1.docker.io/amdenterpriseai/aimsb-llm-router \
--set deployDemonstrationLLMs=true \
| kubectl apply -f - -n $namespace

Verify Deployment

To check the status of the deployment, run:

Terminal window
kubectl get pods -n $namespace

Wait until all pods report Running and Ready.

Connect to UI

To connect to the UI, port-forward to 8080. The UI will then be available at http://localhost:8080 in your browser.

Terminal window
kubectl port-forward services/${name}-aimsb-llm-router-ui 8080:8008 -n $namespace

Using the Router

The LLM Router exposes an OpenAI-compatible API and can be used as a drop-in replacement for existing OpenAI-based applications. Requests keep the standard OpenAI structure, while the router transparently handles model selection based on configured routing logic.

The only required extension is the inclusion of llm-router metadata in the request body. This metadata controls how the request is classified and routed:

  • policy: Defines which classification policy should be applied (by default, task_router or complexity_router).
  • routing_strategy: Specifies how routing decisions are made.
    • auto delegates classification to the router-classifier service.
    • manual skips classification and allows the client to explicitly control routing behavior.

Request format

POST /v1/chat/completions
Content-Type: application/json
Accept: application/json
{
"model": "string | empty",
"messages": [
{
"role": "user | system | assistant",
"content": "string"
}
],
"max_tokens": integer,
"stream": boolean,
"llm-router": {
"policy": "string",
"routing_strategy": "auto | manual",
"model": "string | empty"
}
}

Clean Up

When you are finished, remove the deployed resources using the same deployment command, with kubectl delete instead of kubectl apply. For example, for Instinct use the following command:

Terminal window
helm template $name oci://registry-1.docker.io/amdenterpriseai/aimsb-llm-router \
--set deployDemonstrationLLMs=true \
| kubectl delete -f - -n $namespace

Third-Party Components

This Solution Blueprint uses multiple third-party components. To see the full set of software and Python dependencies, explore the repository source and dependency files. The table below highlights some of the key components. For further license information, refer to each component’s official documentation.

ComponentLicense
FastAPIMIT
GradioApache 2.0
vLLMApache 2.0

Terms of Use

AMD Solution Blueprints are released under the MIT License, which governs the parts of the software and materials created by AMD. Third-party Software and Materials used within the Solution Blueprints are governed by their respective licenses.

Refer to the documentation for additional information and advanced deployment options.

View advanced deployment guide