Skip to main content
A deployment’s configuration covers everything needed to run your code on remote GPU workers: the Docker image, installed packages, hardware requirements, environment variables, startup scripts, and autoscaling behavior.

The Deployment Object

Image Configuration

app.image() returns an Image object for configuring the Docker image, packages, and hardware requirements. All methods return self for chaining.

Installing Packages

Environment Variables

Startup Scripts and Commands

Copying Local Files

Files added with .copy() are bundled into the deployment tarball and placed at the specified destination path on workers.

Python Environment

By default, the SDK manages its own virtual environment on workers. You can override this:

Publishing Additional Ports

Image Methods Reference

GPU and Hardware Requirements

Hardware requirements are specified using the query builder from vastai.data.query. Pass Query objects to image.require():

Query Operators

Queryable Columns

GPU: gpu_name, gpu_ram, gpu_total_ram, gpu_max_power, gpu_max_temp, gpu_arch, gpu_mem_bw, gpu_lanes, gpu_frac, gpu_display_active, num_gpus, compute_cap, cuda_max_good, bw_nvlink, total_flops CPU: cpu_name, cpu_cores, cpu_cores_effective, cpu_ghz, cpu_ram, cpu_arch Storage & Disk: disk_space, disk_bw, disk_name, allocated_storage Network: inet_up, inet_down, inet_up_cost, inet_down_cost, direct_port_count, pcie_bw, pci_gen Pricing: dph_base, dph_total, storage_cost, storage_total_cost, vram_costperhour, min_bid, credit_discount_max, flops_per_dphtotal, dlperf_per_dphtotal Machine & Host: host_id, machine_id, hostname, public_ipaddr, reliability, expected_reliability, os_version, driver_vers, mobo_name, has_avx, static_ip, external, verification, hosting_type, vms_enabled, resource_type, cluster_id Virtual Columns (convenience aliases resolved by the API): geolocation, datacenter, duration, verified, allocated_storage, target_reliability

GPU Name Constants

Import GPU name constants from vastai.data.query. A selection of commonly used ones: NVIDIA Data Center: A100_PCIE, A100_SXM4, H100_PCIE, H100_SXM, H100_NVL, H200, H200_NVL, B200, GH200_SXM, L4, L40, L40S, A10, A30, A40, Tesla_T4, Tesla_V100 NVIDIA Consumer: RTX_5090, RTX_5080, RTX_5070_Ti, RTX_5070, RTX_4090, RTX_4080S, RTX_4080, RTX_4070_Ti, RTX_4070S, RTX_3090, RTX_3090_Ti, RTX_3080_Ti, RTX_3080 NVIDIA Professional: RTX_A6000, RTX_6000Ada, RTX_5880Ada, RTX_5000Ada, RTX_PRO_6000 AMD: InstinctMI250X, InstinctMI210, InstinctMI100, RX_7900_XTX, PRO_W7900, PRO_W7800

Autoscaling Configuration

These parameters control how your deployment scales workers up and down in response to load. For a detailed explanation of how each parameter affects scaling behavior, see Serverless Parameters.
All parameters are optional. You can call configure_autoscaling() multiple times, later calls update (not replace) previously set values.

Deploying with ensure_ready()

After defining your remote functions, image configuration, and autoscaling settings, call ensure_ready() to deploy:
This is a synchronous, blocking call that:
  1. Packages your deployment code and configuration into a tarball
  2. Computes a content hash to determine if anything has changed
  3. Registers the deployment with the Vast API
  4. Uploads the tarball to cloud storage (if the code has changed)
  5. Triggers the appropriate update tier if workers are already running
You must call ensure_ready() before invoking any @remote functions.