Skip to main content
Process large volumes of requests asynchronously at 50% off Serverless per-token prices. Batch API is ideal for:
  • Data labeling and synthetic data generation
  • Training smaller models with larger ones (distillation guide)
  • Large-scale evaluations and benchmarking
  • Document processing and more
Batch jobs automatically use prompt caching for additional 50% cost savings on cached tokens. Maximize cache hits by placing static content first in your prompts.

Model compatibility

Not all models support the Batch API. Before submitting a batch job, verify your target model is batch-compatible.
  • Base Models – Any model that supports On-Demand Deployments in the Model Library
  • Custom Models – Your uploaded or fine-tuned models built on a batch-compatible base model
Note: Newly added models may have a delay before being supported. See Quantization for precision info.
If a model does not support batch inference, submitting a job may not produce an immediate error — the job can remain in a pending state and never schedule. Always verify compatibility before submitting.
If your batch job is not running:
  1. If validation failed, check your JSONL input — each line must be a complete, valid JSON object matching the request schema.
  2. Batch jobs wait to be scheduled in a “pending” state during the selected time window, so it may not run immediately.
  3. If the job has been “creating” a deployment for more than 30 minutes, contact support with your job ID.
    1. Confirm the model supports batch inference (see above).
    2. Check that your account has sufficient quota for batch jobs.
  4. Progress may pause while waiting on capacity. The job will resume automatically.

Getting Started

Datasets must be in JSONL format (one JSON object per line):Requirements:
  • File format: JSONL (each line is a valid JSON object)
  • Size limit: Under 1GB
  • Required fields: custom_id (unique) and body (request parameters)
Example dataset:
{"custom_id": "request-1", "body": {"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"}], "max_tokens": 100}}
{"custom_id": "request-2", "body": {"messages": [{"role": "user", "content": "Explain quantum computing"}], "temperature": 0.7}}
{"custom_id": "request-3", "body": {"messages": [{"role": "user", "content": "Tell me a joke"}]}}
Save as batch_input_data.jsonl locally.
You can simply navigate to the dataset tab, click Create Dataset and follow the wizard.Dataset Upload
Navigate to the Batch Inference tab and click “Create Batch Inference Job”. Choose your batch-eligible model from the dropdown selector:BIJ Model SelectorSelect your dataset:BIJ Dataset SelectorConfigure optional settings:BIJ Optional Settings Selector
View all your batch inference jobs in the dashboard:BIJ List
Navigate to the output dataset and download the results:BIJ Download Output
The output dataset contains two files: a results file (successful responses in JSONL format) and an error file (failed requests with debugging info).

Reference

Batch jobs progress through several states:
StateDescription
VALIDATINGDataset is being validated for format requirements
PENDINGJob is queued and waiting for resources
RUNNINGActively processing requests
COMPLETEDAll requests successfully processed
FAILEDUnrecoverable error occurred (check status message)
EXPIREDExceeded chosen time limit (12, 24, 48, 72 hrs). Completed requests are saved.
  • Base Models – Any model that supports On-Demand Deployments in the Model Library
  • Custom Models – Your uploaded or fine-tuned models built on a batch-compatible base model
Note: Newly added models may have a delay before being supported. See Quantization for precision info.
  • Per-request limits: Same as Chat Completion API limits
  • Input dataset: Max 1GB
  • Output dataset: Max 8GB (job may expire early if limit is reached)
  • Job expiration: Select from 12, 24, 48, 72 hours maximum in Optional Settings
Jobs expire after 24 hours. Completed rows are billed and saved to the output dataset.Resume processing:
firectl batch-inference-job create \
  --continue-from original-job-id \
  --model accounts/fireworks/models/llama-v3p1-8b-instruct \
  --output-dataset-id new-output-dataset
This processes only unfinished/failed requests from the original job.Download complete lineage:
firectl dataset download output-dataset-id --download-lineage
Downloads all datasets in the continuation chain.
  • Validate thoroughly: Check dataset format before uploading
  • Descriptive IDs: Use meaningful custom_id values for tracking
  • Optimize tokens: Set reasonable max_tokens limits
  • Monitor progress: Track long-running jobs regularly
  • Cache optimization: Place static content first in prompts

Next Steps

Prompt Caching

Maximize cost savings with automatic prompt caching

Fine-Tuning

Create custom models for your batch workloads

API Reference

Full API documentation for Batch API