Skip to content

feat(ui): show cache hits in request logs - #48322

Draft
tanishqbaweja wants to merge 1 commit into
BerriAI:mainfrom
tanishqbaweja:litellm_feat_23743_request_log_cache_hit
Draft

tanishqbaweja wants to merge 1 commit into
BerriAI:mainfrom
tanishqbaweja:litellm_feat_23743_request_log_cache_hit

Conversation

@tanishqbaweja

@tanishqbaweja tanishqbaweja commented Oct 25, 2026 •

Copy link
Copy Markdown

Request Logs now shows whether each request was served from the response cache. Grouped sessions show their cache hit count, so an admin can compare requests without opening every detail drawer

Details

TLDR

Problem this solves:

  • Cache hits are missing from the request table

How it solves it:

  • Display hits, misses and grouped session hit counts
  • Share cache interpretation with the existing details drawer

Intentional product change: Request Logs gains a Cache Hit column beside Status. This adds one column to the horizontally scrollable table

The API already supplies cache flags, cache keys and session totals. The table omits them, while the details drawer interprets them. The shared helper preserves that interpretation, including misses logged as None with a cache key and disabled caching marked Cache OFF. Session rows use the aggregate count rather than the representative request's flag

User Flow

Before, an admin must open request details to distinguish cached responses

  1. Open http://127.0.0.1:41475/ui/?page=logs
  2. Filter by the key used for repeated requests
  3. See identical Success badges, with no cache-hit column
  4. Open individual rows to find Hit or Miss under Response Cache

Before, the request table omits cache status

After, cache hits can be read directly from the same rows

  1. Open http://127.0.0.1:41475/ui/?page=logs
  2. Filter by the key used for repeated requests
  3. Read Yes for hits, No for misses, a dash when cache status is unavailable, and 2 hits for the grouped session
  4. Open individual rows and confirm the details agree

After, the same requests show cache status

Relevant issues

Fixes #23743

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible and solves one problem
  • Every automated review on the latest commit has finished and its findings are addressed

All three new table integration tests fail on unchanged main because the column is absent. Seven affected frontend test files pass after the change, 243 tests. They cover cache-flag casing, misses with a cache key, disabled caching, session totals, unavailable totals and the distinction from provider prompt caching

Two deliberate mutations verify the assertions. Ignoring the cache key produces three failing tests. Using the representative request instead of the session total produces one failing test. Restoring the intended code brings all 243 tests back to green

The production build, production TypeScript check, Prettier, full CI ESLint, lint budgets, knip and git diff --check pass. ESLint reports zero errors and 3349 existing warnings

All four required checks pass on aa8cc11379b190c5b9260e73b684d8711dc362d5, unit tests, lint, smoke tests, cost-map guard. The coverage job also passes. No automated code review has been posted as of 2026-10-25 16:29 UTC, so that checklist item remains unchecked

The separate OSV scan reports the same three advisories as the scheduled scan of unchanged main, two in filelock 3.32.7 and one in development dependency @azure/msal-node 6.0.1. This PR changes no dependency or scanner files. Existing proposal #48302 addresses these findings separately

Screenshots / Proof of Fix

Both dashboards use the same six requests from the real proxy and PostgreSQL, grouped into four table rows. Qwen3.5-0.8B runs locally through llama.cpp b11669. The six proxy requests produce three model generations and three response-cache hits. One request is made with caching disabled, two identical requests use separate sessions, and three identical requests share a session

The backend stays on unchanged main. Only the production dashboard export changes. No browser requests or upstream responses are mocked in these captures. Evidence and reproduction steps include the configs, requests, model checksum, browser driver, screenshots and recordings

Before (dddbaa8)

Desktop

  1. Follow User Flow at 1440x900 and observe the missing column in the screenshot above
  2. Open the hit and miss rows and confirm their Response Cache values
  3. Apply Cache Hit in Filters, observe two rows, then restore All Requests and observe four rows

Desktop recording

Phone

  1. Repeat User Flow at 390x844 with mobile and touch emulation
  2. Observe the missing column in the phone screenshot
  3. Tap rows, collapse the trace sidebar to check details, apply the hit filter, then restore all four rows

Phone recording

After (aa8cc11)

Desktop

  1. Follow User Flow at 1440x900 and read the four cache values in the screenshot above
  2. Open the hit and miss rows and confirm their Response Cache values agree
  3. Apply Cache Hit in Filters, observe two rows, then restore All Requests and observe four rows

Desktop recording

Phone

  1. Repeat User Flow at 390x844 with mobile and touch emulation
  2. Read the cache values in the phone screenshot
  3. Tap rows, collapse the trace sidebar to check details, apply the hit filter, then restore all four rows

Phone recording

All 20 raw screenshots, four annotated screenshots and eight sampled frames from each of the four recordings were visually inspected. Both viewports pass the table values, details, hit filter and reset checks with no JavaScript exceptions or HTTP 5xx responses

Caveats

Low

Type

New Feature

@CLAassistant

CLAassistant commented Nov 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Cache Hit column to Request Logs UI

2 participants