Redirecting LLM Traffic
Learn how to configure the Director gateway to intercept and manage LLM API requests, enabling effective governance without requiring significant application changes.
Overview
The Tetrate Agent Operations Director uses a Gateway component to intercept and control LLM API traffic. This approach allows organizations to implement governance and cost controls for resources and consumers without extensive modifications to existing applications.
The Gateway sits between your applications and LLM providers, providing:
- Request interception and routing
- Usage metering and quota enforcement
- Credential management and security
- Logging and telemetry collection
Configuration Steps
Step 1: Prepare Gateway Deployment
Before configuring traffic redirection:
- Verify the Gateway is deployed and accessible
- Ensure network connectivity between applications, gateway, and LLM providers
- Confirm that appropriate credentials are configured for target providers
Step 2: Configure Resource Definitions
Associate the gateway with specific LLM resources:
- Navigate to the Resources section in the Director console
- Select or add the target LLM resources (e.g., OpenAI, AWS Bedrock)
- Verify API endpoints and authentication settings
- Associate resources with the appropriate providers
Step 3: Set Up Budget Controls
Before redirecting traffic, establish governance policies:
- Create or select appropriate budget templates
- Configure budgets for specific consumer/resource pairs
- Set initial mode to Monitored
Step 4: Update Application Configuration
Modify applications to route requests through the Gateway:
-
API Endpoint Change: Update application configuration to point to the gateway endpoint
- Original:
https://api.openai.com/v1/chat/completions
- New:
https://ai-gateway.example.com/openai/v1/chat/completions
- Original:
-
Authentication: Continue using existing API keys (gateway will handle provider authentication)
Step 5: Verify Gateway Traffic
After configuration, confirm traffic is flowing correctly:
- Make test requests from the application
- Check gateway logs for successful request proxying
- Verify metrics appear in the Director dashboard
- Confirm that usage is being tracked against the appropriate budget