Skip to content

Add Mosaic grouped rollout example - #30

Open
nitinrao wants to merge 2 commits into
harbor-framework:mainfrom
mosaicos-repos:devin/mosaic-rl-example
Open

nitinrao wants to merge 2 commits into
harbor-framework:mainfrom
mosaicos-repos:devin/mosaic-rl-example

Conversation

@nitinrao

Copy link
Copy Markdown

Summary

Adds a mosaic_rl example that generates grouped rollouts — k attempts per task, the shape GRPO-style trainers (SkyRL, Prime-RL) consume — on Mosaic Sandbox, plus a row in the root README's Optimization Examples table.

uv run harbor_cookbook/mosaic_rl/rollout.py \
  -t hello-world/hello-world --group-size 8 --env mosaic
# hello-world: [1.0, 0.0, 1.0, 1.0, ...]

Why it's a separate example rather than a flag on harbor_rl: the sibling example targets the RL API from open PR #1291, whereas this one runs entirely on released Harbor 0.22 Job/JobConfig via a helper in the Mosaic SDK, so it works against a released Harbor today. --env accepts mosaic, daytona, or any module:Class import path, so the same script is the A/B harness.

The point of the example is snapshot amortization: a group builds the task environment once into a Mosaic snapshot and restores an isolated sandbox per attempt, so only the first attempt pays the build.

It uses import_path today:

[environment]
import_path = "mosaic_sandbox.integrations.harbor:MosaicEnvironment"

and the README notes that --env mosaic becomes native once the provider PR lands upstream.

The README's Mosaic-vs-Daytona section is methodology only — what to hold constant (task set, k, concurrency, agent, model) and what to record (wall-clock, rollouts/sec, mean per-trial wall time, first-attempt vs. subsequent-attempt cost). No numbers are quoted, because I haven't run the comparison at a scale worth publishing.

Requires a Mosaic credential (mos login or MOSAIC_API_TOKEN), a model-provider key, and DAYTONA_API_KEY only for the comparison arm.

nitinrao and others added 2 commits August 24, 2026 15:51
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant