litellm/litellm
Julio Quinteros Pro 7c322f9946 fix: reset team member budgets based on team's budget_duration
Fixes #19105

## Problem
Team member budgets (max_budget_in_team) were not resetting properly:
1. Team members use litellm_budget_table for budget limits
2. Budget resets only occurred if litellm_budget_table had budget_duration set
3. When creating team members with max_budget_in_team, budget_duration wasn't inherited
4. Without budget_duration, team member budgets never reset, even though team budgets did

## Root Cause
The reset_budget_for_litellm_budget_table() method only reset budgets that had
their own budget_duration and reset_at time. Team members without explicit
budget_duration were never included in the reset.

## Solution
Added reset_budget_for_team_members_by_team() method that:
- Runs during the budget reset job
- Finds teams that need budget reset (based on team's budget_duration)
- Resets spend for ALL team members in those teams
- Ensures team member budgets inherit the team's reset schedule

## Changes
- litellm/proxy/common_utils/reset_budget_job.py:
  - Added reset_budget_for_team_members_by_team() method
  - Called in reset_budget() after resetting team budgets
- Added comprehensive tests to verify the fix
- Added reproduction script for issue validation

## Testing
- Unit tests verify team member budgets reset with team
- Tested with multiple teams and edge cases
- All existing tests pass

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 06:44:05 -03:00
..
a2a_protocol fix(mypy): resolve type checking errors in 5 files (#20627) 2026-02-06 18:34:55 -08:00
anthropic_interface [bug fix] do not fallback to token counter if disable_token_counter is enabled (#19041) 2026-01-13 16:53:38 -08:00
assistants
batch_completion fix(batch_completion): submit all model futures before waiting (#20705) 2026-02-11 15:44:37 +05:30
batches litellm_fix(azure): Fix acancel_batch not using Azure SDK client initialization (#20168) 2026-01-31 11:45:25 -08:00
caching fix(mypy): resolve type checking errors in 5 files (#20627) 2026-02-06 18:34:55 -08:00
completion_extras fix openai tests 2026-02-12 17:53:47 -08:00
containers Make keepalive_timeout parameter work for Gunicorn (#19087) 2026-01-16 03:32:59 +05:30
endpoints/speech/speech_to_completion_bridge
experimental_mcp_client fix(mcp): resolve OAuth2 'Capabilities: none' bug for upstream MCP servers (#20602) 2026-02-06 15:00:35 -08:00
files fix(mypy): fix type errors in files, opentelemetry, gemini transformation, and key management (#20161) 2026-01-31 10:09:07 -08:00
fine_tuning
google_genai Add custom vertex ai mapping to the output 2026-01-22 15:18:24 +05:30
images Add None as default image value 2026-01-19 09:08:38 +05:30
integrations fixing mistral model deprecation, cloud zero transform bug 2026-02-12 17:53:04 -08:00
interactions [Feat] Interactions API - allow using all litellm providers (interactions -> responses api bridge) (#18373) 2025-12-23 22:30:22 +05:30
litellm_core_utils fix openai tests 2026-02-12 17:53:47 -08:00
llms fix mypy linting 2026-02-12 17:52:12 -08:00
ocr [Feat] /ocr - Add VertexAI OCR provider support + cost tracking (#16216) 2025-11-03 15:56:49 -08:00
passthrough [Fix] VertexAI Pass through - Ensure only anthropic betas are forwarded down to LLM API (#19542) 2026-01-21 19:12:04 -08:00
proxy fix: reset team member budgets based on team's budget_duration 2026-02-13 06:44:05 -03:00
proxy_auth Fix mypy issues 2026-02-05 09:44:05 +05:30
rag [Feat] RAG API - Add s3_vectors as provider on /vector_store/search API + UI for creating + PDF support for /rag/ingest (#19895) 2026-01-27 16:30:59 -08:00
realtime_api [Feat] Add xAI /realtime API Support - works with LiveKitSDK (#20381) 2026-02-03 19:58:28 -08:00
rerank_api Add tests for header forwarding 2025-12-12 17:54:17 +05:30
responses [Feat] AI Gateway - Add Tracing for MCP Calls running through AI Gateway (#21018) 2026-02-12 10:02:03 -08:00
router_strategy feat(tag-routing): support toggling tag matching between ANY and ALL (#18776) 2026-01-08 23:39:03 +05:30
router_utils feat: add support for anthropic_messages call type in prompt caching (#19233) 2026-02-07 22:51:06 -08:00
search
secret_managers Fix authorization issues, same alias; verified working 2026-02-05 14:14:20 +05:30
skills [Feat] Unified Skills API - works across Anthropic, Vertex, Azure, Bedrock (#18232) 2025-12-19 18:55:59 +05:30
types Merge remote-tracking branch 'origin' into litellm_unified_ag 2026-02-12 14:32:52 -08:00
vector_store_files Vector store files Stable Release (#16643) 2025-11-15 13:00:33 -08:00
vector_stores Fix vector store configuration synchronization failure 2025-12-05 11:46:14 +05:30
videos fix: respect videos content db creds 2025-12-10 23:00:01 +05:30
__init__.py Merge branch 'main' into litellm_oss_staging_02_11_2026 2026-02-12 20:04:46 +05:30
_lazy_imports.py refactor: migrate utils.py lazy imports to registry pattern (#18657) 2026-01-05 09:55:48 -08:00
_lazy_imports_registry.py [Release - 02/10/2026] v1.81.10-nightly 2026-02-10 16:26:30 -08:00
_logging.py fix:Parse embedded JSON in the message field of logs (#20366) 2026-02-10 16:13:33 +05:30
_redis.py
_service_logger.py fix(langfuse_otel): ignore service logs and fix callback shadowing (#19298) 2026-01-19 05:53:47 -08:00
_uuid.py
_version.py
anthropic_beta_headers_config.json Fix beta header old tests 2026-02-11 16:57:52 +05:30
anthropic_beta_headers_manager.py Update code to handle anthropic beta headers mapping 2026-02-11 12:35:22 +05:30
budget_manager.py
constants.py fix: MCP - inject NPM_CONFIG_CACHE into STDIO MCP subprocess env (#21069) 2026-02-12 15:11:37 -08:00
cost.json
cost_calculator.py perf: guard debug log f-strings and remove redundant dict copy in hot path (#19961) 2026-02-07 10:40:29 -08:00
exceptions.py Fix unsafe access to request attribute (#19573) 2026-01-22 10:58:29 -08:00
main.py Merge pull request #20386 from naaa760/fix/extra-head-chat-comp-brid 2026-02-04 09:11:43 +05:30
model_prices_and_context_window_backup.json cleanup(model_prices): remove 39 deprecated OpenRouter models (#20786) 2026-02-12 20:32:00 -08:00
mypy.ini
py.typed
router.py Merge branch 'main' into litellm_oss_staging_02_11_2026 2026-02-12 20:04:46 +05:30
scheduler.py fix(scheduler): remove orphan entries from queue - causing memory leak. (#20866) 2026-02-10 22:34:52 -08:00
timeout.py
utils.py Merge branch 'main' into litellm_oss_staging_02_11_2026 2026-02-12 20:04:46 +05:30