Installation & Environment Setup
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Osmosis AI SDK provides a Python-based interface for LLM training workflows, including reward/rubric validation and remote rollout integration. The installation process is designed to support both standard users via PyPI and developers through editable source installations. The environment setup facilitates secret management for various LLM providers and configuration for rollout servers.
Sources: README.md:1-10, pyproject.toml:7-10
Core Installation Methods
Standard Installation
Users can install the package directly from PyPI. This installation automatically includes core dependencies required for LLM interfacing and reward logic.
pip install osmosis-ai
Sources: README.md:12-14
Developer & Source Installation
For developers extending the SDK, the repository supports editable installations and optional dependency groups for testing and specialized server features.
git clone https://github.com/Osmosis-AI/osmosis-sdk-python
cd osmosis-sdk-python
# Basic editable install
pip install -e .
# Install with development tools (pytest, black, etc.)
pip install -e ".[dev]"
Sources: README.md:18-28
Dependency Specifications
The project requires Python >= 3.10 and defines several dependency tiers in its configuration.
| Tier | Dependencies | Purpose |
|---|---|---|
| Core | litellm, PyYAML, requests, python-dotenv, httpx, pydantic | Base SDK and LLM routing |
| Server | fastapi, uvicorn, pydantic-settings, pyarrow, rich | Hosting RolloutServers and Test Mode |
| Dev | pytest, pytest-asyncio, black, isort | Testing and code formatting |
Sources: pyproject.toml:23-53
Environment Configuration
Automatic Environment Setup (Windows)
The setup_env.bat script automates the creation of a virtual environment and dependency installation for Windows users.
Sources: setup_env.bat:1-25
Secret Management
The SDK relies on environment variables to manage API keys for various LLM providers. These can be stored in a .env file in the working directory, which is automatically loaded by the CLI.
| Provider | Environment Variable |
|---|---|
| OpenAI | OPENAI_API_KEY |
| Anthropic | ANTHROPIC_API_KEY |
| Google Gemini | GEMINI_API_KEY |
| xAI | XAI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Cerebras | CEREBRAS_API_KEY |
Sources: README.md:46-56, osmosis_ai/cli.py:16-18
Rollout SDK Configuration
The Remote Rollout component uses Pydantic-based settings that can be configured via environment variable prefixes.
Configuration Hierarchy
Settings are resolved in the following order:
- Programmatic overrides via
configure() - Environment variables (prefixed with
OSMOSIS_ROLLOUT_) .envfile values- Default values defined in
RolloutSettings
Key Configuration Parameters
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
timeout_seconds | OSMOSIS_ROLLOUT_CLIENT_TIMEOUT_SECONDS | 300.0 | HTTP request timeout |
max_retries | OSMOSIS_ROLLOUT_CLIENT_MAX_RETRIES | 3 | Retries for 5xx errors |
max_concurrent_rollouts | OSMOSIS_ROLLOUT_SERVER_MAX_CONCURRENT_ROLLOUTS | 100 | Server capacity limit |
max_metadata_size_bytes | OSMOSIS_ROLLOUT_MAX_METADATA_SIZE_BYTES | 1048576 | 1MB metadata limit |
Sources: osmosis_ai/rollout/config/settings.py:53-108, osmosis_ai/rollout/config/settings.py:186-210
Build and Distribution
For maintainers, the project includes a build_package.bat script to prepare the package for distribution to PyPI.
Sources: build_package.bat:1-18
Conclusion
Setting up the Osmosis SDK involves installing the core Python package, configuring provider-specific API keys via environment variables, and optionally tuning rollout server parameters. The project provides automated scripts for Windows environments and follows standard Python packaging conventions for cross-platform support.
Sources: README.md:12-28, setup_env.bat:1-25