Bring your own copy of the training data. The Training API reads your training file directly: a local JSONL file, a directory of
.jsonl shards, or a Google Cloud Storage path (gs://<BUCKET>/train.jsonl). It can’t read datasets stored in Fireworks (accounts/<ACCOUNT_ID>/datasets/<DATASET_ID>). Use the same file you uploaded for the managed job, and its evaluation file if it had one. The row format doesn’t change, except that the DPO and ORPO recipes don’t read tool definitions in a row’s input.tools. For data in Amazon S3 or Azure Blob Storage, copy it to a local file or to Cloud Storage first.Start a new job
Training recipes:
sft_loop.py and dpo_loop.py in the Fireworks cookbook. Each one runs the whole job from your data to a deployable model. For step-by-step guides, see Cookbook: SFT and Cookbook: DPO.[default] to let the agent choose it and show you its choice in the plan. To match a managed job’s settings, see “Which managed job settings carry over?” in the FAQ.
Run it with the Python API instead
Run it with the Python API instead
Set up once.Then build the recipe
- Create an API key in your account, in the dashboard or with
firectl api-key create. The Training API rejects keys that can reach more than one account. If you belong to several Fireworks accounts, use a service account key. - Install Python 3.11 or newer and uv.
Config and run it. These examples train a LoRA adapter on serverless training, which needs no provisioning and bills per token. Every setting is a field on the recipe’s Config.serverless=Trueworks only on the serverless models. For any other base model, remove it to train on a dedicated trainer; see “Should I use Serverless or Dedicated Training?” in the FAQ.- Always set
lora_rank. The recipe default of0means full-parameter training, which needs a dedicated trainer. tokenizer_modelis the Hugging Face repo of the base model, such asQwen/Qwen3-8B. A mismatch corrupts training.- For a
gs://dataset, also setdataset_loading_mode="stream", installgoogle-cloud-storage, and sign in withgcloud auth application-default login. - For Weights & Biases charts, pass
wandb=WandBConfig(entity="<WANDB_ENTITY>")(fromtraining.utils) and setWANDB_API_KEY.
- The training loop runs in your Python process for the whole job, not on Fireworks. If the process stops, training stops. For long runs, use a machine that stays on, such as a cloud VM, and keep the output in a log file:
nohup python train.py > train.log 2>&1 &. - Watch the loss in the log, in Weights & Biases, or on the training dashboard. For SFT the loss should fall over the first epoch. For DPO,
dpo_lossstarts near 0.69 and should fall whileaccuracyrises. - If a serverless run stops, rerun it with the same
log_pathandinit_from_checkpoint="<ACCOUNT_ID>/<RUN_ID>/<CHECKPOINT>". “My run stopped. How do I resume it?” in the FAQ shows where to find each value. - On a dedicated trainer, reattach with
trainer=TrainerConfig(job_id="<TRAINER_JOB_ID>")while the trainer is still running, or start a new trainer from the checkpoint. A dedicated trainer stops after 60 minutes without activity, and keeps billing until then if your process dies.
Deploy the new model
The run promotes its final checkpoint toaccounts/<ACCOUNT_ID>/models/<NEW_MODEL_ID>. Deploy it from Models in the Fireworks app, or run:
What keeps working
For managed SFT, DPO and ORPO jobs created before November 9, 2026:- Jobs that are queued or running finish normally.
- You can get, list, cancel and delete them in the dashboard, with
firectl, and through the API. - You can export DPO job metrics (
firectl dpo-job export-metrics) and promote the checkpoints of existing jobs. - You can’t resume a failed or cancelled job. Start a new job on the Training API instead.
- The models they produced stay in your account and deploy as before.
Reference for existing jobs
- Managed Training overview: view, stop, delete, and re-run existing jobs
- Supervised Fine-Tuning: dataset format and job settings
- Preference Optimization (DPO and ORPO): dataset format and monitoring
Troubleshooting
FAQ
Where do I find my job name and account ID?
Where do I find my job name and account ID?
To look up a managed job, use its full name, such as
accounts/<ACCOUNT_ID>/supervisedFineTuningJobs/<JOB_ID>.- Account ID: run
firectl whoami, which printsAccount ID: <ACCOUNT_ID>. - SFT job names: run
firectl sftj list. - DPO and ORPO job names: run
firectl dpoj list.
firectl sftj get <JOB_ID> or firectl dpoj get <JOB_ID>.How do I keep my API key safe with a coding agent?
How do I keep my API key safe with a coding agent?
Set the key in your shell, then start the agent from that same shell so it inherits the variable:
- Never paste the key into the agent chat. Chat messages can be logged and sent to the agent’s model provider.
- The agent prompt on this page tells the agent the key is already set, and not to ask for it or print it.
- If you pasted a key into a chat by mistake, delete it in the dashboard and create a new one.
Should I use Serverless or Dedicated Training?
Should I use Serverless or Dedicated Training?
Pick by what your managed job used:
Serverless models.
serverless=True works only on these base models. On any other model it fails with no eligible shared trainer found for base model:Train on a dedicated trainer instead. Remove serverless=True from the Config. The recipe then provisions a dedicated trainer on a validated training shape for the base model. Everything else in the examples stays the same:My managed job's base model isn't available. What should I train instead?
My managed job's base model isn't available. What should I train instead?
These base models have no Training API shape. Train a suggested replacement instead:
Models shows whether each replacement trains on Serverless Training, Dedicated Training, or both. A replacement is a different model, so evaluate it against your managed model before you move traffic.For any other base model with no Training API shape, including a base model you uploaded, contact your account team or support@fireworks.ai.
My run stopped. How do I resume it?
My run stopped. How do I resume it?
The training loop runs on your machine. If the laptop sleeps, the terminal closes or the connection drops, the run stops.Prevent itResume
-
For runs longer than a few minutes, use a machine that stays on, such as a cloud VM. Run under
tmux, or withnohupand a log file, so the output survives a closed terminal: -
Save checkpoints regularly: set
dcp_save_interval=20, andcheckpoint_interval_minutes=30for LoRA SFT and DPO. Without them, a stopped run has nothing to resume from.
dataloader.json inside the run’s log_path. The checkpoint names are its keys, newest last:- Serverless: find the run ID in the log line
Serverless training session <SESSION_ID>, run <RUN_ID>(for example,grep "Serverless training session" train.log). Rerun with the samelog_pathandinit_from_checkpoint="<ACCOUNT_ID>/<RUN_ID>/<CHECKPOINT>". - Dedicated, trainer still running: find the trainer job ID in the log (
Created trainer job: <TRAINER_JOB_ID>). Rerun with the samelog_pathandtrainer=TrainerConfig(job_id="<TRAINER_JOB_ID>")(fromtraining.utils). The trainer stops after 60 minutes without activity. - Dedicated, trainer gone: rerun with the same
log_pathandinit_from_checkpoint="<TRAINER_JOB_ID>:<CHECKPOINT>". This starts a new trainer from that checkpoint’s weights, and the dataset starts again from its first row.
What happens to my evaluation settings?
What happens to my evaluation settings?
- Evaluation dataset. Pass your own copy:
evaluation_dataseton the recipeConfig. The run reports evaluation loss on it. - Automatic carve-out.
eval_auto_carveout=Trueholds out part of the training data for evaluation: by default 10% of the rows, at most 20 examples. Change the size witheval_carve_ratioandmax_eval_seqs. - ORPO has no held-out evaluation in the cookbook, so its evaluation settings are ignored.
accounts/<ACCOUNT_ID>/models/<NEW_MODEL_ID>. Evaluate that model on your own prompts before you move traffic, and compare it with your managed model. Evaluating Trained Models covers sampling serverless checkpoints, loading a promoted LoRA onto serverless, and preemptible deployments.Which managed job settings carry over?
Which managed job settings carry over?
Managed jobs saved a resumable checkpoint every 20 steps, and LoRA SFT and DPO jobs also saved one every 30 minutes. To keep that, set
dcp_save_interval=20, and checkpoint_interval_minutes=30 for LoRA SFT and DPO.Which managed job settings have no equivalent?
Which managed job settings have no equivalent?
- A token-based
batch_sizefrom older jobs. Recipes batch by rows; usebatch_size_samples→batch_size. lora_target_modules,lora_dropoutandtune_vision_encoder.- Datasets in Amazon S3 or Azure Blob Storage. Copy the data to a local file or to Cloud Storage first.
- Region, accelerator and training shape. You don’t set these; the recipe picks a validated training shape.