Module exports
DeploymentFactory
Factory for creating deployed Software instances.Methods
create()
Create a deployed Software instance.
Returns:
Software instance with unified interface
Raises:
ValueErrorif strategy not in allowed listRuntimeErrorif adaptation fails
list_strategies()
List all available deployment strategies.explain_strategy()
Get explanation of a deployment strategy.
Returns: One-line description from selector instruction
Example:
print_strategies_info()
Print information about all deployment strategies.DeployStrategy
Enum of available deployment strategies. Auto-generated fromstrategies/ directory.
DeployConfig
Configuration for deploying software.
Properties:
Example:
Software (abstract base class)
Unified interface for deployed software. Users interact with this class.Methods
run()
Execute the software with given inputs.
Returns: Normalized response dictionary
Response Format:
stop()
Stop the software and cleanup resources.
Example:
start()
Start or restart a stopped deployment.
Example:
logs()
Get execution logs.is_healthy()
Check if software is running and healthy.True if healthy, False otherwise
Example:
name (property)
Return the deployment strategy name.Convenience methods
call()
Shorthand forrun().
run_batch()
Run multiple inputs in sequence.Context manager support
DeployedSoftware
Concrete implementation ofSoftware. Wraps any runner with unified interface.
Additional methods
get_adapted_path()
Get path to the adapted code.get_endpoint()
Get HTTP endpoint if applicable.None
Example:
get_deployment_info()
Get full deployment metadata.get_strategy()
Get the deployment strategy name.get_provider()
Get the cloud provider name.Data classes
DeploymentSetting
Result of strategy selection.AdaptationResult
Result of code adaptation.DeploymentInfo
Metadata about the deployment.SelectorAgent
LLM-based strategy selection agent.Methods
select()
Select deployment configuration for a solution.explain()
Get human-readable explanation of selection.AdapterAgent
Code transformation and deployment agent.Methods
adapt()
Adapt a solution for deployment.{code_path}_adapted_{strategy}. Original is never modified.
StrategyRegistry
Auto-discovery system for deployment strategies.Methods
Runner (abstract base class)
Base class for strategy-specific runners.Lifecycle
Runners follow this lifecycle:__init__()→ Ready staterun()→ Execute (can be called multiple times)stop()→ Stopped state (resources cleaned up)start()→ Ready state (can run again)
Abstract methods
Error handling
Environment variables
Related
Deployment strategies
The five targets and what each one suits
Python API
deploy() on the Kapso class
pip install leeroo-kapso · Every page as plain text: llms.txt.