Documentation Index
Fetch the complete documentation index at: https://docs.veri.studio/llms.txt
Use this file to discover all available pages before exploring further.
Overview
A reward function is the core of fine-tuning with GRPO. It tells the training system what “good” model output looks like by assigning a numerical score to each completion. During training, the model learns to produce outputs that maximize these scores. Veri currently supports two reward file formats.trl Format
This is the current default in the control plane. Your file must contain def reward(:
miles Format
This format lines up with the Miles runner interface and must contain async def reward(:
sample object.
Examples
Format Checking
Reward completions that follow a specific format (e.g., step-by-step reasoning):Correctness Verification
Reward completions that produce the correct answer for math problems:Code Quality
Reward completions that contain valid Python code:Best Practices
Keep scores bounded
Keep scores bounded
Use a consistent scoring range like
[0.0, 1.0]. Extreme outlier scores can destabilize training.Combine multiple signals
Combine multiple signals
A good reward function often checks several properties — format, correctness, length, style. Use additive scoring to combine them.
Make rewards differentiable in behavior
Make rewards differentiable in behavior
Avoid pure binary (0 or 1) scoring when possible. Partial credit helps the model learn faster by providing a smoother reward signal.
Test locally before uploading
Test locally before uploading
Run your reward function against sample completions locally to verify it produces sensible scores before uploading to Veri.
Match the format exactly
Match the format exactly
The control plane currently checks for
def reward( in trl files and async def reward( in miles files before accepting the upload.Available imports
Available imports
Your reward function runs inside the training environment. Standard library modules are safe assumptions; additional package availability depends on the runner image.