AI operations: every AI app's cost, accuracy and speed

A warehouse of what every AI app costs, how often it is right and where its time goes. Built each day from the runs the apps publish, every published figure rebuilt.

Status
Shipped
Started
Nov 8, 2026
Updated
Nov 10, 2026
Stack
Python, dlt, dbt, Airflow, DuckDB, Databricks, Snowflake, AWS
Links
Code and documentation on GitHub

Results

Every figure the apps published comes back from the rows underneath it, and every model call costs exactly its tokens at its day's list price.

From a load of the apps' Nov 7 commits on Nov 8, 2026, on DuckDB, as the repository's results report it; the daily build on Databricks has passed on every run since, and the same build has run on Snowflake since Nov 10.

194 of 194published figures rebuilt

  • 319 of 319model calls costed exactly
  • $7.02spent on 10 live runs
  • 128 of 128pass on Databricks and Snowflake

Every figure the apps published in a run's summary, across 12 runs, rebuilt from the case rows within its rounding.

Loaded: 16 run files (10 live, 2 offline, 4 retrieval), 600 cases and 60 scenarios, 7,800 scores, 893 spans, the 167 model calls and 224 tool calls the intake agent recorded, and 11 model prices.

Every live run in the load, by app
App and runDateCasesJudged rightCost per caseMedian95th percentile
EEOC, extractionOct 174093.0% of fields$0.01194.3 s4.8 s
EEOC, extractionOct 1740100%$0.01344.2 s6.5 s
EEOC, extractionOct 26200100%$0.01344.5 s5.6 s
EEOC, extractionNov 740100%$0.01334.4 s6.2 s
Grounded, keywordOct 295686.7% of answers$0.00792.7 s6.0 s
Grounded, hybridOct 295688.9%$0.00842.7 s8.3 s
Grounded, keywordNov 75688.9%$0.00822.8 s5.8 s
Grounded, hybridNov 75688.9%$0.00812.4 s6.3 s
Intake agentOct 2920100% of verdicts$0.02467.9 s10.7 s
Intake agentNov 720100%$0.02456.7 s9.3 s

Every model here is claude-sonnet-5-5. Judged right is each app's own measure, averaged over its cases: the fields read right (EEOC), the answers right (Grounded), and the verdict shown to the approver matching the expected one (the intake agent).

The model call is 98.6% (the intake agent) to 99.8% (EEOC, and Grounded by keywords) of a traced case's time. Hybrid retrieval is 0.6% of a Grounded answer, the intake agent's tool calls 1.1%, and every quote check under 0.1%. So the model is the lever for speed, and the retrieval mode is a question of quality, not time.

System design

Every project follows the same seven layers, from what people use down to where its data comes from, and fills only the ones its problem needs.

  • ProductNot yet: the case studies' figures and a dashboard will read the marts
  • IntelligenceNone of its own: it measures the apps' models
  • ServingMarts under enforced contracts; reports of cost, run changes and latency; the dbt docs
  • Modelingdbt: facts per run, case, model call, tool call and span; prices kept as type 2 history
  • Storageraw_ai_ops in DuckDB locally and in CI, Databricks and Snowflake daily; a dated copy in the S3 lake
  • Ingestiondlt, merging on natural keys under a Pydantic contract per table; only numbers from traces
  • SourcesEach app's run files and traces at pinned commits; the toolkit's dated price list

Across every layer

  • Orchestration Airflow 3: the load updates an asset and the build runs on it; GitHub Actions runs both daily
  • Quality Every published figure rebuilt from case rows, the build failing beyond rounding; 92 data tests
  • Governance No prompt, answer or tool text loaded, and a test proves it; the CI role never deletes
  • Observability Where the apps' traces land: every span modeled into where each case's time goes
  • CI/CD Lint, strict types, 27 tests, the real load and build on DuckDB, and the DAG tests
  • Cost Every call costed at its day's list price; it runs for cents a month

The problem

Every AI app on this site publishes its runs: what each case cost, how long it took and whether it was right. Each app's own page shows its latest numbers. None of them answers what a business asks once it runs more than one: what does AI cost us, which app is getting better or worse, and where does the time go? Nor can an app's own report check itself.

This project answers those questions from the outside. It reads what every app publishes, models it into one warehouse, and checks each figure an app reported against the rows underneath it. I'm building it for whoever runs AI in production and answers for its bill, the person who wants one place to look rather than three.

Constraints

  • Read only. It reads what the apps commit to their public repositories, at pinned commits, and never calls a model itself.
  • Only numbers. The apps' traces were recorded with their prompts and answers, since nothing in their test sets is private. The loader keeps each span's ids, times, status and token and cost figures, and nothing a document or a person said: no prompt, answer, search query or tool argument. A test checks that no raw column could hold text.
  • Repeatable. Pins are full commit SHAs, so the same pins always give the same rows, on a laptop, in CI, on Databricks and on Snowflake.
  • No stored keys. GitHub Actions reaches AWS through a role it assumes with its OIDC token, and signs in to Snowflake with a token of the same kind, each job as a service user of its own. The role, the lake and the service users belong to the data platforms, a project of their own.

Design

  1. Load. dlt lists each app's results folder at its pinned commit through GitHub's API, reads every run file and trace, and merges each table on its key, so a second load of the same pins changes nothing.
  2. Contract. Each raw table is a Pydantic model, which dlt also reads for the table's columns. A field the contract doesn't know fails the load instead of quietly adding a column.
  3. Model. dbt's staging views rename and cast, intermediate views line the apps' two run formats up to one grain, and the marts are tables under enforced contracts. A trace's case id lives only on its root span, so a window function hands it down to every span under it.
  4. Reconcile. The run metrics fact rebuilds every figure an app published in a run's summary (means, sums, ratios and nearest-rank percentiles) from the case rows, beside the published value. The build fails if any pair differs by more than the figure's rounding.
  5. Price. Each model call is costed at the list price valid on its run's date, from the toolkit's dated price list kept as type 2 history, and a test holds every recorded cost to it.
  6. Schedule. One Airflow DAG loads and updates an asset, and the build DAG runs on that asset rather than on a clock. Every task runs the same pipelines command a person would, so moving to a hosted Airflow changes the deployment, not the code.
  7. Run. On DuckDB on a laptop and in every pull request, in about a minute, for nothing. In production on Databricks every day, on the Free Edition's serverless SQL warehouse, with the warehouse and its docs copied to the lake by date, and on Snowflake every day too, on a warehouse that stops a minute after the build ends.

The marts

Model One row per
dim_apps, dim_models App, with the measure its runs are judged by; model, with its current list prices
dim_model_prices Model per version of the price list, type 2: valid from its date until the next
fct_eval_runs Evaluation run: cases, failures, cost, percentiles, tokens, the judged measure
fct_eval_cases, fct_case_metrics Case of a run, with its tags and tokens; measure of a case
fct_run_metrics Published summary figure, rebuilt beside the published value
fct_model_calls, fct_tool_calls Model call, from the trace or the agent's record, at list price; tool call
fct_spans Span of a committed trace, with its case
rpt_cost_by_month Month, app and model, over live runs
rpt_run_changes Live run beside the last run of its name: how the judged measure, cost and time moved
rpt_latency_by_operation Traced run and operation, an operation's time including the spans under it
rpt_field_accuracy Run and field, for an app that scores each field: how often the model read it right

Evaluation

A warehouse that disagrees with the apps is worse than none, so the build checks itself against them on every run. All 194 figures the apps published across 12 runs come back from the case rows within their rounding, and all 319 model calls cost exactly their tokens at the list price of their day. Both checks are among 92 data tests, beside 4 unit tests, and pass the same on DuckDB, on Databricks and on Snowflake.

What it found is plain once the apps sit side by side. Extraction went wrong in one run only, the EEOC's first, and in one field only: issues, on 28 of its 40 documents. That is what the EEOC project's own results say of that run, read here from the rows. And the model call is nearly all of every app's time, so a faster answer means a faster model, not faster retrieval.

Human review points

None are needed inside it: it reads published results and writes only its own warehouse. The review is of what it reads. A new run reaches the warehouse only when its app's pin moves, and a pin moves in a commit a person reviews.

Security and logging

The CI role trusts this repository's main branch by name and numeric id, through GitHub's OIDC token, for an hour at most, and can list, read and add objects in one bucket, never delete them. On Snowflake no secret signs anyone in: the load and the build each present a token GitHub gives the job, and a service user trusts it only from this repository, by name and id, in an environment only main may use; the loader can write only the raw schema, the builder only the models. Whatever names an account, the role, the bucket, the Databricks host and token and the Snowflake account among them, is a repository secret, so the public logs mask it. Every load and build writes structured logs, and the traces' text never loads at all.

Known limitations

  • The pins hold each app at its main after the Nov 8 merges, so the runs since wait for a pin to move. Grounded's judged runs wait for one more thing: traces that tell the judge's calls from the answers', or cost per answer would count both.
  • There is no semantic layer yet: the share judged right, the judge's agreement and cost per run are defined in the marts' SQL, not once for every tool that reads them.
  • No product reads the marts yet. The dashboards and the case studies' figures are next.
  • The Databricks Free Edition runs in Databricks' own hosting, not in the AWS account; a workspace that reads the lake through Unity Catalog needs a trial.
Kevin Street, smiling, arms crossed, leaning against a brick wall

Work with me

If you have an AI or data problem, or a question you've been meaning to ask someone, email me with a sentence or two about it and we'll set up a time to talk.

Follow me on LinkedIn and GitHub.