Docs / PR bot

The PR bot and GitHub Action

Every pull request that touches a model gets the plan as a comment: what changed against the base, the training peak against the card the job reserves, and whether it runs. A blocker fails the check.

Working setup to copy: neurarch-ai/model-ci-example, where the plan ran on pull request #11 on 2026-10-18 and the weekly report on 2026-10-12. More on the bot page. What it sends: trust page.

Two ways to install

GitHub App, one clickgithub.com/apps/neurarch-bot. Nothing to commit. Or a workflow stepuses: neurarch-ai/neurarch-bot@v0, running in your own CI.

The App reads the changed model files statically and says so in every comment. The Action traces the model for real in your runner (a CPU build of torch is enough), so its graph is the one PyTorch builds.

The workflow

name: Neurarch
on: pull_request
permissions:
  contents: read
  pull-requests: write   # to post the plan as a comment
jobs:
  plan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0     # the bot traces the base commit to diff against it
      - uses: neurarch-ai/neurarch-bot@v0

Which models: .neurarch.yml

List each model as file.py:ClassOrFactory (constructed with no arguments) and an input shape, batch first, :long for token ids. The optional job: block is what the memory line is sized at; each value can point into your own training config, so the plan sizes the run that will actually be submitted.

models:
  - path: models/doc_lm.py:DocLM
    input: "1,32:long"
    job:
      gpu: configs/pretrain.yaml:gpu
      batch: configs/pretrain.yaml:batch_size
      seq_len: configs/pretrain.yaml:seq_len
policy:
  forbid_types: [softmax]   # your own house rules; they can only make a verdict stricter

No config yet? Run the Action once with mode: init from the Actions tab: it traces every model it can construct and opens a pull request adding the file. It does nothing if one exists.

Inputs worth knowing

InputDefaultDoes
modeprreport upserts one weekly issue over every model; init writes the config; train answers a /neurarch train comment with a real GPU run (needs a key, spends the key owner's money, refuses anyone without write access).
api-keynoneOptional for the plan. Keyless calls are rate limited per hour and per IP.
fail-on-warnfalseFail the check on warnings, not only blockers.
fixfalseTry to fix a blocker in a scratch worktree, re-trace and re-plan, and open a pull request into the head branch only if the new plan is legal.
comment-on-cleanfalseComment even when the traced structure is unchanged and clean.

Outputs (legal, blockers, warnings, plans-json) let a later step gate on the result. The full list is in action.yml.

What leaves the repository

The Action sends the traced graph to POST /api/v1/plan to build the comment. Source files go to /api/v1/fix only with fix: true and a key. The App stores one allowlisted row per webhook delivery for 90 days and never stores comments, titles, diffs or source. Details on the trust page.