Skip to content

Batch inference

Batch inference processes a file of requests with a catalogue model on the GPUs you select, and returns a file of results. Use it for work that does not need an answer in real time: classifying an archive, summarising a backlog, generating training data.

A batch dataset is a JSONL file where each line is one request:

{"id": "row-1", "prompt": "Classify the sentiment of: 'Great service, fast delivery.'", "max_tokens": 8}
{"id": "row-2", "prompt": "Classify the sentiment of: 'Still waiting after two weeks.'", "max_tokens": 8}

id is used to match results to inputs; max_tokens limits the length of each answer. Upload the file under AI Studio → Datasets as a batch dataset, or register a file that is already on your virtual machine. The limits and the two options are on Datasets, fine-tuning and trained models.

  1. Open AI Studio → Batch inference and select the virtual machine to run on.
  2. Select New batch job: select a catalogue model, a batch dataset, and the GPUs the job should use.
  3. Submit. The job downloads the model if the virtual machine does not have it yet, runs every request, and uploads the output.

The job runs offline on your virtual machine. It does not use an endpoint, needs no API key, and does not count against any deployment. Its status and stage are shown in the job list.

When the job completes, the output appears under Outputs. Select Download output to download a JSONL file with one line per input row, in the same order, each carrying the row’s id and the model’s answer.

Outputs are kept for 30 days from creation and then deleted. Download any outputs you need to retain.

  • A job holds the GPUs you selected until the virtual machine confirms they are released.
  • A batch job can run next to a deployment, on the GPUs the deployment is not using, and next to a fine-tuning job on yet other GPUs.
  • A GPU is never shared between two jobs or between a job and a deployment.

An input file you upload is checked by Chapek’s API and stored in Chapek’s object storage in the EU, then pulled onto your virtual machine when the job starts; a file you register on your virtual machine is never read by Chapek. The job itself runs entirely on your virtual machine, and only its progress is reported while it runs. The output file is uploaded from your virtual machine to the same object storage for you to download. See Data residency.