Skip to main content
The open source SDK and the osmosis CLI ship in the same osmosis-ai Python package. The SDK requires Python 3.12 or later and supports Python 3.12, 3.13, and 3.14.

Install v0.3

Install the stable v0.3 line without crossing the next minor-version boundary:
Verify both the package and bundled CLI:
These instructions use stable 0.3.10 as the baseline; <0.4 keeps installs on the current minor-version line. Upgrade the CLI, rollout callers, and rollout dependencies in rollouts/<name>/pyproject.toml, then regenerate their lockfiles and rebuild affected runtime images. Updating the CLI alone does not update an existing rollout environment. If you are upgrading from 0.3.2 or earlier, update callers and servers together because the old callback protocol does not interoperate with long polling. See the v0.3 migration guide.

Optional Extras

Install only the features your project imports: Extras can be combined. A Strands rollout served over HTTP, for example, uses:
The strands, openai-agents, harbor, rubric, and eval extras (including full) require fsspec>=2026.6.0. Version 0.3.6 also raised the applicable LiteLLM, urllib3, and PyJWT minimums for security fixes. Version 0.3.8 updates the certifi and uv CA trust stores and raises the applicable aiohttp, multidict, and MCP requirements. Resolve conflicting application pins when refreshing lockfiles; see the changelog for the exact ranges. Version 0.3.9 raises the applicable LiteLLM, filelock, Strands Agents, and OpenTelemetry API security requirements. It also changes the source digest used by named local eval runs: finish interrupted runs with their original SDK before upgrading, or use a new name or --fresh afterward. See the 0.3.9 migration steps. Version 0.3.10 uploads local eval results as a single streamed archive and requires a platform with archive import support. See the 0.3.10 migration steps.

Minimal SDK Example

This entrypoint explicitly wires a workflow and grader into LocalBackend, then exposes that backend as a rollout server:
Install the server extra, save the example as main.py, and run the entrypoint:
Set timeout_keep_alive=2160 in existing server entrypoints as well. New SDK 0.3.7 scaffolds use this value to keep idle connections alive beyond the managed load balancer’s idle timeout. The Platform sets _OSMOSIS_ROLLOUT_PORT and the server then binds every interface in the managed container; local runs default to 127.0.0.1:8000.
This example leaves rollout server authentication disabled. Keep it on loopback locally; for self-hosted access, configure rollout server authentication and HTTPS.
This example demonstrates wiring, not a trainable policy call. For training, use the Strands integration or OpenAI Agents integration so model requests route through the active rollout context.

Platform Authentication and Upgrades

SDK-only local code does not need a Platform login. Commands that submit evaluations or training runs do; follow CLI Installation & Authentication to run osmosis auth login or configure OSMOSIS_TOKEN. If you are upgrading an existing v0.2 harness, read the SDK v0.2 → v0.3 migration guide before changing the dependency, especially if it constructs HarborBackend.

Next Steps

AgentWorkflow

Implement the behavior that produces one rollout sample.

Execution Backends

Wire your workflow and grader into Local or Harbor execution.
Last modified on November 2, 2026