Skip to content

[codex] Add Modal B200 submission rate limit#482

Draft
msaroufim wants to merge 2 commits intomainfrom
codex/modal-b200-rate-limit
Draft

[codex] Add Modal B200 submission rate limit#482
msaroufim wants to merge 2 commits intomainfrom
codex/modal-b200-rate-limit

Conversation

@msaroufim
Copy link
Copy Markdown
Member

@msaroufim msaroufim commented Apr 21, 2026

What changed

Add a Modal B200 submission cap of 1 per hour and enforce it before submissions are created or queued.

Why

The existing rate-limit system is keyed by leaderboard and mode category. It does not model GPU-specific limits, so it could not express a Modal B200 cap.

Impact

Modal B200 submissions are now rejected once a user has already submitted to that GPU within the last hour. The check applies to both immediate submissions and queued async API submissions.

A migration adds requested_gpus to leaderboard.submission so the limiter can make that decision before any run rows exist.

Validation

  • uv run pytest tests/test_submission.py -q
  • uv run python -m compileall src/libkernelbot src/kernelbot/api

Notes

I added DB-backed tests for the new GPU rate-limit path, but I could not run them locally because Docker was not running for the Postgres test container.

@msaroufim msaroufim changed the title add modal b200 submission rate limit [codex] Add Modal B200 submission rate limit Apr 21, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/libkernelbot
  backend.py
  consts.py
  leaderboard_db.py 290
  submission.py 52, 54, 69
  utils.py
Project Total  

This report was generated by python-coverage-comment-action

@msaroufim msaroufim marked this pull request as draft April 21, 2026 07:37
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