Docs / CLI
CLI quickstart
No account, no GPU, nothing run. scan reads your repository and launch files; the other commands read a model's published files from Hugging Face (or a graph file you have). Each answers before a change takes a card or traffic.
Node 18 or newer. The current release is neurarch 0.5.7; npx neurarch@0.5.7 pins it. The gate output was captured with 0.5.0 and the scan and template-check outputs with 0.4.0, all on 2026-11-25; the rest with 0.2.0 on 2026-10-18. They are cut, never reworded. What it sends over the network: trust page.
- One decision: gate
- The admission record: ledger export
- What is live: ledger live
- What a benchmark measured: ledger outcome
- What your code pulls: scan
- A second reader for weights: --modelaudit
- Upstream changes since your pin: watch
- The prompt your engine sends: template-check
- What a job needs
- Does the data fit
- Parallel layout
- Serving launch
- Read an OOM
- Past jobs
- Exit codes
- New in 0.3.0
One decision before a change goes live: gate
$ npx neurarch gate . --gpu l4 --gpus 8 --record gate.json
neurarch gate REFUSE 1 file, 1 model, 1 launch
1 · The exact weights and code 0 high, 1 medium, 1 low
Qwen/Qwen2.5-7B-Instruct (not pinned) demo/serve.sh:1
medium Not pinned to a commit: every run loads whatever Qwen/Qwen2.5-7B-Instruct has on main that day.
2 · A model that fits the GPU 1 of 1 launch checked, 2 blockers, 1 warning
demo/serve.sh 8 x l4, vLLM 0.32.0 (assumed: the file states none)
vllm serve Qwen/Qwen2.5-7B-Instruct --tensor-parallel-size 8 --max-model-len 131072
block TP 8 does not divide 28 attention heads
warn TP 8 is past 4 KV heads: each KV head is replicated 2x
block Served length 131072 is past the model's 32768-token context
3 · A prompt that renders the same 1 model rendered, 0 differ
Qwen/Qwen2.5-7B-Instruct same (reference against vllm)
REFUSE: 2 launch blockers. Exit 1. Record: demo-gate.json
Each part is the command it names; run scan, serve-check or template-check for the full detail.
It runs the three commands below over the repository, as the commands you would run: scan on every model the code and manifests pull, serve-check on every launch line it finds (on the card you name, or the card a SkyPilot task asks for), and template-check on every model a launch serves. Then it adds them up:
| Verdict | When | Exit |
|---|---|---|
| refuse | a high scan finding, or a launch that will not start | 1 |
| review | nothing blocks, and there is something to read; or something could not be read | 0, or 1 with --strict |
| admit | nothing above low, and everything was read | 0 |
Engines and launchers
| Engine | Model read by scan | Launch checked by serve-check | Prompt checked by template-check |
|---|---|---|---|
vLLM (vllm serve, python -m vllm.entrypoints.openai.api_server) | yes | yes | yes |
vLLM offline, in Python (LLM(model=..., tensor_parallel_size=...), vllm.LLM(...), EngineArgs(...), AsyncEngineArgs(...)) | yes, including an id held in a variable the file assigns | yes, as the vllm serve line with the same arguments | yes |
SGLang (python -m sglang.launch_server, sglang serve) | yes | yes | yes |
TensorRT-LLM (trtllm-serve <model>, with --hf_revision / --revision) | yes | no | no |
NVIDIA NIM (nvcr.io/nim/... images, NIM_MODEL_PATH or NIM_MODEL_NAME set to hf://<org>/<repo>) | yes, for an hf:// source | no | no |
Ollama (ollama run|pull hf.co/<org>/<repo>[:<quant>], a Modelfile FROM hf.co/...) | yes | no | no |
llama.cpp (llama-server) | no | by hand: serve-check --cmd "llama-server ..."; the gate does not run it | no |
TGI (text-generation-launcher, archived) | yes, through MODEL_ID | no | no |
The gate lists every launch on an engine it does not check under Not checked, and each one counts as a check that could not be read, so the verdict is review at best. The model such a launch serves is still scanned: its pin, the changes upstream since, and, where it is pinned, the chat template at the pin against main. Ollama's hf.co reference and NIM's hf:// source have no place for a commit; the scan says so and gives the way to hold one revision (download that commit and serve the local copy).
A launch is read with its environment: assignments in front of it (VLLM_USE_V1=0 vllm serve ..., env CUDA_VISIBLE_DEVICES=0,1 python -m sglang.launch_server ...), export lines before it in a script, ENV in a Dockerfile, and os.environ[...] before an offline LLM(...). Each engine variable gets one of three answers, listed in the record under the launch's environment:
| Answer | Variables |
|---|---|
| modelled | CUDA_VISIBLE_DEVICES is the GPU count the engine sees. VLLM_ALLOW_LONG_MAX_MODEL_LEN and SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN make a served length past the derived maximum a warning instead of a refusal. |
| no effect | VLLM_USE_V1=0 on vLLM 0.11.0 or later, which removed the V0 engine. VLLM_CPU_KVCACHE_SPACE on a GPU, since vLLM reads it on a CPU host only. |
| not checked | VLLM_USE_V1=0 before 0.11.0, or with no version stated: the V0 engine, whose KV cache the check does not model, so no KV capacity is predicted and only a memory refusal is kept. VLLM_CPU_KVCACHE_SPACE on a CPU host, where it silently replaces --kv-cache-memory-bytes (vLLM #67033). VLLM_ATTENTION_BACKEND, VLLM_USE_MODELSCOPE, HF_ENDPOINT, llama.cpp's LLAMA_ARG_*, and any other VLLM_*, SGLANG_* or SGL_* setting the check does not read. |
A variable that is not checked is listed under Not checked with what it changes, and the launch counts as a check that could not be read, so the verdict is review at best. Logging, ports, caches and tokens (VLLM_LOGGING_LEVEL, VLLM_PORT, HF_TOKEN, NCCL_*) change nothing the check predicts and are not listed. In an offline LLM(...), an argument that is not a literal in the file (max_num_seqs=cfg.seqs, **kwargs) is listed the same way, and the launch is checked on the arguments that are.
A model the Hub did not answer for is never admitted. --record gate.json writes what was checked (schema): each model with its commit, each launch with its card and the engine release its defaults came from, each prompt comparison, and what was not checked and why. --ledger file.jsonl appends one line per run; --ledger https://your-verifier posts it to a self-hosted verifier, where it is read next to the cluster's admission decisions (line format). --ledger https://www.neurarch.com/api/v1/gate writes the same line to your hosted admission record instead, with NEURARCH_API_KEY set to a key from the account menu, API keys.
Where you stand: after the verdict, and status
$ npx neurarch status .
Where you stand 3 models, 1 pinned to a commit record: neurarch.com/changes/ (daily since 2026-10-18)
Alibaba-NLP/gte-base-en-v1.5 not pinned b.py:2
1 recorded change in the last 30 days, which an unpinned load picks up: 2026-11-21 remote code
https://www.neurarch.com/changes-feeds/models/Alibaba-NLP/gte-base-en-v1.5.html
unsloth/gpt-oss-20b-BF16 @ cc89b3e7fd42 (main has moved) b.py:3
1 recorded change since the pin (2025-08-05): 2026-10-05 chat template + tokenizer
https://www.neurarch.com/changes-feeds/models/unsloth/gpt-oss-20b-BF16.html
Qwen/Qwen2.5-7B-Instruct not pinned b.py:4
no recorded change in the last 30 days (latest 2024-09-19); the daily record starts 2026-10-18
After its verdict the gate prints, for every model the files reference (with the file and line), whether it is pinned to a commit and what the public daily change record at /changes/ holds for it: the chat template, the weights, the config, the tokenizer, the licence or gating, a repository that was removed or changed owner, each with its date and a link to the model's page in the record. A pinned model is read after the pinned commit; a model that is not pinned is read over the last 30 days, since every load of it takes main. What changed is listed first, and six models are shown; --json lists every one.
A model the record does not hold, a pin it cannot place, or a record that could not be read (offline, rate-limited) is printed as not checked with the reason, never as no change. Every "no recorded change" line says that the daily record starts on 2026-10-18; earlier rows come from each model's Hub git history. The summary is read after the verdict is fixed and never changes the verdict or the exit code. --json and --record carry it under standing (schema); the ledger line does not. --no-summary leaves it out, and neurarch status [paths] prints it alone, exit 0. The record is fetched whole: no model id is in the request, and the lookup happens on your machine. The output above was captured from the repository build on 2026-11-29, before release, on an illustrative three-line file.
Letting a change through anyway: --override
$ npx neurarch gate . --ledger https://www.neurarch.com/api/v1/gate --override "hotfix for INC-42, approved by the on-call lead"
When the verdict is refuse or review, --override "<reason>" makes the command exit 0. The verdict, the gate's own exit code and its reasons stay what they were in the record and in the ledger line; the override is added next to them as override: { by, reason, at }, and the text output says OVERRIDDEN by <who>: <reason>. The reason is required, 1 to 300 characters; a missing or longer one exits 2 before any check runs. by is GITHUB_ACTOR, else GITLAB_USER_LOGIN, else git config user.email, else $USER, recorded as given. In CI, set NEURARCH_OVERRIDE to the reason instead of editing the command. On an admit there is nothing to override and none is recorded.
The record and the ledger line also name the change they ran on (subject). In GitHub Actions the repository, commit, ref, actor and run URL come from GITHUB_REPOSITORY, GITHUB_SHA, GITHUB_HEAD_REF or GITHUB_REF_NAME, GITHUB_ACTOR and the run id; in GitLab CI from CI_PROJECT_PATH, CI_COMMIT_SHA, CI_COMMIT_REF_NAME, GITLAB_USER_LOGIN and CI_JOB_URL; elsewhere the commit and branch come from git. --repo, --commit (a full 40-character sha), --ref, --by and --run-url set them by hand and win over what CI reports.
The admission record as files: ledger export
$ NEURARCH_API_KEY=nrk_... npx neurarch ledger export --since 2026-11-01 --until 2026-11-30 --out november.csv
$ npx neurarch ledger export --from ledger.jsonl --format json
$ NEURARCH_API_KEY=nrk_... npx neurarch ledger export --audit-pack audit-2026-11/
Reads the hosted admission record (GET https://www.neurarch.com/api/v1/ledger with NEURARCH_API_KEY), a self-hosted verifier's with --url https://verifier.internal (NEURARCH_SELFHOST_TOKEN is sent when set), or a local file gate --ledger appended to with --from, which sends nothing. --since and --until are UTC days, both inclusive, both optional. --format csv (the default) or json; --out writes a file instead of stdout. The CSV has one line per record, read from the row as written:
received_at,kind,verdict,override_by,override_reason,repo,commit,ref,by,run_url,models,launches,because
--audit-pack DIR writes records.json (every record in the range, as stored), records.csv, and a README.md that states the range, counts the records by kind and the gate runs by verdict, and lists every override with who, when and why: the record of each release decision with who, when and what was checked. The same CSV and JSON are a download in the account menu, API keys, under Admission record.
What is live: ledger live
$ NEURARCH_API_KEY=nrk_... npx neurarch ledger live
$ npx neurarch ledger live --from ledger.jsonl --json
One line per repository and model id: the newest gate run that let the model through, which is an admit, or a refuse or review someone let through with --override. Each line has the commit the model was pinned or resolved to, the engine and card a launch named for it, the verdict, the override with who and why, who ran the gate, when, and the CI run. A refusal nobody overrode did not go live, so it never replaces the line before it; it is printed under that line. Rows with no repository recorded group under (no repository recorded). The header counts the models live, and the overrides and refusals in the last 30 days.
It reads the same sources as ledger export: the hosted record with NEURARCH_API_KEY (GET /api/v1/ledger?view=live), a self-hosted verifier with --url, or a local file with --from, which sends nothing. --json prints the view as JSON. The same table is the "What is live" tab under Admission record in the account menu, API keys and record.
What a benchmark measured: ledger outcome
$ guidellm run --backend kind=openai_http,target=http://localhost:8000 ... \
--collector kind=vllm_server_info,url=http://localhost:8000/server_info \
--collector kind=prometheus,url=http://localhost:8000/metrics --outputs json
$ npx neurarch ledger outcome --guidellm benchmarks.json --ledger ledger.jsonl --gpu h100
Reads a GuideLLM JSON report (report schema version 2) and appends one outcome line to the admission record (line format): the launch the server said it was running and what GuideLLM measured against it. The launch comes from GuideLLM's vllm_server_info collector, which stores vLLM's own resolved configuration in the report: model, revision, tensor and pipeline parallel size, max-model-len, and the KV cache blocks vLLM allocated. The measurement is GuideLLM's: requests that succeeded, errored or did not finish, requests and output tokens per second, time to first token and inter-token latency percentiles for each run, and, when a prometheus collector scraped the server, vLLM's preemptions and its largest KV cache usage. Nothing is recomputed.
The line is joined to the prediction for exactly that launch: an admission decision or a gate --ledger run that named the same model, the same 40-character commit, vLLM, and the same tp, pp and max-model-len. A near match is not a match. With no such prediction, or more than one, the line is still written, and the command and GET /v1/ledger (summary.benchmarks) say it is unjoined and why. When several launches match, --workload namespace/name names the admitted workload and --file the launch file of a gate run. A server that loaded no revision, or a branch, is never joined: which bytes ran cannot be told. Without the vllm_server_info collector the launch is only a model name, and is never joined either.
The summary counts what the check got wrong as loudly as what it got right: a launch predicted to start whose benchmark saw errored requests, and a launch predicted not to fit that ran with none. GuideLLM does not say why a request errored; a server out of memory and a client timeout both count, and the output says so. KV blocks are compared with the prediction only when --gpu states the card (the report does not name one) and it matches the card the prediction was made for. --engine-version states the vLLM release, which the configuration does not carry either.
--ledger appends to a local file and joins against the lines already in it; --url https://verifier.internal posts to a self-hosted verifier's POST /v1/outcome, which joins against its own record (NEURARCH_SELFHOST_TOKEN is sent when set); --url https://www.neurarch.com/api/v1/outcome writes to the hosted record with NEURARCH_API_KEY. With neither, the line is printed and nothing is written. A report of another schema version, or one whose server configurations name more than one launch, is refused and nothing is written. Exit 0 when written, joined or not; 1 when the report was refused or the line could not be written; 2 on a usage error. Since 0.5.6.
The exact weights and code: scan
$ npx neurarch scan .
neurarch scan 1 file read, 1 model reference, 0 high, 1 medium
Qwen/Qwen2.5-7B-Instruct (not pinned)
demo/train.py:2
low behavior 4 recorded upstream changes to Qwen/Qwen2.5-7B-Instruct; the latest, 2024-09-19: Qwen2.5-7B-Instruct: the chat template changed and renders differently (tool-call, tool-call-parts); prompts rendered with the old one no longer match what the model now expects, so cached prompts and eval sets need re-rendering (2024-09-19).
https://www.neurarch.com/changes/
medium hygiene Not pinned to a commit: every run loads whatever Qwen/Qwen2.5-7B-Instruct has on main that day.
fix: revision="a09a35458c702b33eeacc393d103063234e8bc28"
security = code that runs on load or weights that can execute; behavior = what the model receives changed, not a vulnerability.
It finds every Hugging Face model your .py, .ipynb, YAML, shell scripts, Dockerfiles and Ollama Modelfiles download (from_pretrained, vllm serve, vLLM's offline LLM(...), trtllm-serve, ollama run hf.co/..., NIM_MODEL_PATH=hf://..., hf download, base_model:, serving env vars in manifests), pinned or not, and reports in three lanes kept apart:
Serving manifests are read in the fields their tools use, each pinned the way that tool takes a pin:
| Manifest | Model | Pinned by |
|---|---|---|
KServe InferenceService | storageUri: hf://owner/name, or the Hugging Face runtime's --model_id | hf://owner/name:<commit>, --model_revision |
KServe LLMInferenceService | spec.model.uri, LoRA adapters[].uri | hf://owner/name:<commit> |
llm-d ModelService and the modelservice chart | modelArtifacts.uri: hf://owner/name | --revision <commit> in the container args (the URI takes none) |
AIBrix ModelAdapter, ModelClaim | artifactURL: huggingface://owner/name | nothing: the field takes no revision, and the scan says so |
NVIDIA NIM operator NIMCache, NIMService | spec.source.hf (namespace, modelName); spec.source.ngc.modelPuller; spec.image | spec.source.hf.revision; an @sha256: digest on the puller; the NIMService image cannot take one (the operator writes repository:tag) |
| KitOps ModelKit, ModelPack, KServe modelcar | kit://..., oci://..., a model.csi.modelpack.org volume's modelRef | an @sha256: digest; a tag is not a pin |
For an adapter, the scan also reads use_rslora and use_dora from its adapter_config.json. vLLM applies rsLoRA's lora_alpha / sqrt(r) scaling from 0.7.0 (#6909) and before that serves the adapter scaled by lora_alpha / r with no error; SGLang scales every adapter by lora_alpha / r; neither engine loads a DoRA adapter. --vllm-version and --sglang-version give the engine release for files that launch an engine and state none; the gate passes its own.
| Lane | What it reports |
|---|---|
| security | Python the loader runs from the repository (auto_map) that is unpinned, changed since your pin, or lives in another repository revision= does not pin; weights only in pickle formats. |
| behavior | Recorded upstream changes since your pin (template, tokenizer, EOS, generation defaults) from /changes, and whether the chat template now renders a different prompt. |
| hygiene | Downloads not pinned to a commit, with the commit to pin. |
| Flag | Does |
|---|---|
--fix | Pins what it can edit safely (revision=, code_revision=) in .py files and shell launch lines; lists the rest. Review with git diff. |
--bom out.cdx.json | A CycloneDX 1.6 BOM: one component per model at its commit, each finding as a vulnerability entry. See the properties. |
--json, --no-template | Machine-readable output; skip rendering templates. |
--modelaudit | Also run ModelAudit over the model files on this machine, when it is installed. See below. |
Exit 1 when any finding is high. Only public model ids leave your machine; set HF_TOKEN for gated repositories.
A second reader for weights: --modelaudit
$ pip install modelaudit
$ npx neurarch gate . --modelaudit
The security lane reads the Hub's file list; it never opens a weight file. ModelAudit (MIT) does: it reads pickle opcodes, archives, Jinja2 chat templates and about forty other formats without loading them. With --modelaudit, scan and gate run it as a child process, when modelaudit is on PATH, over files already on this machine:
- weights, archives and chat templates under the scanned paths;
- for each Hub model pinned to a commit, that commit's snapshot in the local Hugging Face cache (
HF_HUB_CACHE, elseHF_HOME/hub, else~/.cache/huggingface/hub). Nothing is downloaded.
| ModelAudit says | The gate records |
|---|---|
| a critical issue | a high security finding, "source": "modelaudit": refuse |
| a warning | a medium security finding, "source": "modelaudit": review |
| info, debug | nothing |
| a coverage limit (an analysis it could not finish, a pickle it could not rule out inside tensor bytes) | a line under Not checked: review at best |
| a pinned model whose files are not in the cache, a model with no pin | a line under Not checked, with the hf download that fixes it |
not installed, no report, past --modelaudit-timeout (default 600 s) | not run under Not checked, never a pass |
The scan's own findings stay. A ModelAudit finding on a cached file sits under that model; one on a file in the repository sits under modelaudit in the record (schema), which also says whether it ran and which version. Nothing leaves the machine on its behalf: the child never sees OPENAI_API_KEY or any other OPENAI_* variable (ModelAudit's optional AI triage sends findings and document text to OpenAI when that key is set), it is passed --no-triage, and its telemetry is off (PROMPTFOO_DISABLE_TELEMETRY=1). defaults: { modelaudit: true } in .neurarch.yml turns it on for every run; --no-modelaudit turns it off for one. Since 0.5.6.
Upstream changes since your pin: watch
$ npx neurarch watch . --github-issue
neurarch watch 1 file read, 2 models (1 pinned), 3 upstream events
record: https://www.neurarch.com/changes/index.json (daily since 2026-10-18; earlier rows from Hub git history)
BAAI/bge-small-en-v1.5 (not pinned)
not pinned at serve.py:6: watch needs a pin to compare against (npx neurarch pin-check prints the revision to add)
Qwen/Qwen2.5-7B-Instruct @ 52e20a6f5f47
pinned at serve.py:4, serve.py:5; events after 2024-09-18
2026-07-29 retirement Together AI retired it from fine-tuning on 2026-07-29; the host suggests Qwen/Qwen3.5-9B. Your own copy is unaffected; this matters if you fine-tune or serve it there.
https://docs.together.ai/docs/deprecations
2025-01-12 new-commit main is at a09a35458c70, committed 2025-01-12; you pin 52e20a6f5f47. Run neurarch gate at a09a35458c70 before moving the pin.
https://huggingface.co/Qwen/Qwen2.5-7B-Instruct/commits/main
2024-09-19 chat-template Qwen2.5-7B-Instruct: the chat template changed and renders differently (tool-call, tool-call-parts); prompts rendered with the old one no longer match what the model now expects, so cached prompts and eval sets need re-rendering (2024-09-19).
https://huggingface.co/Qwen/Qwen2.5-7B-Instruct/commit/acbd96531cda22292a3ceaa67e984955d3965282
It finds the models your code pulls with the same reader as scan, and for each one pinned to a commit lists what the change record at /changes holds for it after that commit's date: a chat template that renders a different prompt (chat-template), weight file hashes that moved (weights), config, tokenizer and generation default keys (structural, tokenizer, generation-defaults), a head the daily record saw that is no longer on main (erased-commit), a licence or gating change (licence), a change to the Python the loader runs (remote-code), an owner change or a repository that stopped answering (repository), a host retirement date (retirement), and a newer commit on main (new-commit). A format-only re-save, a metadata key and a template edit that renders the same prompt are not listed. Each event carries its date, what changed, the record's link and the files that pin the model. A reference with no pin gets one line saying there is nothing to compare against.
The daily record starts on 2026-10-18. Earlier rows come from each model's Hub git history where the Hub still has it, so a commit erased before then is not in the record.
| Flag | Does |
|---|---|
--github-issue | Opens or updates one issue per model with events, titled Upstream change: <model> (<kinds>), with the events newest first, the pinned files and the next step (run gate at the new commit before moving the pin). Needs GITHUB_TOKEN and GITHUB_REPOSITORY, both set inside GitHub Actions; without them it prints what it would post. A rerun finds the issue by the marker <!-- neurarch-watch:<model> --> in its body and updates it. Nothing is closed automatically, and a closed issue is not reopened: new events after it get a new issue. |
--since YYYY-MM-DD | Counts events after that date instead of after the pinned commit, and lists them for unpinned references too. |
--fail-on kinds | Exit 1 when an event of one of these kinds is found, for example --fail-on chat-template,weights,erased-commit. |
--json | Machine-readable output. |
Exit 0 after a completed comparison, whatever it found: it is an alert, not a gate. Exit 1 when the change record could not be read (nothing was compared), when the GitHub API refused a write, or on --fail-on; 2 on a usage error. As a daily workflow (examples/github-watch.yml in the npm package):
name: neurarch watch
on:
schedule:
- cron: '17 6 * * *'
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
watch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
- name: Upstream changes since the pins
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HF_TOKEN: ${{ secrets.HF_TOKEN }} # for gated repositories
run: npx -y neurarch@latest watch . --github-issue
A prompt that renders the same: template-check
$ npx neurarch template-check Qwen/Qwen3-8B
same prompt: reference (string content) vs vllm (string content), rendered with @huggingface/jinja@0.5.10
same system+user
same multi-turn
same tool-call
Same on these conversations; not a proof the templates agree on every input.
Renders the model's chat template the way transformers usually calls it and the way vLLM does, on a system and user turn, a multi-turn chat and a tool call, and says where the prompts differ. --from <rev> --to <rev> renders two revisions of the same model instead, which is what moves under a deployment when the template changes upstream. Exit 1 when any prompt differs. It compares rendered text on these conversations; it is not a proof for every input.
What a training job needs
$ npx neurarch Qwen/Qwen3-8B --batch 8
Qwen/Qwen3-8B qwen3 · text-generation
published (safetensors.total) 8.19B 8,190,735,360
derived (config.json alone) 8.19B 8,190,878,080
difference +0.00% within 2%: the reconstruction matches the checkpoint
...
training memory (no price without --data)
fits T4 no A100_40 no H100_80 no (training peak ~259.1 GB at batch 8, 2048 tokens, 1.15x headroom)
upper bound 370.5 GB (the estimate x 1.43: held out by architecture, 95% of 91 measured runs peaked at or under it)
The first lines compare the parameter count derived from the config with the count the checkpoint stores, so you can see whether the reading is worth trusting before you read the rest. Useful flags:
| Flag | Does |
|---|---|
--batch N --seq-len N | The training peak at that batch and sequence length (default 2048 tokens, or the context if shorter). |
--data 3M --gpu a100-80gb | What one run costs, for a training set of that size, on that card. No --data, no price. |
--lora r=16,targets=q_proj,v_proj | Size a LoRA run instead of a full fine-tune. |
--inference --batch 4 --seq-len 4096 --gen 512 | Weights plus KV cache for a generation job, and which cards hold it. |
--json, --layers | Machine-readable output; every layer instead of the first 12. |
Every number is derived from the config, not measured; the memory model's measured runs are public at /memory-calibration.
Does your data fit what the config accepts
$ npx neurarch bert-base-uncased --seq-len 1024 --tokenizer-size 30524
data fit checked: sequence length, tokenizer size
block Sequences of 1024 tokens are longer than the 512-row position table
fix: Truncate or chunk to 512 tokens, or pick a model whose context covers 1024.
block The tokenizer has 30524 ids and the embedding has 30522 rows
fix: Call model.resize_token_embeddings(len(tokenizer)) before training, and budget for the new rows.
Also --classes N (labels against the head) and --image-size N --channels N (against the first layer). These are the jobs that crash on the first batch, after the reservation; this exits 1 before it.
Is this parallel split legal and balanced
$ npx neurarch layout Qwen/Qwen3-8B --tp 4 --pp 4 --dp 8 --global-batch 512 --seq-len 4096
Balance: slowest stage 3 at 1.24x the mean stage's predicted time.
Rebalanced split 10,10,10,6: 1.02x, predicted 20.0% faster per step at 64 microbatches (2579 ms); 21.2% as microbatches grow.
...
checked: tp-heads, tp-kv-heads, tp-hidden, tp-ffn, tp-node, cp-seq, batch-arithmetic, pp-over-blocks, stage-balance, pipeline-bubble, stage-memory
Legality (TP against heads, KV heads, hidden and FFN sizes; PP against blocks; the batch arithmetic) is exact. Stage times are predicted, and the output says so. A local graph file works too (npx neurarch layout ./graph.json ...) and makes no network request. npx neurarch layout --help lists every flag.
Will this serving launch start: serve-check
Put the launch command after --, exactly as you would run it. vLLM, SGLang and llama.cpp are read.
Quantization against the card, for vLLM, each finding with the source it was read from:
| Launch | Card | Finding |
|---|---|---|
FP8 weights (a checkpoint's quant_method, or --quantization fp8) | below sm89 (A100, A10G, A40, T4) | warn: runs as weight-only W8A16 through the FP8 Marlin kernel, so the memory saving is there and the FP8 speedup is not. Below the method's minimum capability in vLLM's registry: block. |
--kv-cache-dtype fp8 (vLLM 0.24.0 and later) | below sm80 (T4, V100) | block: only the Triton backend is left, and it refuses an fp8 KV cache below sm89. |
--kv-cache-dtype fp8 | sm80 to sm88 (A100, A10G, A40) | info: it runs through FlashInfer; FlashAttention takes an fp8 KV cache only on sm90 and sm100. |
--quantization against the checkpoint's quant_method (awq, gptq, fp8, compressed-tensors, bitsandbytes, ...) | any | block when vLLM would refuse the pair at load, for example gptq_marlin on an AWQ checkpoint or fp8 on a compressed-tensors one. |
$ npx neurarch serve-check Qwen/Qwen3-8B --gpu l4 --gpus 4 -- vllm serve Qwen/Qwen3-8B -tp 4 --max-model-len 32768
Qwen/Qwen3-8B on vLLM
TP 4 x PP 1 x DP 1, 4 x l4 (sm89), dtype bf16, weights unquantized, KV cache auto
served length 32768 (--max-model-len 32768); the model's derived maximum 40960
memory per GPU budget 21.6 GB, weights 4.10 GB, KV room 17.50 GB
...
info The template has a thinking block and no --reasoning-parser is set
fix: Add --reasoning-parser qwen3.
Why a job ran out of memory
$ npx neurarch oom error.txt --model FacebookAI/xlm-roberta-large --batch 1 --seq-len 128
cause too-big-for-card
The job is bigger than this card: the predicted peak is 10.8 GB (12.5 GB with headroom) on a 4.29 GB card.
error.txt is the text PyTorch printed with torch.OutOfMemoryError; pipe it in with python train.py 2>&1 | npx neurarch oom - --model .... Fixes come least invasive first.
Requested against needed, over past jobs
$ npx neurarch rightsize jobs.csv
One row per job: the model, what it requested, batch and hours. The package ships a sample at examples/jobs.sample.csv; npx neurarch rightsize --help documents the columns. On that sample it prints "6 jobs, 174 GPU-hours, $507.85 spent; $328.53 of that was reserved capacity no job needed", with a row per job naming the smallest card that holds it. That figure is capacity reserved and not needed, not money saved.
Exit codes and scripting
Exit 1 when the model cannot be read or a check blocks, 0 otherwise, so it composes in CI and shell scripts. Set HF_TOKEN to read a gated repo; it is sent to huggingface.co only.
New in 0.3.0
On npm since 2026-10-18: npx neurarch has them, and npx neurarch@0.3.0 pins the release.
neurarch pin-check [paths]: Hugging Face downloads not pinned to a commit, following Bandit's B615, with--sariffor code scanning..neurarch.ymlpolicy: severities, budget lines, waivers with an owner and an expiry, a baseline, SARIF output.--attestand--cyclonedx: a deterministic, signable pre-check record. See trust; theneurarch:*properties--cyclonedxwrites are listed at CycloneDX properties.
Next: put the same check where jobs are submitted, in the admission hooks.