Skip to main content
This feature is in public preview.
A deployment maintains N instances on a pool. A procurement buys and sells spot compute to keep them running. To scale, update the deployment’s target instance count. The procurement adjusts automatically.

Prerequisites

  • SF Compute CLI installed and authenticated (sf login)
  • Credits on your account (sf billing balance)
  • A sense of which hardware you want (sf instance-skus list)

Create a pool

Create an instance template

Define the image and startup script for your inference instances.
startup.sh
See Instance templates for details on cloud-init and image configuration.

Create a deployment

4 instances are created in awaiting_allocation. They start once the pool has compute time.

Create a procurement

node_count as the target tells the procurement to match however many instances exist on the pool. Pass --instance-sku <id> to pin the procurement to specific hardware; see instance SKUs for the catalog.
The procurement sees 4 waiting instances and places buy orders. Within minutes, your instances move to running.

Scale up

4 new instances are created. The procurement buys compute to cover them.

Scale down

Excess instances are removed. The procurement sells unneeded compute.

Handling interruptions

Spot compute is not guaranteed. Instances may shut down if the market price exceeds your buy limit or other buyers place reservations that consume the capacity. Design workloads to handle instances being replaced.
  • Stateless workers. Download model weights on boot. Local disk does not persist between instances.
  • Health check your load balancer. Route traffic only to instances that are ready.
  • Longer --window. A higher value (e.g., 6h) reduces gaps but commits more spend. See Tuning the managed window.

Monitoring

Next steps

  • Adjust --max-buy-price and --min-sell-price to control spend
  • Buy a reserved block of compute into this pool when you need to guarantee availability: