The page leanprompt report --html writes for firecrawl/firecrawl at commit 73aea36, audited 2026-11-29. 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 firecrawl/firecrawl

leanprompt audit of firecrawl/firecrawl

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.

1 place where this app pays for tokens it doesn't need

The biggest, at apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:1740, about 2.2k tokens per 1,000 calls: schema generation and crawler-options generation try up to three times, meant to be at temperatures 0, 0.1 and 0.3.

Together about 2.2k tokens per 1,000 calls An estimate from the code, not a measurement.

Tokens per 1,000 calls, by finding, and each one's share of the total

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-05apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:17402k prompt, 200 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

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

Schema generation and crawler-options generation try up to three times, meant to be at temperatures 0, 0.1 and 0.3.

Finding 1. apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:1740 medium LP-GE-05 how often is assumed

The temperature is never sent (the line is commented out in one function and absent in the other, and generateCompletions does not read options.temperature), so each retry is the same request. Every error, including permanent ones, is retried.

What to change
Either pass the temperature through to the request, or stop the loop after a failure that cannot change (a 4xx or an invalid key), and keep retries only for the unsupported-schema case.
Why it matters
A retry that sends the same request at the default temperature costs a full call and mostly repeats the failure; a permanent error costs three calls instead of one.
How often it happens
The code shows the problem; how often it happens is assumed. To measure it: how often schema or crawler-options generation fails or yields an unsupported schema, from their logs
Estimate
up to 2 extra small calls per failing schema or crawler-options generation; size is small
What the estimate assumes

these two functions are rare paths and the prompts are about 400 to 900 tokens, so the share of the whole app is tiny

How to check the fix With a failing key or a stub that records requests, count requests: three identical ones today, one after the change.

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.

The cost meter prices cached input tokens at the full input rate

Note 1. apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:519 LP-GE-11 medium not scored

calculateCost takes only input and output token counts and prices every input token at the full input price. The price book in model-prices.ts carries cache_read_input_token_cost for OpenAI models, but it is never used, and the cached share OpenAI reports is not read at any call site.

What to change
Read the cached token count from the usage the SDK returns, pass it to calculateCost and price it at the cached-input rate; record it separately in costTracking.addCall.
Why it matters
The cost meter and the cost limit it feeds overstate spend on calls that hit the cache, which are the repeated system prompts of the guard, summary and clean-content paths.

How to check the fix For one call with a cached prefix, the recorded cost matches the provider's bill for it.

Usage of a cut-off or fenced-JSON extraction call is not recorded in the cost meter

Note 2. apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:1125 LP-GE-11 low not scored

When generateObject fails with finishReason 'length', the code throws without calling costTracking.addCall, so the tokens of that billed call are missing from the meter. The fenced-JSON branch just below builds a usage object from error.usage and also never records it. The prompt injection guard handles the same case by recording error.usage in its catch block.

What to change
Call costTracking.addCall with error.usage before throwing, as promptInjectionGuard.ts does.

How to check the fix Force a length stop and check that costTracking has one call with the provider's token counts.

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.

Findings, largest first:
1. LP-GE-05 at apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:1740: Schema generation and crawler-options generation try up to three times, meant to be at temperatures 0, 0.1 and 0.3. The temperature is never sent (the line is commented out in one function and absent in the other, and generateCompletions does not read options.temperature), so each retry is the same request. Every error, including permanent ones, is retried.

Other problems found (check each against the code first; not scored):
- The cost meter prices cached input tokens at the full input rate (apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:519) [LP-GE-11]: calculateCost takes only input and output token counts and prices every input token at the full input price. The price book in model-prices.ts carries cache_read_input_token_cost for OpenAI models, but it is never used, and the cached share OpenAI reports is not read at any call site. Change: Read the cached token count from the usage the SDK returns, pass it to calculateCost and price it at the cached-input rate; record it separately in costTracking.addCall.
- Usage of a cut-off or fenced-JSON extraction call is not recorded in the cost meter (apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts:1125) [LP-GE-11]: When generateObject fails with finishReason 'length', the code throws without calling costTracking.addCall, so the tokens of that billed call are missing from the meter. The fenced-JSON branch just below builds a usage object from error.usage and also never records it. The prompt injection guard handles the same case by recording error.usage in its catch block. Change: Call costTracking.addCall with error.usage before throwing, as promptInjectionGuard.ts does.

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).

99static
E, prefill reuse
0.99
S, prefix stability
1.00
G, generation waste
0.01
Default shares
0 of 1

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-29 (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.