Request Received: The Proxy receives a request destined for an LLM.
Cost Estimation: Before forwarding the request, the Proxy might estimate the potential maximum cost (or rely on post-request cost calculation).
Budget Check: The Proxy checks the current spending against all applicable budgets (e.g., the specific LLM config budget AND the overall organization budget) for the current time period.
Allow or Deny:
If the current spending plus the estimated/actual cost of the request does not exceed the limit(s), the request is allowed to proceed.
If the request would cause a budget limit to be exceeded, the request is blocked, and an error is returned to the caller.
Analytics & Monitoring: The Analytics system provides the cost data used to track spending against budgets. The current spent amount for a budget period is derived from aggregated analytics data.
Model Pricing: The pricing definitions are essential for the Analytics system to calculate costs accurately, which in turn feeds the Budget Control system.
Notification System: Budgets can be configured to trigger notifications when spending approaches or reaches defined thresholds (e.g., alert admin when 80% of budget is consumed, notify user/admin when budget is exceeded).