Skip to main content
Send the dataset, model, sampling settings, and output destination, with an Idempotency-Key header. Returns a run that prepares a quote for frozen input rows. Confirm the quote before funds are reserved or inference starts.

Signature

Method signature on client.batchInference:

Parameters

string
required
Project ID with prefix pp..
string
required
A caller-generated key reused for retries of one logical request.
string
required
Source dataset ID with prefix ds..
object
Filter selecting rows to answer; omit to include all rows.
ModelVersionParent
required
The model to use: a catalog base model or a model version in this project containing a LoRA adapter or full weights. More model types may be added, so branch on type.
BatchInferenceMode
How each row is processed. Defaults to single_turn: one model call per row, with the answer written as text. More modes may be added, so branch on type.
object
required
Generation settings for every model call: maxOutputTokens caps each answer and bounds the quote, and samplesPerRow is how many answers each row gets.
{ type: "field"; fieldName: string } | { type: "dataset"; name: string }
required
Where completions land: a text field on the source dataset, or a new chat-sft dataset.

Returns

Promise<BatchInferenceRun> A batch inference run with its quote, progress, charge, and output location.
BatchInferenceRunId
required
ID of the batch inference run, with prefix bir..
ProjectId
required
Project ID with prefix pp..
DatasetId
required
Dataset ID with prefix ds..
BatchInferenceModel
required
The model to use: a catalog base model or a model version in this project containing a LoRA adapter or full weights. More model types may be added, so branch on type.
BatchInferenceMode
required
How each row is processed. Defaults to single_turn: one model call per row, with the answer written as text. More modes may be added, so branch on type.
object
required
Generation settings used for each model call.
object
required
Dataset and field where this run writes completions.
"preparing" | "awaiting_confirmation" | "queued" | "running" | "writing_outputs" | "stopping" | "blocked" | "completed" | "failed" | "canceled"
required
Run state from input preparation through confirmation, execution, and output writing; stopping is cancellation in progress, blocked requires action, and completed, failed, or canceled are terminal.
object | null
required
Latest generation progress while running or stopping; null in other states or when progress is unavailable.
"funds" | "payment" | "billing_review" | null
required
Reason the run is blocked: funds to reserve the budget, payment to settle usage, or billing_review for staff review; otherwise null.
string | null
required
Current status or billing explanation, or null when none is available.
object | null
required
Failure or cancellation details, or null when no error is recorded.
object | null
required
Price quote for confirmation, or null before a quote is ready.
string | null
required
Settled charge in US dollars as a decimal string, or null before a charge is recorded.
object | null
required
Output counts and token usage, or null before results are available.
string
required
Time the batch inference run was created, as an ISO 8601 timestamp.
string
required
Time the batch inference run was last updated, as an ISO 8601 timestamp.

Errors

HTTP errors throw PotatoApiError. The endpoint documents these error responses: HTTP endpoint: POST /projects/{projectId}/batch-inference-runs.