Functions as a service. Triggered by an event (e.g. click).
- scales with demand automatically
- do not pay for idle
- eliminates server maintenance
But:
- timeouts
- latency issues, having to deal with cold starts each time
Main options:
- AWS Lambda (annoying to set up, hardware limitations, expensive, not easy to get big machines/GPU)
- Coiled
- Modal
Coiled
- Coiled creates a VM,
uv pip install
local software packages, cloud credentials, files, etc.., runs your script, and then shuts down the VM - use any of the major cloud providers
- based on Dask clusters
- support for mlflow
- run a script using CLI
- run a single function in python
Modal
- modal runs it in its own cloud environment (so no AWS or other cloud providers yet) but with rapid spin-up times (Rust rather than Docker/kubernetes)
- support for scheduling cron jobs in the cloud, timeouts, retries
- support for web endpoints
@modal.web_endpoint(method="POST)
- specify images in python (rather than Docker) through method chaining
- can also use
mamba install
oruv
- can access images from registry or
.from_dockerfile("Dockerfile")
- can also use
- run a single function in python