osmosis-ai SDK defines and runs agent behavior in Python; the bundled osmosis CLI submits and inspects runs; the Osmosis Platform manages datasets, evaluation, and training. They ship together, but each has a distinct role.
A rollout definition explicitly wires an AgentWorkflow, an optional Grader, their configs, and an execution backend. A rollout execution runs that definition once for one dataset prompt. It produces at most one rollout sample: the agent’s framework-native message history plus an optional reward and metrics.
Training Loop
Training on Osmosis repeatedly runs the same four-part loop:1
Select a dataset row
The training cluster selects one row from your dataset and sends its prompt fields to your
AgentWorkflow. Common datasets contain system_prompt, user_prompt, and ground_truth.2
Run the AgentWorkflow
Your workflow receives an
AgentWorkflowContext, calls the current policy through an Osmosis-supported agent integration, uses any tools you provide, and records one rollout sample.3
Grade the sample
Your
Grader receives the sample plus the row’s reference answer (ground_truth, exposed as ctx.label) and assigns one numerical reward.4
Update the model
The reward signal drives the training update, moving the policy toward behavior that receives higher rewards on your task.
Files in a Rollout
Each rollout lives underrollouts/ and is referenced by evaluation and training configs:
Submit preflight validates the rollout path, then imports the configured entrypoint once so import-time wiring errors surface and fail the submit. The import is best effort: when the local environment does not satisfy the rollout’s declared dependencies, or the import raises
ModuleNotFoundError, the CLI warns and submission continues, and the platform validates the entrypoint after installing them. Preflight does not scan the module namespace. Multiple workflow or grader classes may coexist; the backend constructor selects which classes and config objects run.Core Abstractions
Choose an Agent Framework
Most rollout authors start with one of the built-in agent integrations:Strands Agents
Use
OsmosisStrandsAgent when you want Strands tools, Strands message handling, and a direct migration path from an existing Strands Agent.OpenAI Agents
Use
OsmosisAgent when your workflow already uses the OpenAI Agents SDK, Runner.run, sessions, handoffs, or OpenAI-style tool orchestration.OsmosisRolloutModel placeholder. You do not hard-code the training model inside rollout code; Osmosis resolves the placeholder to the current policy at runtime.
Choose an Execution Backend
If you useosmosis eval submit or osmosis train submit, you do not choose a backend from the CLI. The rollout entrypoint constructs it when the Platform starts the rollout server, and starter templates use LocalBackend unless you choose the Harbor template.
Choose the backend path in that entrypoint or in a self-hosted SDK harness:
See Execution Backends for the complete decision guide.
Upgrading an SDK harness from v0.2?
LocalBackend keeps its constructor, while v0.3 replaces the pre-v0.3 HarborBackend with the implementation previously named HarborBackendV2. Follow the SDK v0.2 → v0.3 migration guide before changing dependencies.Start from a Template
If you already have a task or dataset, start with the Custom Rollout Guide. Platform-created workspace repositories include project-local Agent Skills that guide an AI coding agent through dataset planning, rollout creation, evaluation runs, debugging, and training run readiness. Install the package first — see SDK Installation — and runosmosis template apply from inside your cloned workspace directory.
List available starter templates:
rollouts/ plus matching evaluation and training configs, and are the quickest way to see the expected file layout, dependency declaration, and end-to-end workflow.
Next Steps
Custom Rollout Guide
Use project-local Agent Skills to create a task-specific rollout with evaluation run gates.
AgentWorkflow
Learn the
AgentWorkflow.run(ctx) contract and common implementation patterns.Grader
Define reward signals that can drive training.
Strands Integration
Build tool-using rollouts with AWS Strands Agents.
OpenAI Agents Integration
Build rollouts with the OpenAI Agents SDK.