Options for running large, non-urgent workloads on Fireworks
For example, evals, synthetic data generation, or backfill workloads. We will no longer support an async Batch dataset upload interface. Instead, you keep your dataset locally and send each request to the inference API yourself, so your client has to:- Control how many requests run at once
- Retry requests that fail for lack of capacity, rate limits or a lost replica
- Save results and resume after an interruption
Preemptible deployments (50% off on-demand pricing)
Run your own deployment on spare capacity at a discount. This works with any model you can deploy on demand, including custom and fine-tuned models, and it suits bulk non-urgent jobs that can handle occasional interruptions. How it works. Passing--preemptible to firectl deployment create opts the deployment into borrowing capacity:
- The deployment runs on GPUs that are currently idle, tapping into a large fleet.
- When higher priority jobs need the GPUs back, your replica can be preempted at any time, including mid-request. There is currently no advance notice.
- Fireworks doesn’t guarantee how many GPUs are available at a given time or how long a replica stays up although historically they stay available for a few hours. A preempted replica is placed again automatically when GPUs free up, so you don’t need to create another deployment.
- Bulk and non-urgent work only. Treat a preempted replica as a normal outcome, not an error. We do not recommend sending production or latency-sensitive traffic to a preemptible deployment.
--preemptibleis immutable. It’s set at creation and can’t be turned on or off later. To change it, delete the deployment and create a new one.- Clean up when done. Delete the deployment when the job finishes, so you stop paying for it and release the borrowed capacity.
What you need
Set up the following before you run the script:Step 1: Create a preemptible deployment
Use the model ID of the model your Batch jobs ran on:- A Fireworks model:
accounts/fireworks/models/<MODEL> - Your own fine-tuned or uploaded model, including LoRA adapters:
accounts/<ACCOUNT_ID>/models/<MODEL_ID>. Point the deployment at your fine-tuned model ID, not the base model.
--deployment-shape default for a preemptible deployment. List the shapes your account can deploy the model on:
<MODEL_ID>: the full model ID from the list above.<DEPLOYMENT_ID>/<DISPLAY_NAME>: a name of your choice, for examplebatch-migration.<DEPLOYMENT_SHAPE>: a shape fromdeployment-shape-version match. See Deployment shapes.
--wait blocks until the deployment is ready (1 hour by default; change it with --wait-timeout). A create that would go over your preemptible quota fails with RESOURCE_EXHAUSTED and a message naming the quota.
Step 2: Check the deployment status
A deployment answers404 until it’s ready, and the script stops on that 404, so confirm the deployment is ready before you start.
- firectl
- Fireworks app
State: READY. The other states are CREATING, UPDATING, DELETING, DELETED and FAILED; see Deployment status states.State stays READY when a replica is preempted, and while it’s placed again. It isn’t marked FAILED or UPDATING. To see whether replicas are serving, check replicaStats instead:A field that’s
0 can be left out of the output.To see what happened to the deployment, including preempted replicas:Step 3: Run your Batch file
Point--model at your deployment with the <MODEL>#<DEPLOYMENT> form:
- Reads your existing Batch input file in the OpenAI batch format (
custom_idplusbody) - Writes successful rows to
--outputand failed rows to<output>.errors.jsonl, in the matching Batch output format - Retries
408,409,425,429,5xx(except501and505), timeouts and dropped connections, honoringRetry-After, for up to 30 minutes per row - Resumes where it stopped when you rerun the same command, sending every row without a result: failed rows and rows a stopped run never finished. Add
--skip-errorsto rerun without resending rows that already failed.
custom_id, not line order. See the script README for every flag, the output formats and the exit codes.
Tips
- Validate on a sample first. Run a few hundred rows and compare outputs with your Batch results before running the full file.
- Tune
--concurrency(default 16, up to 256). Start at about 8 to 16 per replica and raise it while latency stays acceptable. - Ride out preemption. If a replica is preempted mid-run, its in-flight requests fail with dropped connections or
503until it’s back, and the script retries them. The replica is placed again automatically when GPUs free up, and the deployment staysREADY, so you don’t need to recreate it. WatchreplicaStats(see Step 2) to see it come back. If that takes longer than 30 minutes, raise--max-retry-time, or rerun the same command later. - Know when it happens. Each preempted replica adds an event to the deployment’s activity log, in the app and in
firectl deployment events list(see Step 2). If preemption leaves the deployment with no ready replicas, the user who created it gets an email, and another when it can serve again.
Step 4: Delete the deployment
Delete the deployment when the job is done to stop billing and release the borrowed capacity:Errors
See Reliability and Error Handling for more patterns.
FAQ
Can I choose the region for a preemptible deployment?
Can I choose the region for a preemptible deployment?
Yes, you can choose a multi-region: There is less capacity if you specify a region other than
GLOBAL (the default), US, CANADA, EUROPE or APAC. Pass it with --region when you create the deployment:GLOBAL.