Add cost tracking, API-key spending limits and dashboard (0.13.0) - #83
Merged
Merged
Conversation
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.
Adds USD compute accounting by job, worker, submitting API key and user. A worker’s startup/idle overhead is retained separately and allocated equally among its distinct jobs by default; retries do not add overhead shares. Ledger history survives operational record deletion.
Adds lifetime API-key budgets with database admission checks and manager cancellation, plus a paginated Costs dashboard, limit editor, SDK and REST APIs. Limits use accrued estimates and may overshoot during concurrent execution and shutdown. Unknown historical prices remain explicitly unpriced. Only authenticated organization admin users can change limits.
Validation: 67 unit/API/PostgreSQL tests pass, frontend production build passes, wheel/sdist build passes. Docker source overlays retain the validated v0.12.1 dependencies and pass
pip check. The additive migration has been applied to production after backup verification; authenticated production cost-report smoke test passed against 73k runs and 103k worker records.Release: 0.13.0. Apply
20260922000000_cost_tracking.sqlbefore upgrading other installations. Seedocs/cost-tracking.mdfor attribution, accounting, budget semantics and rollout details. Adds CI for the regression/database tests and frontend build, and excludes installed frontend dependencies from package builds.