Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,24 @@ Standard API prices in **USD per million tokens**, checked **8 November 2026** a
| Cache write (5 minutes) | $0.125 | $0.625 |
| Cache read | $0.01 | $0.05 |

For example, **10,000 uncached input + 2,000 output tokens cost $0.002** at the lower tier (one fifth of a US cent). This illustrates the rate, not a measured cost per conversation. A conversation can require multiple requests and a repair attempt; token counts, caching and retries determine the bill. Rules and compatible reused results avoid model calls. Viewing stored results incurs no model cost.
### What our actual run cost

Each evaluation records token usage and model provenance. The [comparison CLI](evaluation/README.md#3-compare-with-the-model) can estimate cost using supplied input/output rates; treat it as an estimate, not a provider invoice.
Recovered from the stored **8 November 2026, `eval-v17`** job over **75 conversations (70 chats + five voice transcripts)**, using Haiku 5.5 at medium effort:

| Measurement | Recorded result |
|---|---:|
| Completed / validation failures | **73 / 2** |
| Token-priced cost of the 73 completed evaluations | **$0.23446** |
| Mean cost per completed conversation | **$0.00321** (0.32 US cents) |
| Mean / median evaluation time | **10.50 s / 8.83 s** |
| p95 evaluation time | **27.33 s** |
| Job start to last stored outcome | **4 min 33 s** |

The successful evaluations recorded 659,072 uncached input, 285,021 output, 936,434 cache-read and 133,433 cache-write tokens. **Failed-evaluation usage was not saved, so the $0.23446 excludes the two failures and is not the full provider bill.** Repair responses returned to successful evaluations are included; earlier diagnostics and usage lost inside provider retries are outside these records.

See the [measurement report](docs/MEASURED_RUN.md) and [aggregate JSON](docs/measurements/2026-11-08-eval-v17.json) for the exact run, rates, arithmetic and accounting boundary. These are actual stored usage measurements, not an illustrative token budget; no rerun was needed. They measure cost and completion, not scoring accuracy.

Rules and compatible reused results avoid model calls; viewing stored results incurs no model cost. Transcript length, output, caching and repairs determine the cost of a new evaluation. The [comparison CLI](evaluation/README.md#3-compare-with-the-model) also estimates cost from provenance using supplied rates.

## Technical reading guide

Expand Down
60 changes: 60 additions & 0 deletions docs/MEASURED_RUN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Measured cost and latency: 75-conversation run

On 8 November 2026, one stored job evaluated all **75 conversations: 70 chats and five voice transcripts**, across RU/KZ/EN. It produced **73 completed evaluations and two validation failures**. The completed work recorded **$0.23446** in token-priced cost, averaging **$0.00321 per completed conversation** (about 0.32 US cents).

These figures were recovered from existing evaluation provenance; no additional model calls were made to produce this report. The [aggregate JSON](measurements/2026-11-08-eval-v17.json) contains the counts, token totals, rates, timestamps and exact job identifier. It contains no transcript text, quotes, audio URLs or reference labels.

## Run scope

| Field | Value |
|---|---|
| Source | Local runtime `data/cqa.sqlite`, job `job-775230bf-cc74-409b-b4fb-7048b3e66bea` |
| Inputs | 65 DEV + 10 control; RU 39, KZ 19, EN 17 |
| Model / effort | `claude-haiku-5-5` / `medium`, Anthropic API |
| Prompt / evaluator | `eval-v17` / `operator-v3` |
| Checklist | `checklist-original-v1` |
| Started → last result stored | 2026-11-08 06:09:51.903 → 06:14:25.290 UTC |
| Observed time to store all 75 outcomes | 273.387 seconds (4 min 33 s) |
| Completed / failed | 73 / 2; 68 chats + all five calls completed |
| Completed evaluations with usage | 73 of 73 |
| Failed evaluations with usage | 0 of 2 |
| Reused criterion results | 0; deterministic rules still apply |

This is the application's concurrent evaluation job, not Anthropic's discounted Batch API. Selecting exactly its 75 stored evaluation IDs avoids mixing earlier runs, checklist demos or successful fallback results with the measured run. In particular, an older completed evaluation displayed after a newer failure is not counted as success here.

## Recorded tokens and cost

Prices are USD per million tokens, [verified against Anthropic](https://platform.claude.com/docs/en/models/haiku-5-5/overview) on 8 November 2026. These successful evaluations each recorded at most 47,176 combined input tokens across their requests; each individual request therefore falls in the up-to-100K prompt tier.

| Category | Recorded tokens | USD / million | Calculated USD |
|---|---:|---:|---:|
| Uncached input | 659,072 | 0.10 | 0.065907200 |
| Output | 285,021 | 0.50 | 0.142510500 |
| Cache read | 936,434 | 0.01 | 0.009364340 |
| Cache write (5 minutes) | 133,433 | 0.125 | 0.016679125 |
| **Total, 73 completed evaluations** | | | **0.234461165** |

Formula: `sum(tokens_in_category × USD_per_million_in_category) / 1,000,000`. Mean: `$0.234461165 / 73 = $0.0032117968` per completed evaluation. Cache reads and writes are priced separately, rather than charging all input at the uncached rate.

## Evaluation latency

Times below use the stored elapsed evaluation time for the same 73 completed evaluations, covering the evaluator's concurrent request slices and repair attempts.

| Metric | Seconds |
|---|---:|
| Mean | 10.50 |
| Median | 8.83 |
| p95 (nearest rank) | 27.33 |
| Minimum / maximum | 4.56 / 40.82 |

The observed 4 min 33 s is job start to last stored outcome, including the failed outcomes and concurrent processing. It is not the sum of per-evaluation times or a repeated performance benchmark.

## Accounting boundary

**This is measured token usage priced at published rates, not the complete provider bill.** Both failed evaluations lack persisted usage, so their spend is unknown and excluded from $0.23446. Successful-evaluation usage includes responses returned for schema repair, but usage lost inside provider-level retries is not guaranteed to be captured. Earlier diagnostics and other jobs are also outside this run. The current failure path stores an error but discards accumulated usage; complete spend accounting needs that implementation gap addressed.

The completion rate is 73/75 (97.33%). It measures valid evaluation production, not agreement with reference grades. No accuracy or human-reference claims are derived from these cost records.

## How the aggregates were checked

The source database was opened read-only in a consistent SQLite transaction. The job's `evaluation_ids` were resolved individually and checked against its exact set of 75 requested conversation IDs and checklist version. All 73 completed rows had the same model, effort and prompt version and nonnegative integer usage counters; their original criterion results contained no `reusedFrom` reference. The two failures had no usage counters. Independent SQL aggregation was checked against the published JSON, and decimal arithmetic was used for all costs.
88 changes: 88 additions & 0 deletions docs/measurements/2026-11-08-eval-v17.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"measurementDate": "2026-11-08",
"source": {
"database": "local data/cqa.sqlite (not committed)",
"jobId": "job-775230bf-cc74-409b-b4fb-7048b3e66bea",
"startedAt": "2026-11-08T06:09:51.903Z",
"lastResultStoredAt": "2026-11-08T06:14:25.290Z",
"checklistVersionId": "checklist-original-v1",
"selection": "Exactly the evaluation_ids recorded by this job; no earlier successful fallback results"
},
"provenance": {
"provider": "anthropic",
"model": "claude-haiku-5-5",
"effort": "medium",
"promptVersion": "eval-v17",
"evaluatorVersion": "operator-v3"
},
"coverage": {
"attempted": 75,
"completed": 73,
"failed": 2,
"completedWithUsage": 73,
"failedWithUsage": 0,
"reusedCriterionResults": 0,
"inputChannels": {
"agent chat": 70,
"voice call": 5
},
"completedChannels": {
"agent chat": 68,
"voice call": 5
},
"inputLanguages": {
"EN": 17,
"KZ": 19,
"RU": 39
},
"datasetGroups": {
"DEV": 65,
"FBroker": 10
}
},
"tokens": {
"inputTokens": 659072,
"outputTokens": 285021,
"cacheReadTokens": 936434,
"cacheWriteTokens": 133433
},
"pricing": {
"currency": "USD",
"unit": "per million tokens",
"source": "https://platform.claude.com/docs/en/models/haiku-5-5/overview",
"checkedAt": "2026-11-08",
"promptTier": "up to 100000 tokens",
"rates": {
"inputTokens": "0.10",
"outputTokens": "0.50",
"cacheReadTokens": "0.01",
"cacheWriteTokens": "0.125"
},
"maximumCombinedInputTokensPerCompletedEvaluation": 47176
},
"recordedCostUsd": {
"byCategory": {
"inputTokens": "0.0659072",
"outputTokens": "0.1425105",
"cacheReadTokens": "0.00936434",
"cacheWriteTokens": "0.016679125"
},
"totalCompleted": "0.234461165",
"meanPerCompleted": "0.003211796780821917808219178082"
},
"latencyMsCompleted": {
"mean": 10500.164383561643,
"median": 8829,
"p95NearestRank": 27334,
"min": 4557,
"max": 40824
},
"secondsFromJobStartToLastStoredResult": 273.387,
"limits": [
"Cost is calculated from recorded successful-evaluation token usage, not a provider invoice.",
"Both failed evaluations lack persisted usage; their token spend is excluded.",
"Successful-evaluation usage includes returned responses from schema repair attempts; usage lost inside provider-level retries is not guaranteed to be represented.",
"This is one existing application job (not the provider Batch API), including rules and concurrent requests; timings are not a repeated benchmark.",
"No reference labels or accuracy claims are included."
]
}
Loading