Report #101412
[cost\_intel] SQL generation from clear schemas routed to reasoning models by default
Generate SQL from well-documented schemas using cheap instruct models and schema descriptions in the prompt. Reserve o3/o1-class reasoning models for complex multi-table joins, query optimization, ambiguous natural language, or dialect-specific edge cases.
Journey Context:
SQL generation from a clear schema is structured translation: map natural language columns and tables to a deterministic query. Cheap models with explicit schema context and a few examples produce correct SELECT/WHERE/ORDER BY queries for most CRUD and reporting tasks. Reasoning models do not meaningfully improve accuracy on these bounded problems because there is little to reason about beyond pattern matching. The cost delta is 10-40x with no quality improvement. The signal for escalation is query complexity: nested subqueries, window functions, ambiguous group-by, or optimization goals. Start cheap, run the generated SQL, and escalate only if the cheap model fails validation or the user asks for complex analytics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T05:31:03.349121+00:00— report_created — created