What is Model Routing?
Model routing is a powerful feature that allows you to control how your AI application’s requests are directed to different Large Language Models (LLMs). This enables you to optimize for various factors such as security, cost, performance, and reliability. With Unbound Security AI Gateway, you can define intelligent routing rules that automatically direct requests to the most appropriate models based on content sensitivity, default preferences, and error handling requirements.Watch the Setup Process
For a detailed walkthrough of setting up model routing, watch this demonstration: Watch this video for a quick demonstration of the model routing setup process.Step-by-Step Guide
Step 1: Navigate to Your Application’s Routing Settings
First, access your application’s routing configuration:- From the main sidebar, click on Applications
- Select the specific application you want to configure (e.g., “Test App”)
- In the application’s detail view, click on the Routing tab

- Sensitive Information: Route requests based on guardrail detection
- Default Routing: Configure source-to-destination model routing
- Error Handling: Set up fallback models for error scenarios
Step 2: Configure Sensitive Information Routing
This section allows you to define routing rules based on the presence of sensitive information detected by your configured guardrails.How Sensitive Information Routing Works
- Priority-based execution: Guardrails with higher priority are executed first
- Automatic detection: Requests containing sensitive data are automatically identified
- Secure routing: Sensitive requests are routed to more secure or private models
Setting Up Sensitive Information Routing
- In the Sensitive Information section, click the Reorder button (if rules exist) or add a new rule
- Configure the routing rule:
- Priority Rank: Set the execution order (higher priority = executed first)
- Guardrail: Select which guardrail should trigger this routing (e.g., PII Detection, Secrets Detection)
- Target Model: Choose the model where sensitive requests should be routed
- Save the configuration
Step 3: Set Up Default Routing Rules
Default routing rules determine how requests are handled when no specific sensitive information rules apply.How Default Routing Works
- Source-to-destination mapping: Define which models should handle requests from specific source models
- Fallback configuration: Set up alternative destinations when primary models are unavailable
- Cost optimization: Route to more cost-effective models for non-sensitive requests
Configuring Default Routing
- In the Default Routing section, click Add Default Routing Rule
- Configure the routing rule:
- Source Model: Select the model that will receive the initial request
- Destination Model: Choose where requests from the source model should be routed
- Save the rule and add additional rules as needed
Step 4: Define Error Handling Routing
Error handling routing ensures your application can gracefully handle failures by routing to fallback models.How Error Handling Works
- Error code detection: Monitor for specific HTTP error codes (4xx, 5xx)
- Automatic fallback: Route failed requests to alternative models
- Service continuity: Maintain application availability even when primary models fail
Setting Up Error Handling
- In the Error handling section, click Add Error Routing Rule
- Configure the error handling rule:
- Error Code: Specify the error code (e.g., “429” for rate limits, “5xx” for server errors)
- Target Model: Select the fallback model for this error scenario
- Save the rule and configure additional error scenarios