The page leanprompt report --html writes for wendy7756/AI-Video-Transcriber at commit 7f1c619, audited 2026-11-27. Every figure on this page is an estimate from reading the code, not a measurement of the app in use. Corrections and takedown: email info@podwarden.com or open an issue. Back to the audit of wendy7756/AI-Video-Transcriber

leanprompt audit of wendy7756/AI-Video-Transcriber

Unattended audit: nobody was asked during the run, so priority, volume and prices were left open; the questions for the owner are listed at the end.

The audit found no place where this app pays for tokens it doesn't need

Plus 2 findings the project already knows about (planned, in progress, reported or declined), listed after the findings. They are not in the totals or the score.

Plus 2 other problems the audit found, listed after the findings. Not scored.

What this costs you

Every figure here is an estimate from the code, not a measurement. Findings can overlap (one failed call can show up in two), so the sum may count some tokens twice. Money is not part of the score. The table lists this app's findings first, largest first, then its open questions, then the questions for the server's administrator, then the findings the project already knows about, which are not in the totals.

FindingWhereTokens per 1,000 calls
LP-GE-03 (already reported)backend/summarizer.py:109580k prompt, 80k output
LP-GE-03 (already reported)backend/translator.py:3026.6k prompt, 23k output

To see this in money, add to leanprompt.yaml:

  • volume: {calls_per_month: N}: how many calls the app makes a month (with targets:, on each entry)
  • prices: per model: input, cached_input and output per 1M tokens (US dollars, or set currency), with source and checked date (or, self-hosted, engine: {prefill_tokens_per_second: N})

leanprompt never guesses a volume or a price. Your coding agent can look up the provider's current price page and add it with the date; how.

What's wrong and what to change

0 open, 2 already known to the project, 0 fixed. Largest first, by the audit's estimate of tokens lost per 1,000 calls.

No confirmed findings.

Already known to the project

The project's own issues, pull requests or docs already cover these, so they are not new and are not in the totals or the score. Read the link before working on one.

Section summaries are capped at 600 output tokens and transcript formatting at 4,000, and the cap includes a reasoning model's thinking.

Finding 1. backend/summarizer.py:1095 medium LP-GE-03 how often is assumed

On a reasoning or hybrid model the first attempt often spends the cap thinking, comes back empty, and is sent again with double the cap.

What to change
Size the caps for reasoning models: raise the section-summary cap (for example to 2,000) and the formatting cap, or make the caps configurable next to the model id, so the first attempt can finish.
Why it matters
Each empty first attempt pays for the whole prompt and the whole cap of output, then the retry pays again. The app already logs these retries (llm_client.py:43), which is the waste this finding counts.
How often it happens
The code shows the problem; how often it happens is assumed. To measure it: how often finish_reason is length on the section-summary calls (max_tokens 600, line 1095) and the transcript-formatting calls (max_tokens 4000, line 328), from the provider's logs or the 'LLM 返回空内容' warnings that llm_client.py already writes
Already reported
Issue #52 (closed) traced empty answers from reasoning models to thinking that used up max_tokens; the fix in 7f1c619 retries an empty answer once with a doubled cap. The caps themselves stay as they were, and an answer that is cut off but not empty is not covered (see the note). https://github.com/wendy7756/AI-Video-Transcriber/issues/52
Estimate
about 80k output and 80k prompt tokens per 1,000 calls (estimate)
What the estimate assumes

a 30-minute talk makes about 18 calls: 7 formatting, 7 section summaries, 1 merge, about 3.5 translation; average call about 1,230 prompt and 790 output tokens; 30% of calls go to a reasoning or hybrid model (GPT-5.5 defaults to medium effort; DeepSeek hybrids); of those, half the 600-cap calls and a tenth of the 4,000-cap calls come back empty the first time

How to check the fix Count the 'LLM 返回空内容' warnings with finish_reason=length per task before and after; with the larger caps they should fall to near zero and output tokens per task fall.

Each translation chunk is up to 4,000 characters and the output cap is 4,000 tokens including thinking.

Finding 2. backend/translator.py:302 medium LP-GE-03 how often is assumed

Translating 4,000 Chinese characters into English is about 3,400 visible tokens, which leaves little room for a reasoning model's thinking.

What to change
Cut translation chunks smaller (for example 2,500 characters) or raise the cap for the chunk calls and the single-text call (line 257), so a whole chunk fits with room for thinking.
Why it matters
A chunk that runs out of room either comes back empty and is retried (both attempts billed) or comes back cut off, and the cut-off tail is lost (see the note on cut-off answers).
How often it happens
The code shows the problem; how often it happens is assumed. To measure it: how often translation chunk calls end with finish_reason length, from the provider's logs; the cases with non-empty content are not logged by the app today
Already reported
Issue #52 (closed) traced empty answers from reasoning models to thinking that used up max_tokens; the fix in 7f1c619 retries an empty answer once with a doubled cap. The caps themselves stay as they were, and an answer that is cut off but not empty is not covered (see the note). https://github.com/wendy7756/AI-Video-Transcriber/issues/52
Estimate
about 23k output tokens per 1,000 calls (estimate)
What the estimate assumes

translation is about 19% of calls (it runs only when the video language differs from the summary language); 30% of calls on a reasoning model, a tenth of those empty on the first try; 4,000 Chinese characters is about 2,600 English words, about 3,400 tokens

How to check the fix Translate a 30-minute Chinese transcript to English with a reasoning model; no chunk should end with finish_reason length, and the translation's last sentence should match the transcript's last sentence.

Other problems the audit found

Problems the audit checked in the code that cost no tokens of their own, such as a spend meter that ignores cache tokens or a cut-off answer accepted as complete. They are not scored. Check each one before you change anything.

A cut-off answer is accepted as complete

Note 1. backend/llm_client.py:39 LP-GE-12 medium not scored

complete_text returns any non-empty content at line 39 without looking at finish_reason. Only an empty answer is checked for length (line 48). A transcript chunk, translation chunk or summary that stopped at max_tokens is stored and shown as if whole, and nothing is logged.

What to change
Check finish_reason before returning: on length, log it and retry once with the larger budget the empty case already uses (line 49); if the retry is still cut off, return it with a warning or raise so the existing fallback runs.
Why it matters
A reasoning model's thinking counts toward max_tokens, so on long chunks the visible text can stop mid-sentence. Users lose the end of each chunk with no sign in the log or the UI.
Same problem as
finding 2

How to check the fix Add a test next to tests/test_empty_llm_content.py where the fake client returns content='partial' with finish_reason='length' first and a full answer second; complete_text should return the second.

The single-pass summary path is almost never taken

Note 2. backend/summarizer.py:1004 not scored

summarize() uses one call only when _estimate_tokens is at most 4,000, but _estimate_tokens adds a fixed 2,500 (line 112). That leaves about 1,500 tokens: roughly 700 English words or 900 Chinese characters, 3 to 5 minutes of speech. The comment at line 1002 says the limit was raised to prefer the single-call path.

What to change
Compare the transcript's own estimate (without the 2,500) to the limit, or raise the limit for models with large context windows, keeping the chunked path for small local models.
Why it matters
A 30-minute talk becomes about 7 section summaries plus a merge: 8 sequential calls instead of 1, about 1,400 extra output tokens and 2,300 extra prompt tokens per task, and a summary of summaries.

How to check the fix Log which path summarize() takes for a 10-minute and a 30-minute transcript before and after the change.

Fix it with your coding agent

Paste this into Claude Code, Codex, Cursor or any coding assistant. It will check each finding against your code and propose fixes one at a time, asking before it changes anything.

Please check and fix the LLM-call findings from a leanprompt audit of this repository.

1. If the leanprompt skills are not installed for you here, install them: npx leanprompt@0.1.0-dev.15 install
2. Read .leanprompt/findings.json and leanprompt-report.md. If they are missing, use the list below.
3. Check each finding against the code before you change anything. The audit can be wrong: if a finding does not hold, tell me why and leave that code alone.
4. Fix one finding at a time. Show me the change as a small diff and apply it only after I say yes.
5. Prove each fix with the measure-loop skill: a before and after on the same scenario. Ask me before running anything that sends real, billed requests.
6. When a fix is proved, set "fixed": true on its finding in .leanprompt/findings.json and run npx leanprompt@0.1.0-dev.15 score.

Already known to the project (read the link first; do not duplicate work the project has planned or started):
- LP-GE-03 (backend/summarizer.py:1095): Section summaries are capped at 600 output tokens and transcript formatting at 4,000, and the cap includes a reasoning model's thinking. On a reasoning or hybrid model the first attempt often spends the cap thinking, comes back empty, and is sent again with double the cap. Already reported: Issue #52 (closed) traced empty answers from reasoning models to thinking that used up max_tokens; the fix in 7f1c619 retries an empty answer once with a doubled cap. The caps themselves stay as they were, and an answer that is cut off but not empty is not covered (see the note). https://github.com/wendy7756/AI-Video-Transcriber/issues/52
- LP-GE-03 (backend/translator.py:302): Each translation chunk is up to 4,000 characters and the output cap is 4,000 tokens including thinking. Translating 4,000 Chinese characters into English is about 3,400 visible tokens, which leaves little room for a reasoning model's thinking. Already reported: Issue #52 (closed) traced empty answers from reasoning models to thinking that used up max_tokens; the fix in 7f1c619 retries an empty answer once with a doubled cap. The caps themselves stay as they were, and an answer that is cut off but not empty is not covered (see the note). https://github.com/wendy7756/AI-Video-Transcriber/issues/52

Other problems found (check each against the code first; not scored):
- A cut-off answer is accepted as complete (backend/llm_client.py:39) [LP-GE-12]: complete_text returns any non-empty content at line 39 without looking at finish_reason. Only an empty answer is checked for length (line 48). A transcript chunk, translation chunk or summary that stopped at max_tokens is stored and shown as if whole, and nothing is logged. Change: Check finish_reason before returning: on length, log it and retry once with the larger budget the empty case already uses (line 49); if the retry is still cut off, return it with a warning or raise so the existing fallback runs.
- The single-pass summary path is almost never taken (backend/summarizer.py:1004): summarize() uses one call only when _estimate_tokens is at most 4,000, but _estimate_tokens adds a fixed 2,500 (line 112). That leaves about 1,500 tokens: roughly 700 English words or 900 Chinese characters, 3 to 5 minutes of speech. The comment at line 1002 says the limit was raised to prefer the single-call path. Change: Compare the transcript's own estimate (without the 2,500) to the limit, or raise the limit for models with large context windows, keeping the chunked path for small local models.

Score

One number from 0 to 100 for how well this app avoids paying for the same tokens twice; higher is better. It is computed from the findings above (static) or from your usage log (measured).

100static
E, prefill reuse
1.00
S, prefix stability
1.00
G, generation waste
0.00
Default shares
0 of 0

Findings scored with severity defaults, not estimates. The fewer, the more the static score says about this app.

It leaves out 2 findings the project already knows about (planned, in progress, declined or reported); with them it would be 90.

A static score is an estimate from the audit's findings, not a measurement.

Scored 2026-11-27 (the date on the machine that ran it).

Questions for the owner

These were not answered during the audit. Until they are, the page shows tokens only and ranks the advice without a priority.

  • Priority: which matters most for this app, cost, speed or quality (or weights)? Not set, so the advice uses equal weights. Answer with priority: in leanprompt.yaml.
  • Volume: how many calls does the app make a month? Answer with volume: {calls_per_month: N, source: "..."} in leanprompt.yaml.
  • Prices: what does each model cost (input, cached input, output per 1M tokens, with the source and the date it was read, and the currency if not US dollars)? Answer with prices: in leanprompt.yaml.