How-to Guides¶
Task-oriented guides that help you accomplish specific goals with Flux.
Available Guides¶
-
Add a Custom Algorithm
Create and register your own RL algorithm
-
Implement Custom Rewards
Build reward functions for your specific task
-
Scale to Multiple Nodes
Distribute training across multiple machines
-
Debug Training Issues
Diagnose and fix common training problems
-
Optimize Performance
Get maximum throughput from your hardware
-
Monitor with Prometheus
Set up comprehensive training monitoring
-
Resume from Checkpoint
Save and restore training state
Quick Answers¶
How do I change the learning rate during training?¶
# Use a scheduler
from flux import FluxConfig
config = FluxConfig(
learning_rate=1e-6,
lr_scheduler="cosine",
lr_scheduler_config={
"warmup_steps": 100,
"min_lr": 1e-7,
}
)
How do I use multiple reward functions?¶
from flux.rewards import CompositeReward, LengthReward, KeywordReward
reward = CompositeReward([
(LengthReward(target=200), 0.3),
(KeywordReward(required=["answer"]), 0.7),
])
How do I save checkpoints more frequently?¶
How do I use a different model for inference?¶
model_path: "Qwen/Qwen3-8B" # Training model
sglang:
model_path: "Qwen/Qwen3-8B-Instruct" # Inference model (optional)
base_url: http://localhost:8000
How do I adjust the async ratio manually?¶
By Category¶
Training¶
| Guide | Description |
|---|---|
| Custom Algorithm | Add your own RL algorithm |
| Custom Rewards | Build task-specific rewards |
| Debugging | Fix training issues |
| Checkpoints | Save and restore training |
Scaling¶
| Guide | Description |
|---|---|
| Multi-Node | Distribute across machines |
| Performance | Optimize throughput |
Operations¶
| Guide | Description |
|---|---|
| Monitoring | Set up Prometheus/Grafana |
Contributing Guides¶
Have a guide to share? We welcome contributions!
- Fork the repository
- Add your guide to
docs/how-to/ - Update this index
- Submit a pull request
See Contributing for details.