Skip to content

feat(timemachine): Model Time Machine — counterfactual replay of your real workload#270

Closed
gizmax wants to merge 6 commits into
gui-experimentfrom
feat/time-machine
Closed

feat(timemachine): Model Time Machine — counterfactual replay of your real workload#270
gizmax wants to merge 6 commits into
gui-experimentfrom
feat/time-machine

Conversation

@gizmax

@gizmax gizmax commented Jun 10, 2026

Copy link
Copy Markdown
Owner

"New model dropped? Replay last month's real workload against it and decide on data, not Twitter benchmarks."

  • engine/timemachine.py: selects completed runs/steps by workflow + date range, re-executes recorded prompts against a target model, scores old vs new output with an LLM judge, aggregates per-workflow and overall quality ± / cost ± / latency ±, extrapolates monthly savings → verdict: "Switching to X saves $Y/mo at ±Z% quality"
  • Dry-run by default (free, instant): token volumes from recorded text × pricing table → projected cost delta; live replay requires an explicit budget_usd with pre-flight estimate refusal and mid-run truncation at cap (judge cost counted too)
  • API (admin-gated): POST /api/timemachine (async job), GET /api/timemachine/{job_id}, GET /api/timemachine; reports persisted as JSON artifacts under data_dir/timemachine/
  • CLI: sandcastle timemachine --model nim/llama-3.1-70b --since 30d [--live --budget 5.0]
  • Dashboard: /time-machine page — model + range picker, verdict hero, summary cards, per-workflow table, report history; demo data in mock mode

Local models (NIM/Ollama/oMLX) replay at $0 — the direct sales pitch for on-box inference.

Tests: 27 new pytest (dry-run math vs hand-computed fixture, budget contract, live aggregation, API lifecycle) + 5 vitest; full dashboard suite 810/810; lint zero new; build green; ruff clean.

Stacked on #255 (gui-experiment).

Tomas Pflanzer and others added 6 commits June 10, 2026 14:23
…workload

Selects recorded run cassettes (completed runs with persisted prompts/outputs/
costs/latencies), prices them against any target model's pricing table (free
dry-run), or live-replays every LLM step on the target model with an LLM-judge
quality score - gated behind an explicit budget cap with pre-flight refusal.
Reports persist as JSON artifacts under {data_dir}/timemachine/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
POST /api/timemachine (202 + job_id; validates model, enforces budget_usd for
live replays and refuses when the pre-flight estimate exceeds it),
GET /api/timemachine/{job_id} (status + report), GET /api/timemachine (recent).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sandcastle timemachine --model nim/llama-3.1-70b --since 30d [--live --budget 5.0]
prints per-workflow cost/quality/latency deltas and the headline verdict.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…PI lifecycle

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…orkload

Route /time-machine + sidebar entry. Dry-run by default (free pricing-table
projection), live replay toggle with budget cap, polling job flow, headline
verdict, per-workflow quality/cost/latency delta table, confident empty state,
and mock-mode demo data so the page works offline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…orkload

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gizmax

gizmax commented Jun 11, 2026

Copy link
Copy Markdown
Owner Author

Shipped in v0.40.0 (release integration merged to main). Closing — superseded by the 0.40.0 release.

@gizmax gizmax closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant