requirements | ClassVar[list[str] | list[list[str]]] | [] | Pip packages to install in the environment. Supports standard pip syntax including version specifiers. Use a list of strings for a single install step, or a list of lists to install in multiple steps. Example: ["numpy==1.24.0", "torch\>=2.0.0"] or [["setuptools", "wheel"], ["numpy==1.24.0"]] |
requirements_context_dir | ClassVar[Optional[str]] | None | Base directory for resolving local-path requirements such as .[extra] or ../shared[extra]. Defaults to the directory containing the app file. |
local_python_modules | ClassVar[list[str]] | [] | List of local Python module names to include in the deployment. Use for custom code not available on PyPI. Example: ["my_utils", "models"] |
machine_type | ClassVar[str | list[str]] | 'S' | Compute instance type for your application. CPU options: ‘XS’, ‘S’ (default), ‘M’, ‘L’. GPU options: ‘GPU-A6000’, ‘GPU-A100’, ‘GPU-H100’, ‘GPU-H200’, ‘GPU-B200’. Use a string for a single type, or a list to define fallback types (tried in order until one is available). Example: "GPU-A100" or ["GPU-H100", "GPU-A100"] |
num_gpus | ClassVar[int | None] | None | Number of GPUs to allocate. Only applies to GPU machine types. |
regions | ClassVar[Optional[list[str]]] | None | Allowed regions for deployment. None means any region. Example: ["us-east", "eu-west"] |
host_kwargs | ClassVar[dict[str, Any]] | \{'_scheduler': 'nomad', '_scheduler_options': \{'storage_region': 'us-east'\}, 'resolver': 'uv', 'keep_alive': 60\} | Advanced configuration dictionary passed to the host. For internal use. Prefer using class attributes instead. |
app_name | ClassVar[Optional[str]] | None | Custom name for the application. Defaults to class name. |
app_auth | ClassVar[Optional[AuthModeLiteral]] | None | Authentication mode. Options: ‘private’ (API key required), ‘public’ (no auth), ‘shared’ (shareable link). |
app_files | ClassVar[list[str]] | [] | List of files/directories to include in deployment. Example: ["./models", "./config.yaml"] |
app_files_ignore | ClassVar[list[str]] | ['\\.pyc$', '__pycache__/', '\\.git/', '\\.DS_Store$'] | Regex patterns to exclude from deployment. Default excludes .pyc, __pycache__, .git, .DS_Store. |
app_files_context_dir | ClassVar[Optional[str]] | None | Base directory for resolving app_files paths. Defaults to the directory containing the app file. |
request_timeout | ClassVar[Optional[int]] | None | Maximum seconds for a single request. None for default. |
startup_timeout | ClassVar[Optional[int]] | None | Maximum seconds for app startup/setup. None for default. |
metrics_port | ClassVar[Optional[int]] | None | Internal metrics server port for platform scrapes. When omitted, served/exposed deployments default to 9090. |
min_concurrency | ClassVar[Optional[int]] | None | Minimum warm instances to keep running. Set to 1+ to avoid cold starts. Default is 0 (scale to zero). |
max_concurrency | ClassVar[Optional[int]] | None | Maximum instances to scale up to. |
concurrency_buffer | ClassVar[Optional[int]] | None | Additional instances to keep warm above current load. |
concurrency_buffer_perc | ClassVar[Optional[int]] | None | Percentage buffer of instances above current load. |
scaling_delay | ClassVar[Optional[int]] | None | Seconds to wait for a request to be picked up by a runner before triggering a scale up. Useful for apps with slow startup times. |
max_multiplexing | ClassVar[Optional[int]] | None | Maximum concurrent requests per instance. |
kind | ClassVar[Optional[str]] | None | Deployment kind. For internal use. |
image | ClassVar[Optional[ContainerImage]] | None | Custom container image for the application. Use ContainerImage to specify a Dockerfile. |
local_file_path | ClassVar[Optional[str]] | None | - |
skip_retry_conditions | ClassVar[Optional[list[RetryConditionLiteral]]] | None | - |
retry_config | ClassVar[Optional[RetryConfig | RetryConfigDict]] | None | - |
termination_grace_period_seconds | ClassVar[Optional[int]] | None | - |
secrets | ClassVar[Optional[list[str]]] | None | Names of user secrets to expose to the app as environment variables. When omitted, the server applies the default behavior (follows the user’s preferences). Pass an explicit list to opt in to only the secrets listed. Example: ["OPENAI_API_KEY", "HF_TOKEN"] |
data_mounts | ClassVar[Optional[list[str]]] | None | Persistent data mount paths to expose to the application. Use ["/data"] for full access, or specific subdirectories like ["/data/.cache"]. When omitted (None), the server applies a default based on the user model. |
isolate_channel | async_grpc.Channel | None | None | - |