Skip to main content
deploy() takes a strategy that decides where the solution runs. Five ship, plus AUTO, which picks one for you.

Which strategy should I use?

In Python the values are DeployStrategy.LOCAL and so on; on the CLI they are lowercase, as --strategy docker.

Local

Runs the solution as a plain Python process in the current environment. Nothing to install, easiest to debug, no isolation.
The adapter ensures a main.py exposing predict() and the runner imports it. Its run_interface is {type: function, module: main, callable: predict}.

Docker

Runs the solution in a container, so system dependencies and Python versions stay contained. Needs Docker installed and running.
Served over HTTP at http://localhost:8000/predict, from a container named solution-container.
Runs on Modal’s serverless platform, which is the quickest route to a GPU you do not have to operate. Needs pip install modal && modal token new.
The strategy declares T4/16Gi as its default resources and calls a predict function; the generated app itself starts CPU-only, with the GPU line ready to uncomment.

BentoML

Packages the solution as a BentoML service for self-hosted production serving. Needs pip install bentoml.
Default resources are 2 CPUs and 4Gi of memory, served at /predict against the bentocloud provider.

LangGraph

Deploys the solution as a LangGraph agent workflow, with state, tools, streaming and checkpoints. Needs pip install langgraph.
The adapter writes agent.py, main.py and langgraph.json; the runner calls the deployed graph on LangGraph Platform via langgraph_sdk, against assistant id agent.

How does AUTO choose?

AUTO is the default. A selector agent reads the solution and picks a target from the code itself rather than from a rule table:
It weighs how complex the code is, what it needs at runtime — GPU, memory, system packages — and whether isolation is required. Each strategy ships a selector_instruction.txt describing when it is the right answer, so the choice is made from those descriptions. Name a strategy explicitly when you already know the answer; AUTO costs a model call.

How do I pass environment variables?

On the CLI, repeat --env:

Deployment architecture

How the selector, adapter and runner fit together

Adding a strategy

Write your own target
Related pages: Deployment architecture · Adding a strategy · 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.