FireworksEngine (DeploymentSampler), and policy updates use FireworksPolicyTrainer with WeightSyncer for hot-loading weights into the inference deployment.
Overview
Fireworks backend features:- Managed infrastructure: Trainer jobs and inference deployments are provisioned and torn down automatically at startup/shutdown
- Async-first design: Native async/await support inherited from the tinker backend path
- Unified architecture: Same
AgentTrainerAPI for agent and workflow training - Server-side losses: Builtin GRPO, DAPO, CISPO, and GSPO kernels on Firetitan
- Weight hot-loading:
WeightSyncersyncs trainer weights to the rollout deployment after each step
Python version: Requires Python >= 3.11 (same as tinker; Fireworks training SDK depends on tinker types).
API key: Set
FIREWORKS_API_KEY in your environment before training. The trainer job and inference deployment are created on Fireworks at startup and deleted on shutdown.Installation
Install rLLM with the Fireworks backend:Dependencies
The Fireworks backend includes (frompyproject.toml):
training.provision.init_fireworks_infra and the RL loss utilities used by FireworksPolicyTrainer.
Models and training shapes
Fireworks RL training uses two kinds of IDs from the shared public catalog under thefireworks account:
A base model is the model you fine-tune (for example
accounts/fireworks/models/qwen3-4b). A training shape is a pre-configured GPU and runtime profile — you pass the full path (for example accounts/fireworks/trainingShapes/qwen3-4b-minimum-lora) and the SDK resolves the pinned version, image tag, GPU layout, and linked deployment shape for you. See the Fireworks training shapes documentation for the searchable catalog, per-model RFT support matrix, and shape roles.
For rLLM you only need to pick a compatible model + training shape pair from that catalog. You do not need to specify versioned shape refs, image tags, or GPU counts manually — the shape owns that infrastructure.
Shape roles (RFT / RL)
During reinforcement fine-tuning (RFT), Fireworks deploys separate trainer and inference resources. The catalog lists shapes by role:
The rollout inference deployment is provisioned automatically from the shape linked to your policy trainer; you do not pick a deployment shape separately unless you reattach via
fireworks_infra.deployments.rollout.deployment_id.
Picking a model for RL
In the training shapes catalog, select a model and check the RFT LoRA or RFT Full-Param row in the training method support matrix. Only models marked supported there can be used with the Fireworks backend for RL. Examples of models with RFT LoRA support (see the live catalog for GPU totals and context limits):
Wire a chosen pair into Hydra overrides:
Basic Usage
Workflow Training
Train a countdown workflow on Fireworks using the unified trainer. Seeexamples/countdown/unified_trainer/ for the full example:
train_countdown_unified_fireworks.py
Agent Training
Use the sameAgentTrainer API with an AgentFlow and Evaluator (see the math cookbook):
Architecture
Fireworks backend extendsTinkerBackend and overrides only what differs:
FireworksEngine, FireworksPolicyTrainer, DCP checkpointing, weight sync, and model promotion.
Configuration
The Fireworks backend usesfireworks.yaml (selected when rllm/backend=fireworks):
Model Configuration
string
Fireworks model ID (accounts path)
string
default:"Qwen/Qwen3-4B-Instruct-2507"
HuggingFace tokenizer model for chat template rendering
integer
default:"32"
LoRA rank. Set to
0 for full-parameter training (requires reference trainer for KL)boolean
default:"false"
Train LoRA on output embedding layer
boolean
default:"true"
Train LoRA on attention layers
boolean
default:"true"
Train LoRA on MLP layers
Training Configuration
integer
required
Number of rollouts per prompt (for GRPO)
float
default:"1e-5"
Learning rate for Adam optimizer
string
default:"constant"
LR schedule:
"constant", "linear", or "cosine"float
default:"0.0"
Warmup steps as a ratio of total steps (0 to 1)
integer
default:"null"
Maximum sequence length. Auto-derived from the training shape when null
integer
default:"3600"
Timeout for forward / forward_backward / optim_step calls (seconds)
string
default:"null"
Source trainer job ID for loading a DCP checkpoint from another job
string
default:"null"
Explicit DCP checkpoint name to load; null uses the latest on the source/current job
Fireworks Trainer / Deployment Shapes
string
Training shape for the policy trainer job
integer
default:"1"
Replica count for the policy trainer
integer
default:"1"
Replica count for the inference deployment used during rollouts
string
Reference trainer shape (only needed for full-parameter RFT with
kl_beta > 0)integer
default:"0"
Reference trainer replica count. Leave at
0 for LoRA (policy serves as frozen reference)Validation Configuration
integer
required
Number of rollouts per validation prompt
Data Configuration
integer
default:"32"
Training batch size
integer
default:"32"
Validation batch size
integer
default:"30720"
Maximum prompt length in tokens
integer
default:"2048"
Maximum response length in tokens
Trainer Configuration
integer
default:"10"
Number of training epochs
integer
default:"5"
Validation frequency (in steps)
integer
default:"20"
Checkpoint save frequency (in steps). In async mode, must be a multiple of
trigger_parameter_sync_stepstring
default:"default"
Experiment name (used for promoted model IDs:
{experiment_name}-step-{step})Fireworks Infrastructure
Thefireworks_infra section controls provisioning. rLLM mirrors key training knobs into this document before calling the cookbook’s init_fireworks_infra. You typically configure shapes and replica counts via fireworks_config rather than editing fireworks_infra directly.
Key provisioning fields:
string
default:"null"
Attach to an existing deployment (
null creates a new one per run)string
default:"null"
Attach to an existing trainer job (
null creates a new job)integer
default:"600"
Timeout for weight hot-loading into the deployment (seconds)
string
default:"https://api.fireworks.ai"
Fireworks API base URL
cleanup_on_close=True, cleanup_existing=True). Each run provisions fresh trainer and deployment resources unless you explicitly set job_id or deployment_id to reattach.
LoRA Training
LoRA is the default path (model.lora_rank=32). With LoRA, the frozen reference policy is reused from the policy trainer — leave reference_trainer_replica_count=0.
model.lora_rank=0), enable a reference trainer for KL divergence:
Sampling Configuration
Rollout sampling usesrllm.rollout (not a separate sampling block):
float
default:"1.0"
Training sampling temperature
float
default:"1.0"
Training top-p (nucleus) sampling
float
default:"1.0"
Validation sampling temperature
float
default:"1.0"
Validation top-p sampling
Rollout Engine Configuration
string
default:"medium"
Reasoning effort level:
"low", "medium", "high"boolean
default:"false"
Accumulate reasoning tokens across steps
boolean
default:"false"
Disable thinking tokens in responses
boolean
default:"false"
Bypass renderer and use parser directly
string
default:"null"
Optional renderer name for chat template rendering
Concurrency
Fireworks rollout concurrency is controlled via the cookbookConcurrencyConfig:
string
default:"adaptive"
Concurrency mode:
"adaptive" or "fixed"integer
default:"null"
Starting window for adaptive mode (
null = 8 × replica count)integer
default:"256"
Maximum concurrent requests
float
default:"0.5"
Target prefill queue duration (seconds) for adaptive mode
Algorithm Configuration
Fireworks uses server-side builtin loss kernels. Configure viarllm.algorithm:
string
default:"grpo"
Advantage estimator:
"grpo", "reinforce", etc.string
default:"null"
Policy loss:
null (GRPO default), "dapo", "cispo", or "gspo"string
default:"null"
Loss aggregation:
null (backend default), "token-mean", "seq-mean-token-sum", or "seq-mean-token-mean"string
default:"disabled"
Router replay mode:
"disabled" or "R3" ("R2" is not supported)boolean
default:"true"
When
true, rollout logprobs are used as proximal policy (decoupled PPO bypass). Set false for active TIS correctionstring
default:"null"
Truncated importance sampling mode:
null, "token", or "sequence" (requires bypass_mode=false)Async Training
Async training overlaps rollouts with policy updates for higher throughput:When async training is enabled,
save_freq must be a multiple of trigger_parameter_sync_step. Checkpoint promotion requires a sampler snapshot created at sync time.Checkpointing
Fireworks checkpoints are stored as DCP (Distributed Checkpoint) on the trainer job. After each sync step, weights are hot-loaded to the inference deployment. When saving, checkpoints can be promoted to a Fireworks model ID.Automatic Checkpointing
Resume from Checkpoint
Resume from the latest DCP on the current or source job:{experiment_name}-step-{global_step}.
Limitations
Example Configuration
Complete configuration for countdown workflow training:config.yaml
Performance Optimization
Enable async training
Set
rllm.async_training.enable=true to overlap rollouts and policy updatesTune concurrency
Increase
concurrency.max_window and deployment replica_count for higher rollout throughputUse LoRA
LoRA training (
model.lora_rank > 0) is faster and avoids provisioning a reference trainerParallel workflows
Increase
rllm.workflow.n_parallel_tasks for workflow-based trainingTroubleshooting
FIREWORKS_API_KEY not set
FIREWORKS_API_KEY not set
Export your API key before launching training:
fuse_forward_backward_and_optim_step error
fuse_forward_backward_and_optim_step error
The Fireworks backend does not support fused optimizer steps:
save_freq / sync interval mismatch
save_freq / sync interval mismatch
In async mode,
save_freq must be a multiple of trigger_parameter_sync_step:Sampling parameter warning
Sampling parameter warning
Keep rollout temperature and top_p at 1.0:
Resources still running after crash
Resources still running after crash
If training exits abnormally before
shutdown(), trainer jobs and deployments may keep running on Fireworks. Reattach with job_id / deployment_id or delete them from the Fireworks console.router_replay R2 not supported
router_replay R2 not supported
Use
R3 or disabled:Comparison with tinker
See Backend Comparison for the full verl vs tinker feature matrix.
See Also
tinker Backend
Local or remote tinker service training
verl Backend
Distributed training with verl
Backend Comparison
Compare training backends
Unified Trainer
Learn about the unified trainer architecture
Fireworks Training Cookbook
Official Fireworks training cookbook

