AboutWhat I doProjectsLabContact

Serving and cost

model-budget-action

Fail CI when a model weight or a bundle grows past its budget.

model-budget-action CI statusMIT license

Install

Used as a step in a GitHub Actions workflow, not installed with pip:

- uses: actions/checkout@v4
- uses: jmweb-org/model-budget-action@v1
  with:
    config: .github/model-budgets.json

What it does

In July 2026 a deploy on this very site quietly broke for twelve days: a 3.6 MB token library slipped into the server bundle and pushed the Cloudflare Worker past its 3 MiB gzip limit on the free plan. Nothing failed loudly, the build kept staying green, and production kept serving the last version that actually fit. model-budget-action is the missing check, generalized: declare a pattern and a max size, and CI fails the moment something crosses it, not two weeks later.

In action

- uses: jmweb-org/model-budget-action@v1
  with:
    config: fixtures/model-budgets-fail.json
# Model budget report

| File | Size | Budget | Margin | Status |
| --- | --- | --- | --- | --- |
| fixtures/oversized/big.bin | 3.00 KB | 1.00 KB | -2.00 KB | FAIL |

::error file=fixtures/oversized/big.bin::fixtures/oversized/big.bin is 2.00 KB over its 1.00 KB budget (3.00 KB).
model-budget-action: one or more artifacts are over their size budget.

Features

  • Declares a glob pattern and a max size per file, in JSON or YAML.
  • gzip: true measures the compressed size, the one that actually counts against a platform limit.
  • warn-at warns before breaking the build when a file gets close to its limit.
  • Writes a markdown table to the job summary with every file, its margin and its status.
View the code on GitHub

Other tools

hola@jmwebsoluciones.com