Skip to content

Support custom metric for SDK#362

Merged
thwu1 merged 3 commits into
rllm-org:mainfrom
thwu1:main
Jan 9, 2026
Merged

Support custom metric for SDK#362
thwu1 merged 3 commits into
rllm-org:mainfrom
thwu1:main

Conversation

@thwu1
Copy link
Copy Markdown
Collaborator

@thwu1 thwu1 commented Jan 9, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 9, 2026 07:36
@thwu1 thwu1 merged commit b83aebd into rllm-org:main Jan 9, 2026
1 check passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for custom metrics in the SDK by allowing agent functions to return metrics alongside their output. The implementation enables agents to return a tuple of (payload, metrics) where the payload can be either a float/int/bool reward or a list of TrajectoryView objects.

Key changes:

  • Added tuple output handling in process_task_with_retry to extract custom metrics from agent responses
  • Modified _execute_tasks to merge custom metrics with standard system metrics
  • Removed debug print statement for rollout correction metrics

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
rllm/engine/agent_sdk_engine.py Added tuple unpacking logic to support custom metrics from agent functions and merge them with system-generated metrics
rllm/trainer/verl/agent_sdk_trainer.py Removed debug print statement for rollout correction metrics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rllm/engine/agent_sdk_engine.py
Comment thread rllm/engine/agent_sdk_engine.py
Comment thread rllm/engine/agent_sdk_engine.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants