> For the complete documentation index, see [llms.txt](https://docs.valohai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valohai.com/serving-your-models/deploy-batch.md).

# Batch Inference

Batch inference in Valohai runs as a standard execution, letting you process datasets or file collections at scale without managing infrastructure.

### How it works

Batch inference uses the same execution system you use for training:

1. Define a step in `valohai.yaml` with your inference code
2. Specify inputs (model files and data to process)
3. Run the execution via CLI, API, or schedule it
4. Collect results from outputs

**Key advantage:** You already know this system. If you've run training jobs, you can run inference jobs.

### What you can do

* Process thousands of images, CSVs, or other file types
* Schedule recurring inference jobs (e.g., nightly predictions)
* Trigger inference via API when new data arrives
* Chain inference into pipelines after training completes
* Track inference metrics alongside training metrics

### Example use cases

**Image classification at scale** Process a directory of product images to tag inventory items.

**Batch predictions on tabular data** Run monthly churn predictions on your entire customer database.

**Document processing** Extract entities from legal documents or medical records in batches.

### When to use batch inference

Choose batch inference when:

* You're processing datasets, not individual requests
* Latency requirements are in minutes or hours, not milliseconds
* You want to leverage Valohai's execution tracking and versioning
* You need to schedule or automate inference runs

**Need lower latency?** Check out [Real-Time Endpoints](https://github.com/valohai/dokuhai/tree/main/real-time/concepts.md) for sub-second predictions.

### Next steps

See practical examples:

* [CSV Inference Example](https://github.com/valohai/dokuhai/tree/main/docs/csv-inference.md)
* [Image Inference Example](https://github.com/valohai/dokuhai/tree/main/docs/image-inference.md)

Or jump straight to defining your inference step in `valohai.yaml`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.valohai.com/serving-your-models/deploy-batch.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
