Batch Inference

Hand the manager a file of requests and come back later. It runs them against the models already serving, at the vendors' own paths, so an existing batch client needs a base URL and nothing else.

Why This Is Not Just A Loop

You could write the loop yourself, and for a hundred requests you should. The reason this exists starts at the scale where the loop's failure modes become certain rather than unlikely: a run of a million requests takes days, and over days a box restarts, a disk fills, a model gets swapped, and one malformed request finds a way to kill a runner.

So the batch is store-and-forward rather than a proxy. Your connection ends when the batch is accepted; the manager then makes the calls itself, as an ordinary API client:

  • The input is streamed to disk and read back one item at a time, so a million-line file never has to fit in memory.
  • Results are appended and group-committed, and every result is written exactly once, including across a manager crash. A resumed run does not duplicate what it already did.
  • A batch is bound to a model, not a port. If the service is down or restarting, the batch waits for it instead of failing.
  • A request that keeps killing its runner is isolated and failed on its own, rather than crash-looping the whole run.
  • A full disk pauses the batch instead of failing it, so you can make room and let it carry on.

Live Requests Come First

A batch running flat out does not take the machine away from interactive use. Live requests are scheduled ahead of batch work: on a DGX Spark with a batch at full tilt, an agent session's time to first token went from about 33 seconds to 0.4-0.6 seconds, and its prompt cache started hitting again. Batch throughput was unchanged.

Every call the manager originates carries x-paddock-origin: batch, so usage accounting and the capacity forecaster can tell batch traffic from the real thing.

The OpenAI Dialect

Three steps: upload a JSONL of requests, start a batch over it, poll until it is done, then fetch the output file.

# 1. the requests, one JSON object per line
cat > reqs.jsonl <<'EOF'
{"custom_id":"a1","method":"POST","url":"/v1/chat/completions","body":{"model":"qwen3.8-27b","messages":[{"role":"user","content":"Summarise: ..."}]}}
{"custom_id":"a2","method":"POST","url":"/v1/chat/completions","body":{"model":"qwen3.8-27b","messages":[{"role":"user","content":"Summarise: ..."}]}}
EOF

curl -X POST localhost:11500/v1/files -F purpose=batch -F file=@reqs.jsonl
# {"id":"file_...", ...}

# 2. start it
curl -X POST localhost:11500/v1/batches -H 'Content-Type: application/json' \
  -d '{"input_file_id":"file_...","endpoint":"/v1/chat/completions","completion_window":"24h"}'

# 3. poll, then read the output
curl localhost:11500/v1/batches/batch_...
curl localhost:11500/v1/files/{output_file_id}/content > out.jsonl

custom_id is how you match a result back to its request; results are not guaranteed to come back in order. POST /v1/batches/{id}/cancel stops a run, keeping what it has already written.

Big Inputs Resume

A multi-gigabyte JSONL over one HTTP request is a bet on your connection. OpenAI's resumable Uploads API is served for exactly this, so a dropped upload continues instead of restarting:

POST /v1/uploads                   start
POST /v1/uploads/{id}/complete   finish, giving a file id
POST /v1/uploads/{id}/cancel     abandon

The Anthropic Dialect

The same job store, the other shape: requests go inline in the create call rather than as an uploaded file, and results come back as JSONL from their own endpoint.

curl -X POST localhost:11500/v1/messages/batches \
  -H 'Content-Type: application/json' \
  -d '{"requests":[
        {"custom_id":"a1","params":{"model":"qwen3.8-27b","max_tokens":1024,
          "messages":[{"role":"user","content":"Summarise: ..."}]}}
      ]}'

curl localhost:11500/v1/messages/batches/{id}
curl localhost:11500/v1/messages/batches/{id}/results > out.jsonl
curl -X POST localhost:11500/v1/messages/batches/{id}/cancel

Where To Point A Client

Batch lives on the manager, not a model server. These are the only /v1 paths the manager serves, and they are at the vendors' own addresses deliberately: an official SDK needs its base URL changed to the manager and nothing more. Chat itself still belongs to a model server on its own port; see Manager API.

Limits

LimitValue
Requests in one batch1,000,000
One line of the input file192 MB

A line that fails validation is reported against its custom_id rather than failing the batch, so one bad row out of a million does not cost you the run.