Repository navigation
feat(pi): compare LightGBM and Jev token forecasts - #1320
Draft
sabhatinas wants to merge 5 commits into
Draft
sabhatinas wants to merge 5 commits into
sabhatinas wants to merge 5 commits into
Conversation
Signed-off-by: sabhatinas <sabhatinas@nvidia.com>
sabhatinas
marked this pull request as draft
November 13, 2026 22:42
Signed-off-by: sabhatinas <sabhatinas@nvidia.com>
Signed-off-by: sabhatinas <sabhatinas@nvidia.com>
Signed-off-by: sabhatinas <sabhatinas@nvidia.com>
Signed-off-by: sabhatinas <sabhatinas@nvidia.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
switchyard/compare, a fixed-completion-model Pi demo that runs a local grouped-IR LightGBM forecaster and Jev against the same pre-call history. The example uses Opus 4.8. Two rows show remaining cost, projected total cost, ETA, token forecasts, and signed token errors; LightGBM also shows next-call predictions.Both remaining predictions and their error targets include all input, cache reads/writes, and output, counting reasoning once. Jev uses the probability-weighted band-midpoint point estimate. The launcher passes through
medium,high, ormaxand keeps their Pi settings and sessions separate.Each prediction saves typed cost-to-go accounting: observed spending, remaining and projected total costs, the frozen initial estimate (
C0), first-priced fallback, forecast revisions, and forecasting API fees separately. At normal completion, remaining cost/tokens and ETA become zero; the final dollar error compares actual acting-model cost with the original baseline. Prediction records remain unchanged for scoring and restore on resume.Why
Makes the two forecasting approaches comparable during one task execution, with shared token accounting and cost/ETA projections. Tracks changes to the total-cost forecast without summing or double-counting remaining forecasts. Replaces machine-specific paths with configuration and packages the worker and setup instructions for sharing.
Notes for reviewers
grclark/turn-metrics; this PR contains only the comparison additions.switchyard-compare.tsandcost-forecast.ts.C0 erris actual minus the frozen initial total, whereas tokenavg erruses predicted minus actual. Missing first-call cost calibration leavesC0unknown; a later baseline is explicitly reported asfirst err.Validation: TypeScript typecheck; 48 Node tests requiring no private checkpoint or API calls; 3 Python tests against the real checkpoint; successful packaged Node-to-Python prediction; local comparison integration with checkpoint 20260721; offline checks that Opus 4.8 sends the selected adaptive effort; launcher syntax and staged whitespace checks. Tests cover frozen baselines, cold starts, unknown prices, cache accounting, forecast revisions, completion, resume, and aborts.