Skip to main content

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.

Upload Reward Function

name
string
required
A human-readable name for the reward function.
file
file
required
A Python .py file containing the reward function.
format
string
required
The reward function format. Supported values: trl and miles.

Request

curl -X POST https://api.veri.studio/v1/reward_functions \
  -H "Authorization: Bearer vk_your_api_key" \
  -F "name=math_reward" \
  -F "file=@reward.py" \
  -F "format=trl"

Response

{
  "id": "rf_def456",
  "object": "reward_function",
  "name": "math_reward",
  "format": "trl",
  "created_at": "2026-04-14T12:05:00Z"
}

List Reward Functions

limit
integer
default:"20"
Maximum number of reward functions to return.
after
string
Cursor for pagination. Pass the ID of the last item from the previous page.

Request

curl "https://api.veri.studio/v1/reward_functions?limit=10" \
  -H "Authorization: Bearer vk_your_api_key"

Response

{
  "object": "list",
  "data": [
    {
      "id": "rf_def456",
      "object": "reward_function",
      "name": "math_reward",
      "format": "trl",
      "created_at": "2026-04-14T12:05:00Z"
    }
  ],
  "has_more": false
}

Get Reward Function

Request

curl https://api.veri.studio/v1/reward_functions/rf_def456 \
  -H "Authorization: Bearer vk_your_api_key"

Response

{
  "id": "rf_def456",
  "object": "reward_function",
  "name": "math_reward",
  "format": "trl",
  "created_at": "2026-04-14T12:05:00Z"
}

Reward Function Format

trl

trl reward files must contain def reward(. The control plane currently performs a lightweight signature check before accepting the file.
def reward(completions, answer=None, **kwargs):
    return [1.0 if answer and str(answer) in c else 0.0 for c in completions]

miles

miles reward files must contain async def reward(:
async def reward(args, sample, **kwargs) -> float:
    if sample.label and str(sample.label) in sample.response:
        return 1.0
    return 0.0
Uploads are syntax-checked with compile(...) before they are stored.
See Reward Functions for a more detailed guide.