Telemetry
AI and LLM SQL recipe

Measure Accepted AI Outputs per Dollar

Connect model spend to accepted, saved, or otherwise useful product outcomes.

Intermediatellm_requestsReviewed 2026-07-27

Question answered

Which model and feature combination produces the most accepted outputs per dollar?

The cheapest model is not efficient when users discard its output. This query compares accepted-output rate with spend to produce a value-oriented unit metric.

Event contract

Fields the query expects

FieldTypeWhy it exists
timestamp_utcTimestampWhen the workflow outcome was recorded.
featureUtf8Stable product feature.
modelUtf8Provider model identifier.
acceptedBooleanWhether the user accepted or saved the result.
estimated_cost_usdFloat64Cost of the model request.
DataFusion SQL

Copy the query

sql
SELECT
  feature,
  model,
  COUNT(*) AS completed_outputs,
  SUM(CASE WHEN accepted = true THEN 1 ELSE 0 END) AS accepted_outputs,
  100.0 * SUM(CASE WHEN accepted = true THEN 1 ELSE 0 END)
    / NULLIF(COUNT(*), 0) AS acceptance_rate_pct,
  SUM(estimated_cost_usd) AS cost_usd,
  SUM(CASE WHEN accepted = true THEN 1 ELSE 0 END)
    / NULLIF(SUM(estimated_cost_usd), 0) AS accepted_outputs_per_dollar
FROM llm_requests
WHERE timestamp_utc >= now() - INTERVAL '30 days'
GROUP BY feature, model
HAVING COUNT(*) >= 50
ORDER BY accepted_outputs_per_dollar DESC;

This recipe is read-only and reviewed against Telemetry's DataFusion query patterns. Sample output is deterministic and synthetic; validate field types, thresholds, and business definitions against your own data.

Query result

Accepted outputs per dollar

The largest model wins on acceptance rate but loses on cost-adjusted throughput.

featuremodelcompleted_outputsaccepted_outputsacceptance_rate_pctcost_usdaccepted_outputs_per_dollar
support_draftfast-small4,2003,108746349.33
document_summarybalanced-medium1,7001,3948278.217.83
research_reportreasoning-large51046490.982152.16

Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.

How the SQL works

  1. 1Acceptance rate measures quality only among completed outputs. Accepted outputs per dollar adds economic efficiency.
  2. 2The minimum sample threshold avoids declaring a winner from a handful of requests.
  3. 3Acceptance must be defined from real product behavior such as saved, sent, applied, or copied—not an assumed model-quality label.

Edge cases to decide

  • A discarded output may still be useful if it informed a later action; choose the outcome signal with product context.
  • Compare models within the same feature because workflow difficulty changes acceptance.
  • Use confidence intervals before making costly model migrations from small differences.

Recommended dashboard

  • Bar chart: accepted_outputs_per_dollar by feature and model
  • Line chart: acceptance_rate_pct over time
  • Table: cost, latency, and outcome for model experiments

Alert guidance

Alert on sharp acceptance-rate drops after a model, prompt, or tool change; review cost efficiency as a dashboard rather than a paging alert.

Read alert setup

Put the recipe to work

Related instrumentation and guides

Continue the analysis

Run it on real events

Create a table, adapt the fields, and save the result

Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.

Get an API key