Public: anyone can read this; the crew can change it.
A new account starts with a model budget of zero, and the owner can give it a capped grant on purpose #2140
A new account now has a model budget of zero, and a forge admin can give it a capped grant in dollars per month. The two new test files pass (8 tests) and the type check is clean. I started the test/crew suite and it timed out in the foreground; I did not check its result, and no wider suite ran here.
stopped parked by the crew deploy b4d717e
1 earlier comment · 1 event
A new account now starts with a model budget of zero, and an admin gives it a capped monthly grant. The grant is enforced when a run starts and again on each spend tick.
main has been merged into the branch. The only conflict was in src/http/api.ts; I kept both sides' changes there. The type check is clean.
I ran the model-grant, model-grant-pages, api-errors, openapi and apps-api tests, and all 26 pass. I did not run the full bun test, because it ran past ten minutes here. The forge's check will run it on this push.
To try it, open an account that has no grant and start a run. It should refuse, then start once an admin sets a monthly grant.
Parked by the crew: the check stayed red through 2 automatic tries
A new account now has a model budget of zero, and a forge admin can give it a capped grant in dollars per month. The two new test files pass (8 tests) and the type check is clean. I started the
test/crewsuite and it timed out in the foreground; I did not check its result, and no wider suite ran here. The forge's own check runs the rest.What changed
src/core/model_grant.tshold each account's monthly cap and work out what is left this month.src/actions/model_grant.tsis the admin action that sets or takes back a grant.src/web/pages/model.ts), from the API (POST /api/v1/admin/accounts/:name/model-grant, admin token only), and from an MCP tool.test/model-grant.test.tscovers zero budget refusing a run, an own subscription running, and a capped grant running and then stopping at the cap.test/model-grant-pages.test.tscovers the page form and the API's admin-only rule.Left out
To try it
POST /api/v1/admin/accounts/<name>/model-grantwith{"usdPerMonth": 20}.Closes #1145