CI integration

Working with lots of models? Gate your pipeline on a scan verdict. Every scan resolves to pass warn or fail; models we've already scanned resolve instantly.

Gate on warn. The bar for fail is deliberately high — damaging behavior confirmed on that exact checkpoint by the deep battery — so most models never fail. warn is where the real-world signal lives: template/tokenizer drift, pickle-only weights, remote-code requirements. What the verdicts mean →

1. Get an API key

Sign in with your email, then create a key from the dashboard. Keys look like ingot_… and are shown once.

2a. GitHub Actions

- name: Ingot model scan
  uses: Ember-Sovereignty/ingot/ci@main
  with:
    model: owner/model
    api-key: ${{ secrets.INGOT_API_KEY }}
    fail-on: warn        # recommended; 'fail' only blocks confirmed-damaged checkpoints

2b. The CLI

@ingotai/scan is a zero-dependency npm CLI (source in cli/ of the repo). Same verdict gate, plus free reads of the public database.

# one-off or in any script — exits 1 when the gate hits
export INGOT_API_KEY=ingot_…
npx @ingotai/scan scan owner/model --fail-on warn

# read the public database (no key needed)
npx @ingotai/scan report Qwen/Qwen3.8-27B

2c. Any CI (curl)

# 1. queue a scan
SCAN=$(curl -s -X POST "$INGOT_URL/api/v1/scans" \
  -H "Authorization: Bearer $INGOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "owner/model"}')
ID=$(echo "$SCAN" | jq -r .id)

# 2. poll until complete
while true; do
  S=$(curl -s "$INGOT_URL/api/v1/scans/$ID" \
    -H "Authorization: Bearer $INGOT_API_KEY")
  STATUS=$(echo "$S" | jq -r .status)
  [ "$STATUS" = "complete" ] || [ "$STATUS" = "failed" ] && break
  sleep 30
done

# 3. gate on the verdict (recommended: block warn and fail)
VERDICT=$(echo "$S" | jq -r .verdict)
echo "ingot verdict: $VERDICT"
[ "$VERDICT" = "pass" ] && exit 0 || exit 1

API

EndpointWhat it does
POST /api/v1/scansQueue a scan. Body: {"model": "owner/name"}. Returns the scan record with an id.
GET /api/v1/scans/:idPoll status. status: queued → running → complete; verdict: pass | warn | fail.
GET /api/v1/models/:owner/:namePublic, no auth — the published analysis for a model (the free database read).
GET /api/v1/models/:owner/:name/badge.svgPublic verdict badge for READMEs — always shows the latest published analysis.
GET /api/v1/patch/:owner/:namePublic — the patch manifest for the model's metadata-level findings, applied locally by ingot patch.
GET /api/v1/guard/:owner/:namePublic — the scan-derived runtime guard config where deep-battery data exists.

Full CLI and fixing documentation: the docs page.