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
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
DeploymentSettingwith 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
- On first use,
StrategyRegistryscans thestrategies/directory - Each subdirectory with both instruction files is registered
- Runner classes are lazy-loaded from
runner.pywhen needed
Related
Strategies Reference
Detailed guide to each deployment strategy
Adding New Strategies
Step-by-step guide to add your own deployment targets
pip install leeroo-kapso · Every page as plain text: llms.txt.