Secure reinforcement fine-tuning (RFT)
Use reinforcement fine-tuning while keeping sensitive components and data under your control. Follow these steps to run secure RFT end to end using your own storage and reward pipeline.1
Configure storage (BYOB)
Point Fireworks to your storage so you retain governance and apply your own compliance controls.
- Datasets: GCS Bucket Integration (AWS S3 coming soon)
- Models (optional): External AWS S3 Bucket Integration
Grant least-privilege IAM to only the bucket/path prefixes needed for training. Use server-side encryption and your KMS policies where required.
2
Prepare your reward pipeline and rollouts
Keep your reward functions, rollout servers, and training metrics under your control. Generate rewards from your environment and write them to examples in your dataset (or export a dataset that contains per-example rewards).
- Reward functions and reward models remain proprietary and never need to be shared
- Rollouts and evaluation infrastructure run in your environment
- Model checkpoints can be registered to your storage registry if desired
3
Create a dataset that includes rewards
Create or point a
Dataset at your BYOB storage. Ensure each example contains the information required by your reward pipeline (for example, prompts, outputs/trajectories, and numeric rewards).You can reuse existing supervised data by attaching reward signals produced by your pipeline, or export a fresh dataset into your bucket for consumption by RFT.
4
Run reinforcement step from Python
Use the Python SDK to run reinforcement steps that read from your BYOB dataset and produce a new checkpoint.See
LLM.reinforcement_step() and ReinforcementStep for full parameters and return types.When continuing from a LoRA checkpoint, training parameters such as
lora_rank, learning_rate, max_context_length, epochs, and batch_size must match the original LoRA training.5
Verify outputs and enforce controls
- Validate the new checkpoint functions as expected in your environment
- If exporting models to your storage, apply your registry policies and access reviews
- Review audit logs and rotate any temporary credentials used for the run
Do not store long-lived credentials in code. Use short-lived tokens, workload identity, or scoped service accounts when granting Fireworks access to your buckets.
You now have an end-to-end secure RFT workflow with BYOB datasets, proprietary reward pipelines, and isolated training jobs that generate new checkpoints.
GCS Bucket Integration
Use external Google Cloud Storage (GCS) buckets for fine-tuning while keeping your data private. Fireworks creates proxy datasets that reference your external buckets—data is only accessed during fine-tuning within a secure, isolated cluster.Your data never leaves your GCS bucket except during fine-tuning, ensuring maximum privacy and security.
Required Permissions
You need to grant access to three service accounts:Fireworks Control Plane
- Account:
fireworks-control-plane@fw-ai-cp-prod.iam.gserviceaccount.com - Required role: Custom role with
storage.buckets.getIamPolicypermission
Inference Service Account
- Account:
inference@fw-ai-cp-prod.iam.gserviceaccount.com - Required role: Storage Object Viewer or Storage Object Admin
Your Company’s Fireworks Service Account
- Account: Your company’s Fireworks account registration email
- Required role: Storage Object Viewer or Storage Object Admin
firectl get account) must have at least read access to the bucket listed under the bucket access IAM policy.
Usage Example
1
Create a Proxy Dataset
Create a dataset that references your external GCS bucket:
Ensure your gsutil path points directly to the JSONL file. If the file is in a folder, make sure the folder contains only the intended file.
2
Start Fine-tuning
Use the proxy dataset to create a fine-tuning job:
For additional options, run:
firectl create sftj -hKey Benefits
Data Privacy
Your data never leaves your GCS bucket except during fine-tuning
Security
Access is limited to isolated fine-tuning clusters
Simplicity
Reference external data without copying or moving files