Repository navigation
feat(proxy): add LiteLLM_DailyGlobalSpend key-free rollup for the usage dashboard #41324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c8a2d8c
feat(proxy): add LiteLLM_DailyGlobalSpend key-free rollup for the usa…
yassin-berriai ad8de0e
fix(proxy): roll up only closed days into LiteLLM_DailyGlobalSpend an…
yassin-berriai 84c098d
fix(proxy): fold late-arriving per-key spend into already rolled-up g…
yassin-berriai 225fc53
Merge branch 'litellm_usage_key_free_aggregate_split' into litellm_da…
yassin-berriai 0601d2b
feat(proxy): carry response time metrics through LiteLLM_DailyGlobalS…
yassin-berriai 7c5fa53
Merge remote-tracking branch 'origin/litellm_usage_key_free_aggregate…
yassin-berriai 834313a
test(proxy): assert the global rollup split and scheduler through beh…
yassin-berriai f25d659
fix(proxy): take the closed-day cutoff for the global spend rollup fr…
yassin-berriai 3b2b9bf
Merge branch 'litellm_usage_key_free_aggregate_split' into litellm_da…
yassin-berriai f631301
Merge branch 'litellm_usage_key_free_aggregate_split' into litellm_da…
yassin-berriai b92820d
Merge branch 'litellm_usage_key_free_aggregate_split' into litellm_da…
yassin-berriai 6a6ae2d
Merge remote-tracking branch 'origin/main' into litellm_daily_global_…
yassin-berriai abf530f
fix(proxy): never rewind the daily global spend marker from an overla…
yassin-berriai 3449ae9
fix(proxy): advance the daily global spend marker in one conditional …
yassin-berriai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...xtras/litellm_proxy_extras/migrations/20260915000000_add_daily_global_spend/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| -- CreateTable | ||
| CREATE TABLE IF NOT EXISTS "LiteLLM_DailyGlobalSpend" ( | ||
| "id" TEXT NOT NULL, | ||
| "date" TEXT NOT NULL, | ||
| "model" TEXT, | ||
| "model_group" TEXT, | ||
| "custom_llm_provider" TEXT, | ||
| "mcp_namespaced_tool_name" TEXT, | ||
| "endpoint" TEXT, | ||
| "prompt_tokens" BIGINT NOT NULL DEFAULT 0, | ||
| "completion_tokens" BIGINT NOT NULL DEFAULT 0, | ||
| "cache_read_input_tokens" BIGINT NOT NULL DEFAULT 0, | ||
| "cache_creation_input_tokens" BIGINT NOT NULL DEFAULT 0, | ||
| "compression_saved_tokens" BIGINT NOT NULL DEFAULT 0, | ||
| "compression_savings_spend" DOUBLE PRECISION NOT NULL DEFAULT 0.0, | ||
| "prompt_caching_savings_spend" DOUBLE PRECISION NOT NULL DEFAULT 0.0, | ||
| "gateway_injected_caching_savings_spend" DOUBLE PRECISION NOT NULL DEFAULT 0.0, | ||
| "autorouter_savings_spend" DOUBLE PRECISION NOT NULL DEFAULT 0.0, | ||
| "spend" DOUBLE PRECISION NOT NULL DEFAULT 0.0, | ||
| "api_requests" BIGINT NOT NULL DEFAULT 0, | ||
| "successful_requests" BIGINT NOT NULL DEFAULT 0, | ||
| "failed_requests" BIGINT NOT NULL DEFAULT 0, | ||
| "total_response_time_ms" BIGINT NOT NULL DEFAULT 0, | ||
| "timed_requests" BIGINT NOT NULL DEFAULT 0, | ||
| "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "updated_at" TIMESTAMP(3) NOT NULL, | ||
|
|
||
| CONSTRAINT "LiteLLM_DailyGlobalSpend_pkey" PRIMARY KEY ("id") | ||
| ); | ||
|
|
||
| -- CreateIndex | ||
| CREATE INDEX IF NOT EXISTS "LiteLLM_DailyGlobalSpend_date_idx" ON "LiteLLM_DailyGlobalSpend"("date"); | ||
|
|
||
| -- CreateIndex | ||
| CREATE UNIQUE INDEX IF NOT EXISTS "LiteLLM_DailyGlobalSpend_date_model_model_group_custom_llm__key" ON "LiteLLM_DailyGlobalSpend"("date", "model", "model_group", "custom_llm_provider", "mcp_namespaced_tool_name", "endpoint"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.