DET009infoPro

uncached-llm-call

LLM API call without @cache decorator wastes money on duplicate requests

Applies to: Python

Why this matters

LLM API calls are expensive and non-deterministic. The same prompt can return different results each time, making debugging harder and costing money on redundant requests. Wrapping calls with @cache ensures deterministic results and eliminates duplicate API costs.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, DET009 includedstablestack explain DET009

DET009 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: DET009