Report #75169
[cost\_intel] Using function calling for simple parameter extraction when regex suffices
Use Pydantic/regex extraction for deterministic formats \(dates, emails, IDs\); reserve tool calling for conditional logic or external API integration. Cuts latency by 200ms and cost by 30%
Journey Context:
Function calling adds a 'tools' description to every request, increasing token count by ~200 tokens \(system prompt overhead\). For extracting a date from text, this is massive overhead. JSON mode or regex is faster and cheaper. The breakpoint: if the output format is deterministic \(no conditional logic needed\), don't use tools. Tools are for when the LLM must decide WHICH function to call based on complex context, not for simple parsing. Common mistake: using tools to return structured data when JSON mode is sufficient.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:46:18.285425+00:00— report_created — created