Skip to main content
This example builds a custom FastAPI template, creates a template warm pool, waits for ready capacity, launches machines with prefer and require, then drains the pool.
Template builds and template warm pools require microVM-runtime/private-beta deployment support.

Python SDK

Runnable source: examples/python/demo_template_warm_pools.py
Use warm_pool_mode="prefer" when cold fallback is acceptable. Use warm_pool_mode="require" when the request should fail with warm_pool_unavailable instead of cold creating.

CLI

Use --json for agent-friendly output:

Track A Tag

Use track_tag when the pool should follow a moving template tag:
When stable moves, the pool records a rollout generation, drains old ready or warming inventory, and fills the new build. Already claimed old-build machines continue as normal machines.

Cleanup