Skip to content

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

    Guide

  • Implement Custom Rewards


    Build reward functions for your specific task

    Guide

  • Scale to Multiple Nodes


    Distribute training across multiple machines

    Guide

  • Debug Training Issues


    Diagnose and fix common training problems

    Guide

  • Optimize Performance


    Get maximum throughput from your hardware

    Guide

  • Monitor with Prometheus


    Set up comprehensive training monitoring

    Guide

  • Resume from Checkpoint


    Save and restore training state

    Guide


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?

checkpoint:
  save_steps: 100  # Save every 100 steps
  max_checkpoints: 10
  keep_best: 3

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?

adaptive_async:
  enabled: false  # Disable adaptive control
  fixed_async_ratio: 0.5  # Use fixed ratio

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!

  1. Fork the repository
  2. Add your guide to docs/how-to/
  3. Update this index
  4. Submit a pull request

See Contributing for details.