← Use cases · Download & Install · Agent setup guide

Document & contract extraction pipelines

Use case #1 · every command below was run as shown on a CPU-only production server (32-vCPU arm, 4B model) — timings are from those runs.

structured JSON outself-verifying33 s/doc measured4B on CPU

Contracts, policies, surveys, resumes — turned into typed, verified JSON that downstream systems can consume, without a page leaving your network.

Why run it locally: Documents are the clearest case for private inference: contracts and HR files often legally cannot transit a third-party API. This is also the use case with the strongest published enterprise evidence, and the one where small models are near-frontier: single-shot extraction with a verify step.

Model & hardware fit: 4B–9B models, CPU is enough. Add the vision models for scanned documents.

Setup (once, ~10 minutes)

1. The server — any install works; one line on Linux:

curl -fsSL https://inference-server.searchblox.com/install | sudo bash

2. The agent — pi, a minimal open-source coding agent (four tools: read, write, edit, bash), needs Node 22+:

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

3. Connect them — create ~/.pi/agent/extensions/searchai.ts:

import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";

export default function (pi: ExtensionAPI) {
  pi.registerProvider("searchai", {
    baseUrl: "http://127.0.0.1:8081/v1",
    apiKey: "$SEARCHAI_API_KEY",
    api: "openai-completions",
    models: [{ id: "q35-4b", name: "SearchAI q35-4b", reasoning: false,
      input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
      contextWindow: 32768, maxTokens: 4096 }]
  });
}
export SEARCHAI_API_KEY='your-api-key'   # printed by the installer

Full setup detail (and four more worked tasks) in the pi agents article. The server works with pi stock — no compatibility flags.

The walkthrough

With a contract in the working directory:

pi --provider searchai --model q35-4b -p \
  "Read agreement1.txt and extract the parties, effective date, term length, \
   monthly fee, termination notice period, governing law, and contact email \
   into a JSON file named agreement1.json with sensible snake_case keys. \
   Then verify it parses with python3 -m json.tool."

Measured result, verbatim — every field correct, the date normalized to ISO, numbers typed as numbers, and the agent verified its own output with a tool call (33 seconds on a CPU-only server):

{
    "parties": { "provider": "Acme Logistics LLC",
                 "client": "Bluewater Foods Inc" },
    "effective_date": "2026-03-15",
    "term_length_months": 24,
    "monthly_fee_usd": 4750.0,
    "termination_notice_period_days": 60,
    "governing_law": "State of Delaware",
    "contact_email": "sarah.chen@bluewaterfoods.example"
}

Scale it to a folder — one JSONL line per document (43 s for three contracts):

pi --provider searchai --model q35-4b -p \
  "Extract the same fields from EVERY .txt file in this directory into one \
   summary.jsonl file — one JSON object per line with a source_file key. \
   Verify each line parses."

Honest notes

In the batch run the agent once dropped a requested secondary key (source_file) — the honest shape of 4B-class agents: near-perfect on the extraction itself, occasionally lossy on side instructions. Keep the verify step in the prompt and a human checkpoint before anything irreversible.

Measured: 33 s per contract · 43 s for a 3-doc batch.

Next: all the use cases · give the agent memory across sessions · 3–4× the speed with one GPU flag