Budget Rate Limit Policy #725
Tharsanan1
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Budget Rate Limit Policy
Summary
Introduce a budget-ratelimit policy that limits API usage based on monetary cost calculated from LLM token consumption. Users define pricing per token type (cost per 1M tokens) and set budget limits. The policy enforces spending limits like "$100/hour" or "$1000/day".
Motivation
Problem Statement
Organizations using LLM APIs need to control costs, not just token counts. Different token types (prompt vs completion) have different pricing, and teams need budget controls at various time windows (hourly, daily, monthly).
Currently, there's no simple way to:
Goals
Non-Goals
Proposed Solution
Architecture
Use the delegation pattern (like
basic-ratelimit):costPer1MTokens / 1,000,000advanced-ratelimitquotas with multipliersUser-Facing Configuration
Cost Calculation
Key Features
Use Cases
1. Enterprise Cost Control
2. Burst Protection
3. Token-Type Specific Budgets
References
gateway/policies/advanced-ratelimit/- Core rate limiting enginegateway/policies/basic-ratelimit/- Delegation pattern exampleBeta Was this translation helpful? Give feedback.
All reactions