The page leanprompt report --html writes for KristopherKubicki/glimpser at commit 6378d2e, audited 2026-11-28. 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 KristopherKubicki/glimpser

leanprompt audit of KristopherKubicki/glimpser

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 3 other problems the audit found, listed after the findings. Not scored.

What's wrong and what to change

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

No confirmed findings.

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.

Default gpt-5-mini is deprecated for 2026-12-11 and the allowlist blocks switching

Note 1. app/config.py:404 LP-GE-13 medium not scored

The default model gpt-5-mini (config.py:410) is listed on OpenAI's deprecations page with shutdown Dec 11, 2026 (checked on 2026-11-28). ALLOWED_LLM_MODELS holds only gpt-5-mini, gpt-4.1 and gpt-4, and any other LLM_MODEL_VERSION raises ValueError at import (config.py:426-427), so an operator cannot set the replacement the page names without editing code. The list also offers gpt-4, whose shutdown on the same page was Oct 23, 2026, and gpt-4.1, listed as deprecated for Jan 14, 2027.

What to change
Replace the closed list with a check that only rejects an empty value (or make the list a warning), update the default and the list to models the page still serves, and mark retired ids in docs/configuration_guide.md:207.

How to check the fix Set LLM_MODEL_VERSION to a current model id and start the app: it should start and the requests should carry that id.

Summaries are cached without reading the finish reason

Note 2. app/utils/llm.py:312 LP-GE-12 high not scored

summarize() never reads choices[0].finish_reason. The text is turned into JSON lines (llm.py:312-320) and persisted by llm_cache.store, whether the model finished or stopped at the token limit. With a reasoning model, an empty or partial visible reply is possible when the budget is used up (the repo says so itself at image_processing.py:229), and an empty reply becomes the stored JSON object {}. summarize() runs from scheduled jobs (scheduling.py:1892), so nobody reads the result before it is saved. The caption path already logs finish_reason on an empty caption (image_processing.py:491).

What to change
Read finish_reason; on 'length' or empty text, do not store the result, and retry once with a larger budget or fall back to the local model.

How to check the fix Mock a response with finish_reason 'length' and assert nothing is written to llm_cache.

The summary and question paths send token caps that the repo's own caption path knows are wrong for gpt-5

Note 3. app/utils/llm.py:253 not scored

image_processing.py chooses max_completion_tokens for gpt-5 and o-series models, raises the budget to max(1024, tokens*8) because hidden reasoning counts against it, and sets reasoning_effort (lines 215-258). llm.py has its own request helper without that logic: summarize() (line 253, 4096) and ask_question() (line 355, 512) send max_tokens first. The helper expects that to be rejected and resends with the same raw cap and no reasoning_effort (llm.py:151-154), so if the API rejects it, each call is sent twice and ask_question leaves 512 tokens for reasoning and answer together. Not measured.

What to change
Reuse _chat_completion_token_payload from image_processing.py (or move it to a shared module) in both llm.py call sites, so the first request is already accepted and the budget leaves room for the answer.

How to check the fix With the default model, one summarize() call should show one request in the provider log instead of two, and ask_question() should return a non-empty answer on a short history.

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.

Other problems found (check each against the code first; not scored):
- Default gpt-5-mini is deprecated for 2026-12-11 and the allowlist blocks switching (app/config.py:404) [LP-GE-13]: The default model gpt-5-mini (config.py:410) is listed on OpenAI's deprecations page with shutdown Dec 11, 2026 (checked on 2026-11-28). ALLOWED_LLM_MODELS holds only gpt-5-mini, gpt-4.1 and gpt-4, and any other LLM_MODEL_VERSION raises ValueError at import (config.py:426-427), so an operator cannot set the replacement the page names without editing code. The list also offers gpt-4, whose shutdown on the same page was Oct 23, 2026, and gpt-4.1, listed as deprecated for Jan 14, 2027. Change: Replace the closed list with a check that only rejects an empty value (or make the list a warning), update the default and the list to models the page still serves, and mark retired ids in docs/configuration_guide.md:207.
- Summaries are cached without reading the finish reason (app/utils/llm.py:312) [LP-GE-12]: summarize() never reads choices[0].finish_reason. The text is turned into JSON lines (llm.py:312-320) and persisted by llm_cache.store, whether the model finished or stopped at the token limit. With a reasoning model, an empty or partial visible reply is possible when the budget is used up (the repo says so itself at image_processing.py:229), and an empty reply becomes the stored JSON object {}. summarize() runs from scheduled jobs (scheduling.py:1892), so nobody reads the result before it is saved. The caption path already logs finish_reason on an empty caption (image_processing.py:491). Change: Read finish_reason; on 'length' or empty text, do not store the result, and retry once with a larger budget or fall back to the local model.
- The summary and question paths send token caps that the repo's own caption path knows are wrong for gpt-5 (app/utils/llm.py:253): image_processing.py chooses max_completion_tokens for gpt-5 and o-series models, raises the budget to max(1024, tokens*8) because hidden reasoning counts against it, and sets reasoning_effort (lines 215-258). llm.py has its own request helper without that logic: summarize() (line 253, 4096) and ask_question() (line 355, 512) send max_tokens first. The helper expects that to be rejected and resends with the same raw cap and no reasoning_effort (llm.py:151-154), so if the API rejects it, each call is sent twice and ask_question leaves 512 tokens for reasoning and answer together. Not measured. Change: Reuse _chat_completion_token_payload from image_processing.py (or move it to a shared module) in both llm.py call sites, so the first request is already accepted and the budget leaves room for the answer.

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.

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

Scored 2026-11-28 (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.