[feature]: @rllm.rollout and @rllm.evaluator decorators + cookbook examples#445
Merged
jeffreysijuntan merged 7 commits intomainfrom Mar 17, 2026
Merged
[feature]: @rllm.rollout and @rllm.evaluator decorators + cookbook examples#445jeffreysijuntan merged 7 commits intomainfrom
@rllm.rollout and @rllm.evaluator decorators + cookbook examples#445jeffreysijuntan merged 7 commits intomainfrom
Conversation
Add decorator-based API that turns plain functions into AgentFlow and Evaluator protocol-compatible objects, replacing boilerplate class definitions. Rewrite cookbooks to use the new style. - AgentFlowFn wraps a function to satisfy AgentFlow protocol (run/arun) - EvaluatorFn wraps a function to satisfy Evaluator protocol (evaluate) - Support flexible return types with automatic coercion to Episode/EvalOutput - Expose as @rllm.rollout and @rllm.evaluator via lazy imports Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Updated the documentation site link to the new URL.
… dev-sijun-cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@rllm.rolloutand@rllm.evaluatordecorators + cookbook examplesSummary
@rllm.rolloutdecorator — turns any plain function into anAgentFlow-compatible object. Supports sync and async functions, and automatically coerces return values (str,dict,list[Trajectory], orEpisode) into a properEpisode.@rllm.evaluatordecorator — turns a scoring function into anEvaluator-compatible object. Acceptsfloat,bool,(float, bool)tuples, orEvalOutputreturns.rllm.rolloutandrllm.evaluatorvia lazy imports inrllm/__init__.py.cookbooks/geo3k/— geometry QA agent with VLM support, showing eval + train end-to-end.cookbooks/solver_judge_flow/— multi-agent solver-judge pattern with separate reasoning and judging trajectories.Motivation
The existing
AgentFlow/Evaluatorprotocol requires users to define classes with specific method signatures. The new decorators reduce boilerplate to a single@rllm.rolloutor@rllm.evaluatorannotation on a plain function, making it significantly easier to get started with rLLM for both eval and training.Files changed
rllm/__init__.pyrolloutandevaluatorrllm/experimental/eval/rollout_decorator.pyAgentFlowFn,EvaluatorFn, coercion helpers,@rolloutand@evaluatordecoratorstests/eval/test_rollout_decorator.pycookbooks/geo3k/cookbooks/solver_judge_flow/README.mdTest plan
pytest tests/eval/test_rollout_decorator.pypassesrllm eval gsm8kstill works (no regression from__init__.pychanges)python test.pyin each cookbook directory