Repository navigation
feat(spend): add a per-session auto-router benchmarks rollup #35839
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
Open
tin-berri
wants to merge
9
commits into
main
Choose a base branch
from
litellm_lit4712_benchmarks_backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2e2b262
feat(spend): add a per-session auto-router benchmarks rollup
tin-berri 8c20ac7
fix(spend): preserve cache TTL evidence
tin-berri 901eb3d
chore: merge litellm_internal_staging
tin-berri 702da45
fix(ci): preserve basedpyright budget output
tin-berri 7eeafa9
chore(ci): restore lint workflow
tin-berri 798e54d
fix(spend): coerce Decimal and numeric-string aggregates in the bench…
tin-berri ee0e194
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
tin-berri 34ff4e1
chore(ui): regenerate api types after staging merge
tin-berri 270da20
fix(spend): move the rollup flush to its own scheduler job and bound …
tin-berri 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...tellm_proxy_extras/migrations/20260804000000_add_auto_router_session_rollup/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,37 @@ | ||
| CREATE TABLE IF NOT EXISTS "LiteLLM_AutoRouterSession" ( | ||
| api_key TEXT NOT NULL, | ||
| session_id TEXT NOT NULL, | ||
| model_group TEXT NOT NULL, | ||
| router_kind TEXT NOT NULL, | ||
| baseline_model TEXT, | ||
| turns INTEGER NOT NULL DEFAULT 0, | ||
| turns_with_usage INTEGER NOT NULL DEFAULT 0, | ||
| total_tokens BIGINT NOT NULL DEFAULT 0, | ||
| spend DOUBLE PRECISION NOT NULL DEFAULT 0, | ||
| baseline_spend DOUBLE PRECISION NOT NULL DEFAULT 0, | ||
| first_visit_turns INTEGER NOT NULL DEFAULT 0, | ||
| first_visit_hits INTEGER NOT NULL DEFAULT 0, | ||
| warm_turns INTEGER NOT NULL DEFAULT 0, | ||
| warm_hits INTEGER NOT NULL DEFAULT 0, | ||
| expired_turns INTEGER NOT NULL DEFAULT 0, | ||
| expired_hits INTEGER NOT NULL DEFAULT 0, | ||
| unordered_turns INTEGER NOT NULL DEFAULT 0, | ||
| unordered_hits INTEGER NOT NULL DEFAULT 0, | ||
| unknown_ttl_turns INTEGER NOT NULL DEFAULT 0, | ||
| unknown_ttl_hits INTEGER NOT NULL DEFAULT 0, | ||
| cache_5m_turns INTEGER NOT NULL DEFAULT 0, | ||
| cache_1h_turns INTEGER NOT NULL DEFAULT 0, | ||
| cache_ttl_unknown_turns INTEGER NOT NULL DEFAULT 0, | ||
| tiers JSONB NOT NULL DEFAULT '{}', | ||
| first_turn_at TIMESTAMP(3) NOT NULL, | ||
| last_turn_at TIMESTAMP(3) NOT NULL, | ||
| updated_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
|
||
| CONSTRAINT "LiteLLM_AutoRouterSession_pkey" PRIMARY KEY (api_key, session_id, model_group) | ||
| ); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "idx_auto_router_session_started" | ||
| ON "LiteLLM_AutoRouterSession" (first_turn_at); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "idx_auto_router_session_activity" | ||
| ON "LiteLLM_AutoRouterSession" (last_turn_at); |
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.