Skip to main content
Deployment is a plugin system. A selector picks a target, an adapter rewrites the solution for it, and a runner executes it — and each target is a self-contained directory that can be added without touching core code.

Module breakdown

Directory structure


Core components

DeploymentFactory (factory.py)

The orchestrator that manages the full deployment pipeline. Responsibilities:
  • Coordinate selection, adaptation, and runner creation
  • Handle strategy validation
  • Create unified Software instances
Flow:

SelectorAgent (selector/agent.py)

LLM-based strategy selection that analyzes code and chooses the optimal deployment target. Responsibilities:
  • Gather selector instructions from all strategies
  • Query coding agent to analyze repository
  • Return DeploymentSetting with chosen strategy

AdapterAgent (adapter/agent.py)

Code transformation and deployment using coding agents. Responsibilities:
  • Create adapted workspace (copy of original)
  • Load adapter instructions for target strategy
  • Run coding agent to transform code
  • Extract endpoint URL and run interface from output
Key Output Extraction: The adapter looks for special XML tags in the coding agent’s output:

StrategyRegistry (strategies/base.py)

Auto-discovery system for deployment strategies. Responsibilities:
  • Scan strategies/ directory on startup
  • Load configuration and instructions for each strategy
  • Provide access to strategy metadata and runner classes

Runner (abstract base class)

Infrastructure-specific execution handler.

DeployedSoftware (software.py)

Unified wrapper that users interact with.

Data models

The dataclasses that travel between these components — DeployConfig, DeploymentSetting, AdaptationResult, DeploymentInfo — are listed field-by-field in the API reference.

How are strategies discovered?

Each strategy is a self-contained directory:

config.yaml structure

How strategies are discovered

  1. On first use, StrategyRegistry scans the strategies/ directory
  2. Each subdirectory with both instruction files is registered
  3. Runner classes are lazy-loaded from runner.py when needed
Adding a new strategy is adding a directory - no code changes required in the core system.

Strategies Reference

Detailed guide to each deployment strategy

Adding New Strategies

Step-by-step guide to add your own deployment targets
Related pages: Strategies Reference · Adding New Strategies · Deployment Kapso is an open-source framework by Leeroo that builds software toward measurable goals through experiment campaigns. Source code: github.com/Leeroo-AI/kapso · Install: pip install leeroo-kapso · Every page as plain text: llms.txt.