Creating an LLM Proxy
You can configure the LLM Proxy to use different models and different routes.
| A large Flex Gateway supports up to 50 LLM Proxies. |
Before You Begin
-
Deploy a Flex Gateway version 1.11.4 or later where you want to deploy your LLM Proxy.
-
Ensure you have the API Manager API Creator permission.
-
Retrieve your API keys from your LLM Providers.
-
Configure a semantic service if you want to use semantic routing.
Create an LLM Proxy
-
From API Manager, click LLM Proxies.
-
Click + Add LLM Proxy.
-
Configure the Inbound Endpoint of the LLM Proxy:
-
Define a LLM Proxy Name.
-
Select an endpoint Format:
-
OpenAI: Select the OpenAI API format to send requests to all supported LLM Providers (including Gemini).
-
Gemini: Select the Gemini API format to send requests to only Gemini.
-
-
Define a Base path.
-
Select Advanced options if necessary.
-
Click Next.
-
-
Select a Flex Gateway to deploy the server instance to from Select a gateway.
-
Configure the routes that comprise the Outbound Endpoint:
-
Select your LLM Provider.
-
Ensure the URL for your provider is correct. Edit if necessary.
-
Configure access details for the provider endpoint.
-
Select a Static or Dynamic API Key. If selecting Dynamic API Key, define a DataWeave script to extract the API Key from the incoming request.
-
Select a Target Model to override the model version specified in the payload. Selecting Not Applicable sends the request to the specified model. A Target Model is required for semantic routing.
To configure a target model for Amazon Bedrock Claude Modes, you must enter the provider and model ID formatted as
[provider_prefix]/[internal_model_id].To learn how to find the model ID, see Amazon Bedrock Model Names.
-
Click Add LLM Route to add additional routes. Complete the previous steps to configure the new route. Each LLM Provider supports one route.
-
-
If adding multiple routes, select a Routing strategy. To configure your routing strategy, see:
-
Click Save & Deploy.
Configure Model-Based Routing
-
Configure multiple routes. Click Add LLM Route to create new routes.
-
Select Model-based for Routing strategy.
-
Choose to enable a Fallback route for the request to be sent to if the provider or model is incorrectly sepcified. If enabling a fallback route:
-
Select a Route to fallback to.
-
Select a target model for the fallback route to use.
-
-
If no fall back route is configured and a route fails, a error response is returned.
-
Return to Create an LLM Proxy step 7 to finish configuring your LLM Proxy.
Configure Semantic Routing
To configure semantic routing:
-
Make sure you have already Configured a semantic service.
-
Configure multiple routes and select a target model for each route. Click Add LLM Route to create new routes.
-
Select Semantic for Routing strategy.
-
Click Select a service and select a service.
-
Define or select a prompt topic for the routes:
-
Advanced scale semantic service:
-
Select prompt topics from your predefined prompt topics.
-
-
Basic scale semantic service:
-
Click the Select prompt topics.
-
Click + Create prompt topic.
-
Define a Prompt topic name.
-
Define a Prompt utterances or click Upload utterances to upload a plain text file containing your prompt utterances.
-
Click Create.
-
Create multiple prompt topics for each route as needed.
-
-
-
Configure a Fallback route for the request to be sent to if it doesn’t match a semantic route:
-
Specify an accuracy threshold. When the accuracy of the semantic match is less than this threshold, traffic is sent to the fallback route.
-
Select a Route to fallback to.
-
Select a Target model for the fallback route to use.
-
-
Create a Semantic prompt guard to block users from asking the server about specific topics:
-
Advanced scale semantic service:
-
Select topics from your predefined prompt topics.
-
-
Basic scale semantic service:
-
Click + Create deny list.
-
Define a Prompt topic name.
-
Define prompt utterances or click Upload utterances to upload a plain text file containing your prompt utterances.
-
Click Create.
-
Create multiple prompt topics for each route as needed.
Creating a semantic prompt guard automatically applies the Semantic Prompt Guard policy.
-
-
-
Return to Create an LLM Proxy step 7 to finish configuring your LLM Proxy.
Edit and Delete an LLM Proxy
To edit an LLM Proxy:
-
From API Manager, click LLM Proxies.
-
Click the name of the LLM Proxy you want to edit.
-
Click Configuration.
-
Switch between the Inbound, Gateway, and Outbound configurations to make the necessary edits.
-
Click Save & Deploy.
To delete an LLM Proxy:
-
From API Manager, click LLM Proxies.
-
Click the three-dots menu (
) of the LLM Proxy you want to delete. -
Click Delete LLM Proxy.
-
Click Yes, Delete.



