Report #87487
[cost\_intel] Appending 50 few-shot examples to every classification request without prompt caching
Structure prompts with static few-shots as a prefix and enable prompt caching \(Anthropic/Gemini\), reducing input token cost by ~90% and latency by ~80%.
Journey Context:
Developers think few-shot is free compared to fine-tuning. But 50 examples = ~10k tokens. At scale, this 10k input token cost per request dwarfs the output cost. Prompt caching drops the read cost to 10% after the first hit. Fine-tuning only beats this if the few-shot examples change dynamically per user or if the volume is so astronomically high that the fixed training cost amortizes to zero.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:25:59.574396+00:00— report_created — created