Translation Cost & Memory
This page is the audit + optimisation surface for paid translation. It tracks every translation job’s cost, surfaces hit-rate of the translation memory (TM), and lets you prune the TM when it gets stale. The goal is simple: pay once per unique cue, not once per re-run.
Where it lives
Section titled “Where it lives”Settings → Translation → Cost & Memory — split into two tabs that share the page:
| Tab | Content |
|---|---|
| Cost | Per-job cost log + aggregate by backend, day, and series. |
| Memory | Translation memory entries with hit count, last-used timestamp, source + target. |
Cost tab
Section titled “Cost tab”Every completed translation job writes a row to translation_events:
| Field | Effect |
|---|---|
| Job ID | Unique identifier; click to open the produced file. |
| Series / Movie | Source media. |
| Backend | The provider that did the work. |
| Source language → Target | Language pair. |
| Tokens / chars in | Input volume sent to the backend. |
| Tokens / chars out | Output volume returned. |
| Latency | Wall-clock time from queue to finish, in seconds. |
| Cost (USD) | Computed from in/out volumes × backend’s configured price. |
| TM hit rate | Fraction of cues served from translation memory rather than the backend. |
Aggregations
Section titled “Aggregations”The header shows running totals:
| Tile | Period |
|---|---|
| Today | Jobs in the current server-day. |
| Last 7 days | Rolling week. |
| Last 30 days | Rolling month. |
| All time | Since the database was created. |
Each tile breaks down per backend so you can see where spend lives. Click a tile to expand into a per-backend daily chart.
Per-backend price
Section titled “Per-backend price”Cost is computed at job time from the configured price under Settings → Translation → Backends → <backend> → Price. Changing the price doesn’t retroactively rewrite history — but the new price applies to every new job. For OpenAI / Anthropic / Gemini, prices are per 1M input + output tokens; for DeepL / Azure, per 1M characters.
Memory tab
Section titled “Memory tab”Translation memory caches (source language, source text, target language, backend) → translated text. On every translation job, Sublarr checks the cache first; only cache misses hit the backend.
Why it matters
Section titled “Why it matters”| Scenario | Without TM | With TM |
|---|---|---|
| Re-translate same episode after editing a cue | Re-translate the entire file | Hit cache for unchanged cues, only pay for the edited one |
| Translate a recap episode | Pay full cost for all the recapped lines | Cache hit — recap lines already translated for prior episodes |
| Same cue across multiple shows (e.g. opening credits) | Pay each time | Pay once |
Memory entries
Section titled “Memory entries”| Column | Effect |
|---|---|
| Source text | Cue text exactly as it appeared. |
| Target text | Translated rendering. |
| Source / target language | Language pair. |
| Backend | Backend that produced this entry — the cache is keyed per backend so quality stays consistent. |
| Hits | How many times this entry was served from cache. |
| Last used | Timestamp of the most-recent hit. |
| Created | Original translation timestamp. |
Filtering and search
Section titled “Filtering and search”| Filter | Effect |
|---|---|
| Search | Substring match on source or target text. |
| Backend | Restrict to one backend. |
| Language pair | en → de, ja → en, etc. |
| Min hits | Only entries used at least N times — finds your “load-bearing” cache. |
| Last used | ”Older than 90 days” — finds candidates for pruning. |
Pruning
Section titled “Pruning”When the TM grows too large or contains entries from a backend you no longer use:
| Action | Effect |
|---|---|
| Delete selected | Remove specific rows. |
| Delete by filter | Delete every row matching the current filter. Confirm prompt shows count. |
| Delete by backend | Drop everything from a specific backend (after a quality regression, e.g.). |
| Reset | Wipe the entire TM. Future jobs start with cold cache. |
Hit-rate optimisation
Section titled “Hit-rate optimisation”The TM hit rate per job is a quick proxy for how much money you’re saving:
| Hit rate | Reading |
|---|---|
| 0% | Cold start or unique content. |
| 10–30% | Typical for fresh anime — a lot of unique dialogue. |
| 40–60% | Recap episodes, sequels reusing OP/ED, sitcoms with catchphrases. |
| 70%+ | Re-translation after an edit; or repetitive content (clip shows, training videos). |
If hit rate is consistently below your expectation:
- Confirm the same backend is used (cache is keyed per backend).
- Confirm the source language hasn’t been re-detected (a swap from
entoundwould miss the cache). - Ensure the source file hasn’t been re-encoded with subtle whitespace differences — the TM is exact-match on text.
Memory across backends
Section titled “Memory across backends”Each backend has its own cache because translation quality differs. Switching the primary backend means:
| Effect | What happens |
|---|---|
| First job after switch | Cache miss for everything; full cost on the new backend. |
| Old backend’s cache | Still present; usable if you switch back. |
| Hybrid runs | Mid-job backend swap (e.g. Ollama failed, fall back to Claude) creates two separate cache entries per cue. |
Use Settings → Translation → Memory → Backend filter to inspect each backend’s cache independently.
Export for analysis
Section titled “Export for analysis”Both cost rows and memory entries can be exported as CSV from the page header. Useful for:
- Monthly cost reconciliation against your backend’s invoice.
- Sharing with auditors.
- Bulk editing the TM externally and re-importing.