Repository navigation
feat(ui): find rows by a pasted ID on keys, agents, memory, audit, and request logs - #39661
Merged
ryan-crabbe-berri merged 5 commits intoSep 3, 2026
Merged
Conversation
…listings GET /key/list?search= matches the key hash (a raw sk- key is hashed first) or a case-insensitive alias substring, and key_hash= now hashes a raw sk- value too. GET /v1/memory?search= matches a key prefix or an exact memory_id. GET /audit?search= matches id, object_id, changed_by, or changed_by_api_key. GET /spend/logs/ui?search= matches request_id across all time and api_key, team_id, user, end_user, session_id, or model_id inside the date window; session grouping is skipped while a search is active. Claude-Session: https://claude.ai/code/session_01Q5sbiogJzPcCRmYSbaHxZf
Virtual Keys and Team Virtual Keys send the search box to the new key/list search param so a key hash matches. Agents matches agent_id client-side. Memory sends the box as search so a memory_id matches. Audit Logs gains a search box. Request Logs sends the box as search so a session, team, user, key hash, or model id matches without opening the filter drawer. Claude-Session: https://claude.ai/code/session_01Q5sbiogJzPcCRmYSbaHxZf
Contributor
Contributor
Greptile SummaryThe PR adds ID-aware search across virtual keys, agents, memory, audit logs, and request logs.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| enterprise/litellm_enterprise/proxy/audit_logging_endpoints.py | Adds exact search across audit-log identifier fields while composing it with existing filters. |
| litellm/proxy/management_endpoints/key_management_endpoints.py | Adds combined exact token and case-insensitive alias search to key listings. |
| litellm/proxy/memory/memory_endpoints.py | Adds memory-ID and key-prefix search while retaining visibility scoping. |
| litellm/proxy/spend_tracking/spend_management_endpoints.py | Adds multi-identifier spend-log search with documented date-window and grouping behavior. |
| ui/litellm-dashboard/src/components/view_logs/AuditLogsPanel.tsx | Adds dashboard audit-log search integration. |
| ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.tsx | Connects request-log search to server-side multi-ID filtering. |
| ui/litellm-dashboard/src/components/team/TeamVirtualKeysTable.tsx | Adds key-ID filtering for team virtual keys. |
| ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.tsx | Connects memory search to the server-side search parameter. |
Reviews (3): Last reviewed commit: "test(proxy): pass search=None in direct ..." | Re-trigger Greptile
Contributor
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The search= param on /key/list, /audit, and /spend/logs/ui, plus key_hash= on /key/list, now compare the pasted value verbatim. Only a copied key ID (the hash) matches, so a raw virtual key never needs to travel in a GET query string Claude-Session: https://claude.ai/code/session_01Q5sbiogJzPcCRmYSbaHxZf
Contributor
Author
|
@greptile re review |
Contributor
Author
|
@veria-ai review |
Calling the endpoint without going through FastAPI leaves the new search param set to its Query default object, which is not None, so the grouped-session and request_id lookup tests started taking the search branch Claude-Session: https://claude.ai/code/session_01Q5sbiogJzPcCRmYSbaHxZf
Contributor
Author
|
@greptile re review |
Contributor
Author
|
@veria-ai review |
ryan-crabbe-berri
enabled auto-merge
September 3, 2026 23:16
yuneng-berri
approved these changes
Sep 3, 2026
ryan-crabbe-berri
merged commit Sep 3, 2026
a53c550
into
litellm_internal_staging
81 of 82 checks passed
21 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TLDR
Problem this solves:
How it solves it:
searchparamUser Flow
Before: an admin copies a key hash from a log row and pastes it into Virtual Keys, and the search matches nothing
After: the same paste finds the row on every page
Relevant issues
Linear ticket
Resolves LIT-4741
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Two proxies ran against the same Postgres: the merge base on :4741 with its dashboard dev server on :3741, and the PR tip on :4742 with its dashboard on :3742. Before running either side, one team, one key in that team, one chat completion made with that key under a session id, one memory entry, and one agent were created through the API, giving these ids
Before (8699998)
Virtual Keys: paste the key hash
curl -s 'http://localhost:4741/key/list?search=da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b&return_full_object=true' -H 'Authorization: Bearer sk-1234' | jq '{total_count, aliases: [.keys[].key_alias]}'{ "total_count": 143, "aliases": [ "lit4741-144523-key", "mr_widen2_1788293511", "mr_widen_1788293463", "mr_inherit_1788293463", "mr_narrow_1788293463", "pr37044-window-qa-1788235855", "pr37044-window-qa-1788234378", "pr37044-window-qa-1788231967", "listing-qa-scoped-openai", "listing-qa-scoped-key" ] }Open http://localhost:3741/?page=api-keys and paste the key hash into the search box: every key still shows
Team Virtual Keys: paste the key hash
Open http://localhost:3741/?page=teams, click the team, open the Virtual Keys tab, and paste the key hash into the search box: the key does not show, and the filter drawer has no Key ID field
Agents: paste the agent id
Open http://localhost:3741/?page=agents and paste the agent id into the search box: "No matching agents"
Memory: paste the memory id
curl -s 'http://localhost:4741/v1/memory?search=35cf6c47-4c0b-4c5f-bb34-b55176249119' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.memories[] | {memory_id, key}]}'{ "total": 2, "rows": [ { "memory_id": "217a08de-fe00-4f8a-aa62-134d9c9c5bce", "key": "lit4741-decoy:prefs" }, { "memory_id": "35cf6c47-4c0b-4c5f-bb34-b55176249119", "key": "lit4741-144523:profile" } ] }Open http://localhost:3741/?page=memory and paste the memory id into the search box: no memories listed
Audit Logs: paste the key hash or team id
curl -s 'http://localhost:4741/audit?search=da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.audit_logs[] | {table_name, action, object_id}]}'{ "total": 274, "rows": [ { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_VerificationToken", "action": "created", "object_id": "da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b" }, { "table_name": "LiteLLM_TeamTable", "action": "created", "object_id": "190353d0-2ad7-433a-825c-c5511ad8bed7" }, { "table_name": "LiteLLM_UserTable", "action": "deleted", "object_id": "lit4738a-search-user" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_UserTable", "action": "created", "object_id": "lit4738a-search-user" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_ProxyModelTable", "action": "deleted", "object_id": "beea582c-0a8e-4062-a316-067cbd6a5feb" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" } ] }curl -s 'http://localhost:4741/audit?search=190353d0-2ad7-433a-825c-c5511ad8bed7' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.audit_logs[] | {table_name, action, object_id}]}'{ "total": 274, "rows": [ { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_VerificationToken", "action": "created", "object_id": "da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b" }, { "table_name": "LiteLLM_TeamTable", "action": "created", "object_id": "190353d0-2ad7-433a-825c-c5511ad8bed7" }, { "table_name": "LiteLLM_UserTable", "action": "deleted", "object_id": "lit4738a-search-user" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_UserTable", "action": "created", "object_id": "lit4738a-search-user" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" }, { "table_name": "LiteLLM_ProxyModelTable", "action": "deleted", "object_id": "beea582c-0a8e-4062-a316-067cbd6a5feb" }, { "table_name": "LiteLLM_UserTable", "action": "updated", "object_id": "default_user_id" } ] }Open http://localhost:3741/?page=logs and pick the Audit Logs tab: there is no search box
Request Logs: paste a session id, team id, or key hash
curl -s 'http://localhost:4741/spend/logs/ui?search=lit4741-144523-session&start_date=2026-09-02%2021:55:32&end_date=2026-09-04%2021:55:32' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.data[:3][] | {request_id, session_id, team_id}]}'{ "total": 44, "rows": [ { "request_id": "chatcmpl-EK9XJo56cePuTwzE8p7bOtVxRYDxf", "session_id": "lit4741-144523-session", "team_id": "190353d0-2ad7-433a-825c-c5511ad8bed7" }, { "request_id": "chatcmpl-EK6A0FAsgWlMv1nxcHUZRzHLHYwSs", "session_id": "lit-4929-qa-1788458945", "team_id": "" }, { "request_id": "chatcmpl-EK69zgkzOrrk64sEX9huxG4LAkMvu", "session_id": "lit-4929-qa-1788458945", "team_id": "" } ] }curl -s 'http://localhost:4741/spend/logs/ui?search=190353d0-2ad7-433a-825c-c5511ad8bed7&start_date=2026-09-02%2021:55:32&end_date=2026-09-04%2021:55:32' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.data[:3][] | {request_id, session_id, team_id}]}'{ "total": 44, "rows": [ { "request_id": "chatcmpl-EK9XJo56cePuTwzE8p7bOtVxRYDxf", "session_id": "lit4741-144523-session", "team_id": "190353d0-2ad7-433a-825c-c5511ad8bed7" }, { "request_id": "chatcmpl-EK6A0FAsgWlMv1nxcHUZRzHLHYwSs", "session_id": "lit-4929-qa-1788458945", "team_id": "" }, { "request_id": "chatcmpl-EK69zgkzOrrk64sEX9huxG4LAkMvu", "session_id": "lit-4929-qa-1788458945", "team_id": "" } ] }curl -s 'http://localhost:4741/spend/logs/ui?search=da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b&start_date=2026-09-02%2021:55:32&end_date=2026-09-04%2021:55:32' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.data[:3][] | {request_id, api_key}]}'{ "total": 44, "rows": [ { "request_id": "chatcmpl-EK9XJo56cePuTwzE8p7bOtVxRYDxf", "api_key": "da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b" }, { "request_id": "chatcmpl-EK6A0FAsgWlMv1nxcHUZRzHLHYwSs", "api_key": "litellm_proxy_master_key" }, { "request_id": "chatcmpl-EK69zgkzOrrk64sEX9huxG4LAkMvu", "api_key": "litellm_proxy_master_key" } ] }Open http://localhost:3741/?page=logs and paste the session id into the Request Logs search box: the table is empty
After (9464888)
Virtual Keys: paste the key hash
curl -s 'http://localhost:4742/key/list?search=da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b&return_full_object=true' -H 'Authorization: Bearer sk-1234' | jq '{total_count, aliases: [.keys[].key_alias]}'{ "total_count": 1, "aliases": [ "lit4741-144523-key" ] }Open http://localhost:3742/?page=api-keys and paste the key hash into the search box: the table narrows to that key
Team Virtual Keys: paste the key hash
Open http://localhost:3742/?page=teams, click the team, open the Virtual Keys tab, and paste the key hash into the search box: the table narrows to that key
Agents: paste the agent id
Open http://localhost:3742/?page=agents and paste the agent id into the search box: that agent is the only row
Memory: paste the memory id
curl -s 'http://localhost:4742/v1/memory?search=35cf6c47-4c0b-4c5f-bb34-b55176249119' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.memories[] | {memory_id, key}]}'{ "total": 1, "rows": [ { "memory_id": "35cf6c47-4c0b-4c5f-bb34-b55176249119", "key": "lit4741-144523:profile" } ] }Open http://localhost:3742/?page=memory and paste the memory id into the search box: that memory is the only row
Audit Logs: paste the key hash or team id
curl -s 'http://localhost:4742/audit?search=da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.audit_logs[] | {table_name, action, object_id}]}'{ "total": 1, "rows": [ { "table_name": "LiteLLM_VerificationToken", "action": "created", "object_id": "da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b" } ] }curl -s 'http://localhost:4742/audit?search=190353d0-2ad7-433a-825c-c5511ad8bed7' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.audit_logs[] | {table_name, action, object_id}]}'{ "total": 1, "rows": [ { "table_name": "LiteLLM_TeamTable", "action": "created", "object_id": "190353d0-2ad7-433a-825c-c5511ad8bed7" } ] }Open http://localhost:3742/?page=logs, pick the Audit Logs tab, and paste the key hash into the new search box: the audit row for that key is the only row
Request Logs: paste a session id, team id, or key hash
curl -s 'http://localhost:4742/spend/logs/ui?search=lit4741-144523-session&start_date=2026-09-02%2023:05:31&end_date=2026-09-04%2023:05:31' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.data[:3][] | {request_id, session_id, team_id}]}'{ "total": 1, "rows": [ { "request_id": "chatcmpl-EK9XJo56cePuTwzE8p7bOtVxRYDxf", "session_id": "lit4741-144523-session", "team_id": "190353d0-2ad7-433a-825c-c5511ad8bed7" } ] }curl -s 'http://localhost:4742/spend/logs/ui?search=190353d0-2ad7-433a-825c-c5511ad8bed7&start_date=2026-09-02%2023:05:31&end_date=2026-09-04%2023:05:31' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.data[:3][] | {request_id, session_id, team_id}]}'{ "total": 1, "rows": [ { "request_id": "chatcmpl-EK9XJo56cePuTwzE8p7bOtVxRYDxf", "session_id": "lit4741-144523-session", "team_id": "190353d0-2ad7-433a-825c-c5511ad8bed7" } ] }curl -s 'http://localhost:4742/spend/logs/ui?search=da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b&start_date=2026-09-02%2023:05:31&end_date=2026-09-04%2023:05:31' -H 'Authorization: Bearer sk-1234' | jq '{total, rows: [.data[:3][] | {request_id, api_key}]}'{ "total": 1, "rows": [ { "request_id": "chatcmpl-EK9XJo56cePuTwzE8p7bOtVxRYDxf", "api_key": "da1abd4096c1b7cc325b3a5a62430f59883c46a49f8ae06272e4080278eff64b" } ] }Open http://localhost:3742/?page=logs and paste the session id into the Request Logs search box: the table shows the request from that session
Type
🆕 New Feature
🐛 Bug Fix
Caveats (if any)
Medium
Low
searchtoo, always inside its required date windowFinal Attestation
https://claude.ai/code/session_01Q5sbiogJzPcCRmYSbaHxZf