Skip to content

Show Modal credit left so runs can be budgeted - #17

Merged
tuandang304 merged 1 commit into
mainfrom
modal-credit
Oct 14, 2026
Merged

tuandang304 merged 1 commit into
mainfrom
modal-credit

Conversation

@tuandang304

Copy link
Copy Markdown
Owner

Requested by Tuna · project thread

Before: Modal in Compute showed only this month's spend. orx compute prices had no Modal balance or runway, so an agent could not tell whether a run would outlast the workspace's credit.

After: the Modal settings card has a "Credit left (USD)" field and shows "Available to spend ≈ $X". orx compute prices (and --json, which agents read) reports a Modal USD balance and hours of runway per GPU. orx compute configure modal --credit-usd 30 / --clear credit set it from the CLI.

Modal's API reports spend but not the credit left, so the user copies it once from the Modal dashboard, the same way the Google Cloud credit works.

How: ModalSettings (~/.openresearch/modal.json) stores the credit and when it was entered. The launcher's billing subcommand takes that timestamp and sums Workspace.billing.report(start=…, resolution="h"), so spend comes from Modal itself. If the report cannot be read, it falls back to orx's own Modal runs at list price and shows why. Also fixes orx compute configure gcp --credit-usd / --billing-export-table, which the CLI rejected as unknown settings, and clears the prices cache when a credit is saved.

🤖 Generated with Claude Code

https://claude.ai/code/session_011myrc9HRRr9A7ENDiTNR4i


Generated by Claude Code

Modal reports spend but not the credit left, so the user enters it once
(settings card or `orx compute configure modal --credit-usd`) and orx
subtracts Modal's billing report since then, falling back to an estimate
from orx's Modal runs. compute prices now carries a Modal balance and
per-GPU runway. Also lets `configure gcp` take --credit-usd and
--billing-export-table, which the CLI rejected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011myrc9HRRr9A7ENDiTNR4i
@tuandang304
tuandang304 marked this pull request as ready for review October 14, 2026 13:47
@tuandang304
tuandang304 merged commit 6d3761d into main Oct 14, 2026
16 checks passed
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.

2 participants