Skip to content
Adrian edited this page Oct 16, 2026 · 2 revisions

distribatch

Batch model inference over DataFrames: LLM generation, text embeddings and speech transcription, on Databricks or anywhere Python runs.

import distribatch as dib

out = dib.GenerateJob(
    model=dib.models.databricks("databricks-meta-llama-3-3-70b-instruct"),
    prompt="Summarize in one sentence:\n{body}",
).run(spark_df, backend="spark", output_col="summary")

One job definition runs unchanged on three backends (sequential local, single-node multiprocessing, cluster-wide spark) with models from three sources (Unity Catalog, a directory or UC Volume with Hugging Face weights, any OpenAI-compatible API). Every row gets its result, an error column and metrics. A failing row never fails the job.

Where to start

I want to… Read
install it Installation
see it work in five minutes Quickstart
understand jobs, engines and backends Concepts
generate text or structured data GenerateJob
compute embeddings EmbedJob
transcribe audio TranscribeJob
pick where it runs and tune it Running Jobs, Backends
use UC models, Volumes, endpoints Model Sources, Engines
understand the output columns and errors Output Contract
run for hours and resume after failures Checkpoints and Dedupe
know success rates, tokens and costs Statistics and Costs
set it up on Databricks Databricks Guide
fix a problem Troubleshooting
look up a class or function API Reference

distribatch is pre-1.0: the API may still change between minor versions. See the changelog in the repository.

Clone this wiki locally