Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

System Statistics docs, prompt-cache line and screenshots for the new layout

Murtaza Nasird82714fe0620
diff --git a/docs/admin-guide/model-configuration.md b/docs/admin-guide/model-configuration.md
index 8e428e03..5e70994c 100644
--- a/docs/admin-guide/model-configuration.md
+++ b/docs/admin-guide/model-configuration.md
@@ -467,8 +467,8 @@ off by default on most backends. The settings below are for vLLM; other servers
hits in the API response when it is *also* started with
`--enable-prompt-tokens-details`, which defaults to off. With that flag set,
each response includes `usage.prompt_tokens_details.cached_tokens`, which
- Speakr records and displays in the admin dashboard under **System Statistics →
- Token Usage** as "Cache reads". Without it, caching still works, but the
+ Speakr records and shows in the admin dashboard under **System Statistics →
+ Usage and Cost**, in the prompt-cache line below the language-model chart. Without it, caching still works, but the
dashboard shows zero cache reads because the server never reports them. You can
confirm caching independently from vLLM's `/metrics` endpoint, which exposes
`vllm:prefix_cache_hits_total` and `vllm:prompt_tokens_cached_total` regardless
diff --git a/docs/admin-guide/statistics.md b/docs/admin-guide/statistics.md
index 570b64ff..4319963e 100644
--- a/docs/admin-guide/statistics.md
+++ b/docs/admin-guide/statistics.md
@@ -1,85 +1,61 @@
# System Statistics
-The System Statistics tab transforms raw data into actionable insights about your Speakr instance. At a glance, you can see how many users you're serving, how many recordings they've created, how much storage they're consuming, and whether everything is processing smoothly.
+The System Statistics tab shows how the instance is used, whether processing is healthy, and what the models cost. Choose a period of 7, 30 or 90 days at the top right. The period ends today, and each headline figure is compared with the period of the same length before it. Days are calendar days in UTC.
![System Statistics](../assets/images/screenshots/admin-statistics.png)
-## Key Metrics Overview
+## Overview
-Four prominent cards at the top of the statistics page give you immediate insight into your system's scale. Total Users shows your current user base size, helping you understand your instance's reach. Total Recordings reveals the cumulative content in your system, while Total Storage presents the actual disk space consumed. Total Queries, when Inquire Mode is enabled, indicates how actively users are searching their recordings.
+Six cards sit at the top of the tab:
-These numbers tell a story about your instance's health and growth. A growing user count with proportional recording growth suggests healthy adoption. Storage growing faster than recordings might indicate users are uploading longer files. Query counts reveal whether users are finding value in the semantic search features.
+- **Recordings**: recordings created in the period.
+- **Audio transcribed**: hours and minutes of audio sent for transcription.
+- **AI requests**: language-model calls for titles, summaries, chat, events, speaker identification and Inquire. Embedding requests are not counted.
+- **AI cost**: language-model, embedding and transcription cost together. It reads "Local" when every model runs locally and costs nothing.
+- **Active users**: users who created at least one recording in the period, out of all users.
+- **Total storage**: audio and video kept on disk, without recordings whose audio was removed.
-## Recording Status Distribution
+The line under each figure gives the change against the previous period.
-The status distribution section breaks down your recordings into four critical states. Completed recordings are fully processed and ready for use - this should be the vast majority of your content. Processing recordings are currently being transcribed or analyzed. Pending recordings are queued and waiting their turn. Failed recordings encountered errors and need attention.
+## Activity
-In a healthy system, you'll see mostly completed recordings with perhaps a few processing at any given moment. A large number of pending recordings might indicate your system is overwhelmed or that background processing has stopped. Failed recordings always deserve investigation - they might reveal configuration issues, API problems, or corrupted files that users are trying to upload.
+**Recordings per day** stacks each day's new recordings by source: uploads (including the watch folder), recordings made in the browser, and merged recordings. Below the chart are the number created, the median processing time of the completed ones, and how many failed.
-## Storage Analysis
+## Health
-The "Top Users by Storage" section reveals who's consuming the most resources in your system. Each user is listed with their total storage consumption and recording count, giving you context about whether they have many small files or fewer large ones.
+The Health card lists every recording state now, across all time: completed, transcribing, summarizing, pending, failed, audio removed and archived. The job queue line shows jobs waiting and running, and the jobs that failed in the last seven days. The latest failed recordings follow, with their owner, date and error message.
-This information proves invaluable for capacity planning and user education. If one user consumes disproportionate storage, you might need to understand their use case better. Are they recording multi-hour meetings? Keeping everything forever? Understanding the why behind the numbers helps you make better policy decisions.
+A queue that keeps growing points to a stopped or overloaded background worker. A run of failures with the same error usually means an expired API key, an unreachable transcription service or a wrong model name.
-## Understanding Usage Patterns
+### Voice embedding compatibility
-Statistics aren't just numbers - they're insights waiting to be discovered. Sudden spikes in recordings might coincide with project kickoffs, academic semesters, or company initiatives. Storage growth that outpaces recording growth could indicate users are uploading longer content or higher quality audio files.
+This card checks that the transcription backend still produces voice embeddings that match the stored voice profiles. It sends a short bundled clip and compares the result with a reference. The check runs at startup; **Check now** runs it again. **Voice spaces** lists one space per embedding model seen, with its dimensions, samples and calibrated threshold. Profiles are compared only within their own space, so switching back to an earlier backend brings its profiles back. **Re-baseline** discards the reference and cannot be undone.
-Regular monitoring helps you spot trends before they become problems. If storage grows 10% monthly, you can project when you'll need to expand capacity. If failed recordings suddenly spike, you can investigate whether an API key expired or a service is down.
+## Usage and Cost
-## Capacity Planning
+**Language model tokens per day, by task** stacks each day's tokens by operation: chat, summarization, title generation, event extraction, speaker identification and Inquire. When the backend reports prompt caching, a line below the chart gives the tokens read from and written to the cache in the period. Cache reads appear only when the text-generation backend returns them in its responses; see [Prefix-Cache-Friendly Prompts](model-configuration.md#prefix-cache-friendly-prompts-prefix_cache_optimized_prompts).
-System statistics are your crystal ball for infrastructure needs. Storage growth trends tell you when you'll need more disk space. User growth patterns indicate when you might need to scale your server resources. Processing queues reveal whether your current setup can handle the workload.
+**Audio transcribed per day** and **Embedding tokens per day** are separate charts. Embedding volume is usually many times the language-model volume at a far lower price, so a shared axis would hide the language-model bars. A re-embed of the whole library shows up as one tall embedding bar.
-Use these insights proactively. If you see storage growing at 50GB monthly and you have 200GB free, you know you have about four months before needing intervention. This lead time lets you budget for upgrades, plan migrations, or implement retention policies before hitting critical limits.
+**Cost per month** covers the last twelve calendar months, stacked by language model, embedding and transcription.
-## Token Usage Statistics
-
-The Token Usage section provides visibility into LLM API consumption across your instance. Two cards split usage between **LLM operations** (title generation, summarization, chat, event extraction) and **embeddings** (Inquire mode), since they typically come from different providers and the embedding cost is otherwise easy to miss.
-
-**Per-Operation Breakdown**: LLM token usage is broken down by operation type so you can see where the spend is going. Title generation, summarization, chat, and event extraction each get their own line with input tokens, output tokens, and estimated cost. Embedding usage is shown as a separate card with its own daily/monthly chart, so a model swap or a re-embed-all run is visible without polluting the LLM-side numbers. This separation matters because the embedding API price (per million tokens) is usually orders of magnitude lower than chat-completion pricing, and mixing them makes both numbers harder to read.
-
-**Daily and Monthly Charts**: Interactive charts display token consumption trends over the last 30 days and 12 months for both LLM and embedding usage. These visualisations help identify usage patterns and predict future costs.
-
-**Per-User Breakdown**: A detailed table shows each user's monthly token consumption alongside their budget limit (if set). Progress bars indicate how much of their budget has been used:
-
-- Green: Under 80% of budget
-- Yellow: Between 80-100% (warning zone)
-- Red: At or over 100% (blocked)
-
-**Prompt Cache Reads**: The LLM card also reports prompt-cache activity for the current month (and today): **cache reads** are input tokens that the model served from a prefix cache instead of recomputing, and **writes** are tokens written into that cache. These figures only appear when the text-generation backend reports them in its API response. They are most useful alongside the `PREFIX_CACHE_OPTIMIZED_PROMPTS` option on a self-hosted backend with prefix caching, where the summary call reuses the transcript that the title call already prefilled. On hosted APIs that do not report cached tokens, the figure stays at zero even if caching is happening upstream. See [Prefix-Cache-Friendly Prompts](model-configuration.md#prefix-cache-friendly-prompts-prefix_cache_optimized_prompts) for how to enable this and what flags your server needs.
-
-**Cost Tracking**: When using OpenRouter or other providers that return cost information, the statistics include estimated costs based on actual API responses. For embeddings, the cost is calculated from the configured per-million-token price for the active embedding provider. This helps with budgeting and identifying high-cost operations.
-
-Use token statistics to identify heavy users, validate budget allocations, and forecast API costs. If certain users consistently hit their limits, you may need to increase their budgets or investigate their usage patterns. See [Token Budget Management](user-management.md#token-budget-management) for setting individual user limits.
-
-## Transcription Usage Statistics
-
-The Transcription Usage section provides visibility into speech-to-text API consumption across your instance. This is separate from token usage and tracks audio transcription specifically.
-
-**Summary Cards**: Four cards at the top show:
-
-- **Today's Minutes**: Transcription minutes used today across all users
-- **This Month**: Total minutes transcribed in the current calendar month
-- **Monthly Cost**: Estimated costs based on connector pricing (OpenAI Whisper/Transcribe charges, $0 for self-hosted ASR)
-- **Budget Warnings**: Count of users approaching (80%+) or exceeding (100%) their transcription budgets
-
-**Per-User Breakdown**: A detailed list shows each user's monthly transcription usage alongside their budget limit (if set). Progress bars indicate budget consumption:
-
-- Green: Under 80% of budget
-- Yellow: Between 80-100% (warning zone)
-- Red: At or over 100% (blocked from new transcriptions)
-
-**Cost Estimation**: The system calculates estimated costs based on the transcription connector used:
+**Cost by model** lists every model used in the period with its requests, its volume (tokens, or minutes for transcription) and its cost. Language-model and embedding costs come from the provider's response where it reports one, such as OpenRouter, and otherwise from the configured price. Transcription cost is estimated from the connector:
- OpenAI Whisper API: $0.006 per minute
- OpenAI Transcribe (gpt-4o-transcribe): $0.006 per minute
- OpenAI Transcribe (gpt-4o-mini-transcribe): $0.003 per minute
-- Self-hosted ASR endpoints: $0 (no external API costs)
+- Self-hosted ASR endpoints: $0
+
+## Users
+
+The Users table has one row per user: recordings, storage, date of the last recording, and the tokens, transcription minutes and cost of the current calendar month. Monthly figures follow the calendar month whatever period is selected, because budgets reset each month. When a user has a budget, a bar shows how much of it is used:
+
+- Green: under 80% of the budget
+- Yellow: 80% to 100%; a warning icon appears next to the name
+- Red: at or over 100%; the user is blocked until the next month
-Use transcription statistics to monitor usage patterns, identify heavy users, and validate budget allocations. Organizations using cloud transcription services can forecast costs accurately, while those with self-hosted ASR can track capacity utilization. See [Transcription Budget Management](user-management.md#transcription-budget-management) for setting individual user limits.
+Click a column heading to sort by it. See [Token Budget Management](user-management.md#token-budget-management) and [Transcription Budget Management](user-management.md#transcription-budget-management) for setting the limits.
---
-Next: [System Settings](system-settings.md) →
\ No newline at end of file
+Next: [System Settings](system-settings.md) →
diff --git a/docs/admin-guide/user-management.md b/docs/admin-guide/user-management.md
index 75dc7957..635cc891 100644
--- a/docs/admin-guide/user-management.md
+++ b/docs/admin-guide/user-management.md
@@ -39,7 +39,7 @@ Control LLM costs by setting monthly token budgets for individual users. When cr
- **Budget Reset**: Token counts reset automatically at the start of each calendar month
- **No Limit**: Leave the budget field empty for unlimited usage
-Token budgets are set in increments of 10,000 tokens with a minimum of 100,000. The budget covers all AI operations including summarization, chat, title generation, and event extraction. View detailed token usage statistics in the [System Statistics](statistics.md#token-usage-statistics) section.
+Token budgets are set in increments of 10,000 tokens with a minimum of 100,000. The budget covers all AI operations including summarization, chat, title generation, and event extraction. View detailed token usage statistics in the [System Statistics](statistics.md#users) users table.
### Transcription Budget Management
@@ -52,7 +52,7 @@ Control transcription costs by setting monthly transcription budgets for individ
- **Budget Reset**: Transcription minutes reset automatically at the start of each calendar month
- **No Limit**: Leave the budget field empty for unlimited transcription usage
-Transcription budgets are set in minutes with a minimum of 10 minutes. The budget covers all transcription operations regardless of which connector is used (OpenAI Whisper, OpenAI Transcribe, or self-hosted ASR). View detailed transcription usage statistics in the [System Statistics](statistics.md#transcription-usage-statistics) section.
+Transcription budgets are set in minutes with a minimum of 10 minutes. The budget covers all transcription operations regardless of which connector is used (OpenAI Whisper, OpenAI Transcribe, or self-hosted ASR). View detailed transcription usage statistics in the [System Statistics](statistics.md#users) users table.
**Cost Tracking**: The system tracks estimated costs based on the transcription connector used:
diff --git a/docs/admin-guide/vector-store.md b/docs/admin-guide/vector-store.md
index d74ee581..ae59d488 100644
--- a/docs/admin-guide/vector-store.md
+++ b/docs/admin-guide/vector-store.md
@@ -53,13 +53,13 @@ The processing system is designed to be resilient. If processing fails for a spe
The **Re-embed all** button at the top of the Vector Store tab clears every stored embedding and queues every recording for re-processing through the current embedding configuration. Use it after changing `EMBEDDING_MODEL`, switching from local to API-mode (`EMBEDDING_BASE_URL`), or changing `EMBEDDING_DIMENSIONS`, since old vectors generated by the previous configuration cannot be compared meaningfully against new query vectors.
-A confirmation modal appears before the action runs. Re-embedding a large library is bandwidth-intensive when API-mode is configured (every chunk goes back to the embedding provider) and CPU-intensive in local mode, so plan for the workload. Embedding token usage from the run shows up on the Statistics tab's separate embedding card so you can attribute the cost cleanly.
+A confirmation modal appears before the action runs. Re-embedding a large library is bandwidth-intensive when API-mode is configured (every chunk goes back to the embedding provider) and CPU-intensive in local mode, so plan for the workload. Embedding token usage from the run shows up in the Statistics tab's embedding chart, apart from the language-model tokens.
If only a subset of recordings is affected by the configuration change (for example, you re-uploaded one folder), reprocessing those recordings individually is more efficient than the global re-embed.
## Embedding Token Tracking
-The Vector Store tab also shows embedding API token usage and estimated cost when API-mode is configured (`EMBEDDING_BASE_URL` is set). This is tracked separately from LLM operations because embedding pricing is typically much lower per token but request volume is much higher (every chunk of every recording is one or more requests). The same numbers feed the dedicated embedding card on the Statistics tab — see [System Statistics](statistics.md#token-usage-statistics) for the per-day and per-month breakdown.
+The Vector Store tab also shows embedding API token usage and estimated cost when API-mode is configured (`EMBEDDING_BASE_URL` is set). This is tracked separately from LLM operations because embedding pricing is typically much lower per token but request volume is much higher (every chunk of every recording is one or more requests). The same numbers feed the embedding chart, the monthly cost and the cost by model on the Statistics tab; see [System Statistics](statistics.md#usage-and-cost).
## Optimizing Performance
diff --git a/docs/assets/images/screenshots/admin-statistics.png b/docs/assets/images/screenshots/admin-statistics.png
index 2db468ae..06aea643 100644
Binary files a/docs/assets/images/screenshots/admin-statistics.png and b/docs/assets/images/screenshots/admin-statistics.png differ
diff --git a/docs/assets/images/screenshots/admin-token-budgets.png b/docs/assets/images/screenshots/admin-token-budgets.png
index f20e67e3..f54bc4b0 100644
Binary files a/docs/assets/images/screenshots/admin-token-budgets.png and b/docs/assets/images/screenshots/admin-token-budgets.png differ
diff --git a/docs/features.md b/docs/features.md
index 3a1602e1..72473fb6 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -328,7 +328,7 @@ Monitor and control LLM API consumption with per-user token tracking and budget
**Per-User Budgets**: Set monthly token limits for individual users to control costs. Users see their remaining budget in the interface and receive warnings at 80% consumption. Once a budget is exhausted, AI operations are blocked until the next month.
-**Admin Dashboard**: View detailed token statistics including daily trends, monthly totals, and per-user breakdowns. Cost tracking is available when using OpenRouter or other providers that return cost information. See the [admin guide](admin-guide/statistics.md#token-usage-statistics) for details.
+**Admin Dashboard**: System Statistics shows tokens per day by task, cost per month and per model, and each user's usage against the budget. Cost tracking is available when using OpenRouter or other providers that return cost information. See the [admin guide](admin-guide/statistics.md#usage-and-cost) for details.
### Transcription Usage Tracking & Budgets
@@ -338,7 +338,7 @@ Monitor and control speech-to-text API consumption separately from LLM tokens. T
**Cost Estimation**: The system calculates estimated transcription costs based on the connector used - $0.006/minute for OpenAI Whisper, $0.003-$0.006/minute for OpenAI Transcribe models, and $0 for self-hosted ASR endpoints. This helps organizations forecast costs and identify heavy users.
-**Admin Dashboard**: View transcription statistics including today's usage, monthly totals, estimated costs, and per-user breakdowns with budget status indicators. See the [admin guide](admin-guide/statistics.md#transcription-usage-statistics) for details.
+**Admin Dashboard**: System Statistics shows minutes transcribed per day, estimated costs, and each user's minutes against the budget. See the [admin guide](admin-guide/statistics.md#usage-and-cost) for details.
### Flexible Configuration
diff --git a/scripts/screenshots/shots/settings-admin.mjs b/scripts/screenshots/shots/settings-admin.mjs
index e9ed4bd6..f287540f 100644
--- a/scripts/screenshots/shots/settings-admin.mjs
+++ b/scripts/screenshots/shots/settings-admin.mjs
@@ -206,10 +206,9 @@ export default [
run: async (page) => {
await go(page, '/admin', 1500);
await adminTab(page, 'System Statistics');
- // The budgets live below the instance-wide counters; the negative
- // margin parks the section heading just above the frame so the
- // whole per-user budget panel fits.
- await scrollTabTo(page, 'h4', -60, 'Token Usage Statistics');
+ // The budgets are in the Users table at the end of the tab; the
+ // section heading sits at the top of the frame.
+ await scrollTabTo(page, 'h4', 24, 'Users');
await blurEmails(page);
},
},
diff --git a/src/services/admin_stats.py b/src/services/admin_stats.py
index 8fbde5ce..e9ee659a 100644
--- a/src/services/admin_stats.py
+++ b/src/services/admin_stats.py
@@ -39,14 +39,17 @@ def _days(start, end):
def _usage_window(start, end):
"""Tokens, cost and transcription seconds between two dates, inclusive."""
tok = db.session.query(TokenUsage.operation_type, db.func.sum(TokenUsage.total_tokens),
- db.func.sum(TokenUsage.cost), db.func.sum(TokenUsage.request_count)) \
+ db.func.sum(TokenUsage.cost), db.func.sum(TokenUsage.request_count),
+ db.func.sum(TokenUsage.cached_tokens), db.func.sum(TokenUsage.cache_write_tokens)) \
.filter(TokenUsage.date >= start, TokenUsage.date <= end).group_by(TokenUsage.operation_type).all()
tr = db.session.query(db.func.sum(TranscriptionUsage.audio_duration_seconds),
db.func.sum(TranscriptionUsage.estimated_cost)) \
.filter(TranscriptionUsage.date >= start, TranscriptionUsage.date <= end).first()
- out = {'llm_cost': 0.0, 'embedding_cost': 0.0, 'ai_requests': 0,
+ out = {'llm_cost': 0.0, 'embedding_cost': 0.0, 'ai_requests': 0, 'cache_reads': 0, 'cache_writes': 0,
'transcription_seconds': int(tr[0] or 0), 'transcription_cost': float(tr[1] or 0)}
- for op, _tokens, cost, requests in tok:
+ for op, _tokens, cost, requests, cached, written in tok:
+ out['cache_reads'] += int(cached or 0)
+ out['cache_writes'] += int(written or 0)
if token_tracker.is_embedding_op(op):
out['embedding_cost'] += float(cost or 0)
else:
@@ -253,6 +256,9 @@ def build_overview(days=30, today=None):
'daily': list(daily_use.values()),
'operations': [op for op, _ in sorted(operations.items(), key=lambda kv: -kv[1])],
'by_model': model_rows,
+ # Prompt tokens served from a prefix cache, as the backend reports them.
+ 'cache_reads': cur['cache_reads'],
+ 'cache_writes': cur['cache_writes'],
'monthly': _monthly_cost(12, today),
'embeddings_local': embeddings_are_local(),
'models_local': os.environ.get('MODELS_ARE_LOCAL', 'false').lower() == 'true',
diff --git a/static/locales/de.json b/static/locales/de.json
index bc1af70d..74bfb003 100644
--- a/static/locales/de.json
+++ b/static/locales/de.json
@@ -426,7 +426,8 @@
"llm": "Sprachmodell",
"embedding": "Embedding",
"transcription": "Transkription"
- }
+ },
+ "cacheLine": "Prompt-Cache: {{reads}} Tokens aus dem Cache gelesen, {{writes}} geschrieben, in diesem Zeitraum"
}
},
"apiTokens": {
diff --git a/static/locales/en.json b/static/locales/en.json
index 40e0ba72..48938c24 100644
--- a/static/locales/en.json
+++ b/static/locales/en.json
@@ -426,7 +426,8 @@
"llm": "Language model",
"embedding": "Embedding",
"transcription": "Transcription"
- }
+ },
+ "cacheLine": "Prompt cache: {{reads}} tokens read from the cache, {{writes}} written, in this period"
}
},
"apiTokens": {
diff --git a/static/locales/es.json b/static/locales/es.json
index 8d910bac..6298e33d 100644
--- a/static/locales/es.json
+++ b/static/locales/es.json
@@ -426,7 +426,8 @@
"llm": "Modelo de lenguaje",
"embedding": "Embeddings",
"transcription": "Transcripción"
- }
+ },
+ "cacheLine": "Caché de prompts: {{reads}} tokens leídos de la caché y {{writes}} escritos en este periodo"
}
},
"apiTokens": {
diff --git a/static/locales/fr.json b/static/locales/fr.json
index 15af1655..029e1c48 100644
--- a/static/locales/fr.json
+++ b/static/locales/fr.json
@@ -426,7 +426,8 @@
"llm": "Modèle de langage",
"embedding": "Embedding",
"transcription": "Transcription"
- }
+ },
+ "cacheLine": "Cache de prompts : {{reads}} tokens lus depuis le cache, {{writes}} écrits, sur cette période"
}
},
"apiTokens": {
diff --git a/static/locales/pt-BR.json b/static/locales/pt-BR.json
index 8f3da0a3..6c41054d 100644
--- a/static/locales/pt-BR.json
+++ b/static/locales/pt-BR.json
@@ -426,7 +426,8 @@
"llm": "Modelo de linguagem",
"embedding": "Embedding",
"transcription": "Transcrição"
- }
+ },
+ "cacheLine": "Cache de prompts: {{reads}} tokens lidos do cache e {{writes}} gravados neste período"
}
},
"apiTokens": {
diff --git a/static/locales/ru.json b/static/locales/ru.json
index 5384951b..51132d21 100644
--- a/static/locales/ru.json
+++ b/static/locales/ru.json
@@ -426,7 +426,8 @@
"llm": "Языковая модель",
"embedding": "Эмбеддинги",
"transcription": "Транскрибация"
- }
+ },
+ "cacheLine": "Кэш промптов: прочитано {{reads}} токенов, записано {{writes}} за этот период"
}
},
"apiTokens": {
diff --git a/static/locales/zh.json b/static/locales/zh.json
index 9d60bc7b..d295b651 100644
--- a/static/locales/zh.json
+++ b/static/locales/zh.json
@@ -426,7 +426,8 @@
"llm": "语言模型",
"embedding": "嵌入",
"transcription": "转录"
- }
+ },
+ "cacheLine": "提示缓存:本周期从缓存读取 {{reads}} 个令牌,写入 {{writes}} 个"
}
},
"apiTokens": {
diff --git a/templates/admin.html b/templates/admin.html
index 8a14e1c8..db057779 100644
--- a/templates/admin.html
+++ b/templates/admin.html
@@ -455,6 +455,9 @@
<div class="lg:col-span-2 bg-[var(--bg-tertiary)] p-4 rounded-lg border border-[var(--border-primary)] shadow-sm min-w-0">
<h5 class="text-md font-medium text-[var(--text-secondary)] mb-3">${t('adminDashboard.statsPage.llmTokensPerDay')}</h5>
<div class="h-64"><canvas id="statsOperationsChart"></canvas></div>
+ <p v-if="overview && overview.usage.cache_reads" class="text-xs text-[var(--text-muted)] mt-2">
+ <i class="fas fa-bolt mr-1 text-[var(--text-accent)]"></i><span v-text="t('adminDashboard.statsPage.cacheLine', { reads: formatCompact(overview.usage.cache_reads), writes: formatCompact(overview.usage.cache_writes) })"></span>
+ </p>
</div>
<div class="bg-[var(--bg-tertiary)] p-4 rounded-lg border border-[var(--border-primary)] shadow-sm min-w-0">
<h5 class="text-md font-medium text-[var(--text-secondary)] mb-3">${t('adminDashboard.statsPage.minutesPerDay')}</h5>
diff --git a/tests/test_admin_stats_overview.py b/tests/test_admin_stats_overview.py
index d9db6140..1ef555ec 100644
--- a/tests/test_admin_stats_overview.py
+++ b/tests/test_admin_stats_overview.py
@@ -107,7 +107,7 @@ def test_tokens_split_by_task_with_embeddings_apart(world):
before = build_overview(7, today)
db.session.add_all([
TokenUsage(user_id=world["admin"], date=today, operation_type="chat", total_tokens=500, cost=0.5,
- request_count=2, model_name="m-chat"),
+ request_count=2, model_name="m-chat", cached_tokens=100, cache_write_tokens=40),
TokenUsage(user_id=world["admin"], date=today, operation_type="embedding", total_tokens=9000, cost=0.1,
request_count=3, model_name="m-emb"),
TranscriptionUsage(user_id=world["admin"], date=today, connector_type="asr_endpoint",
@@ -119,6 +119,8 @@ def test_tokens_split_by_task_with_embeddings_apart(world):
assert u1["operations"].get("chat", 0) - u0["operations"].get("chat", 0) == 500
assert "embedding" not in u1["operations"]
assert u1["embedding_tokens"] - u0["embedding_tokens"] == 9000
+ assert after["usage"]["cache_reads"] - before["usage"]["cache_reads"] == 100
+ assert after["usage"]["cache_writes"] - before["usage"]["cache_writes"] == 40
assert u1["minutes"] - u0["minutes"] == 20
models = {(m["kind"], m["model"]): m for m in after["usage"]["by_model"]}
assert models[("llm", "m-chat")]["requests"] == 2 and models[("embedding", "m-emb")]["tokens"] == 9000