---
title: Deployment
description: The Lightning AI Deployment.
canonical: 'https://lightning.ai/docs/sdk/stable/api/deployment'
---
# Deployment {#deployment}

### `class lightning_sdk.Deployment(name=None, teamspace=None, org=None, user=None)` {#lightning_sdk.Deployment}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

The Lightning AI Deployment.

Allows to fully control a deployment, including retrieving the status, making new release and switching machine types, etc..

Parameters:

*   **name** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The name or the id of the deployment.
    
*   **teamspace** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Teamspace`](/docs/sdk/2026.11.04/api/teamspace.md#lightning_sdk.Teamspace "lightning_sdk.teamspace.Teamspace"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The teamspace in which you want to deploy. Accepts a bare name or an `owner/teamspace` slug.
    
*   **org** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`Organization`](/docs/sdk/2026.11.04/api/organization.md#lightning_sdk.Organization "lightning_sdk.organization.Organization"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The name of the organization owning the :param\`teamspace\` in case it is owned by an org. Deprecated — pass the owner as part of `teamspace` instead, e.g. `teamspace="owner/teamspace"`.
    
*   **user** (`Union`\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`User`](/docs/sdk/2026.11.04/api/user.md#lightning_sdk.User "lightning_sdk.user.User"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The name of the user owning the :param\`teamspace\` in case it is owned directly by a user instead of an org. Deprecated — pass the owner as part of `teamspace` instead, e.g. `teamspace="owner/teamspace"`.
    
*   **name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **teamspace** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Teamspace_](/docs/sdk/2026.11.04/api/teamspace.md#lightning_sdk.Teamspace "lightning_sdk.teamspace.Teamspace") _|_ _None_)
    
*   **org** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Organization_](/docs/sdk/2026.11.04/api/organization.md#lightning_sdk.Organization "lightning_sdk.organization.Organization") _|_ _None_)
    
*   **user** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_User_](/docs/sdk/2026.11.04/api/user.md#lightning_sdk.User "lightning_sdk.user.User") _|_ _None_)
    

Note

Since a teamspace can either be owned by an org or by a user directly, only one of the arguments can be provided.

#### `delete_env(key)` {#lightning_sdk.Deployment.delete_env}

Delete one directly configured literal Deployment environment variable.

Parameters:

*   **key** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Name of the literal environment variable to delete.
    
*   **key** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    

Raises:

[**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If the name is invalid, the Deployment does not exist, or the literal variable is not directly configured.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `delete_secret(env_name)` {#lightning_sdk.Deployment.delete_secret}

Remove a teamspace secret reference from the Deployment.

Parameters:

*   **env\_name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Injected environment variable name of the secret reference to remove.
    
*   **env\_name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    

Raises:

[**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If the name is invalid, the Deployment does not exist, or no secret is injected under that name.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `download_logs(*, job_id=None, timestamps=False)` {#lightning_sdk.Deployment.download_logs}

Download a deployment replica’s stored logs to a file and return the written path.

Return type:

[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

Parameters:

*   **job\_id** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **timestamps** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    

#### `export_request_captures(*, start, end, output_dir, paths=None, include_all_paths=False, status_codes=None, strict=False, request_timeout=60, overwrite=False, remote_path=None)` {#lightning_sdk.Deployment.export_request_captures}

Export captured request telemetry to local artifacts.

The export is always written to `output_dir`. If `remote_path` is provided, the same artifacts are also uploaded to that remote destination. This currently supports `lightning_storage` targets only.

Parameters:

*   **start** (`Union`\[[`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Start of the time range to export captures for.
    
*   **end** (`Union`\[[`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – End of the time range to export captures for.
    
*   **output\_dir** (`Union`\[[`Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Local directory where exported artifacts will be written.
    
*   **paths** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]) – Optional list of request paths to filter exports by.
    
*   **include\_all\_paths** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – If `True`, export captures for all request paths.
    
*   **status\_codes** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]\]) – Optional list of HTTP status codes to filter exports by.
    
*   **strict** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – If `True`, raise an error on any export failure instead of skipping.
    
*   **request\_timeout** (`Union`\[[`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)"), [`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple "(in Python v3.15)")\]) – Timeout in seconds (or `(connect, read)` tuple) for each request.
    
*   **overwrite** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – If `True`, overwrite existing files in `output_dir`.
    
*   **remote\_path** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Optional remote destination path for uploading exported artifacts.
    
*   **start** ([_datetime_](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.15)") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **end** ([_datetime_](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.15)") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **output\_dir** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **paths** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **include\_all\_paths** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    
*   **status\_codes** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **strict** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    
*   **request\_timeout** ([_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") _|_ [_tuple_](https://docs.python.org/3/builtins/stdtypes.html#tuple "(in Python v3.15)"))
    
*   **overwrite** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    
*   **remote\_path** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    

Returns:

Summary of the export operation.

Return type:

[RequestCaptureExportResult](#lightning_sdk.api.deployment_api.RequestCaptureExportResult "lightning_sdk.api.deployment_api.RequestCaptureExportResult")

Raises:

[**RuntimeError**](https://docs.python.org/3/builtins/exceptions.html#RuntimeError "(in Python v3.15)") – If the deployment has not been created yet.

#### `set_env(new_env, partial=True)` {#lightning_sdk.Deployment.set_env}

Set directly configured literal Deployment environment variables.

Parameters:

*   **new\_env** ([`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Literal environment variable names and values.
    
*   **partial** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")) – Preserve unrelated literal variables when `True`. Secret references are preserved unless shadowed by a new literal in either mode.
    
*   **new\_env** ([_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_)
    
*   **partial** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)"))
    

Raises:

[**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If a name is invalid or the Deployment does not exist.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `set_secret(secret_name, env_name=None)` {#lightning_sdk.Deployment.set_secret}

Reference a teamspace secret as a Deployment environment variable.

Parameters:

*   **secret\_name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Name of the teamspace secret to inject.
    
*   **env\_name** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Environment variable name to inject the secret under. Defaults to the secret name.
    
*   **secret\_name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **env\_name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    

Raises:

[**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If a name is invalid or the Deployment does not exist.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `start(studio=None, cloud=None, machine=None, image=None, autoscale=None, ports=None, release_strategy=None, entrypoint=None, command=None, commands=None, env=None, spot=None, replicas=None, health_check=None, auth=None, custom_domain=None, cloudspace_id=None, quantity=None, include_credentials=None, from_onboarding=None, from_litserve=None, max_runtime=None, path_mappings=None, model=None, hf_token_secret=None, base_image_variant=None, tensor_parallel_size=None, max_model_len=None, gpu_memory_utilization=None, quantization=None, dtype=None, extra_vllm_args=None, enable_weight_reload=None, acknowledged_warnings=None)` {#lightning_sdk.Deployment.start}

The Lightning AI Deployment.

This method creates the first release of the deployment. If the deployment already exists, it sets the deployment to the running state.

Parameters:

*   **name** – The name of the deployment.
    
*   **cloud** (`Union`\[[`CloudProvider`](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.CloudProvider "lightning_sdk.machine.CloudProvider"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – Cloud provider or cloud account to run replicas on.
    
*   **machine** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Machine`](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.Machine "lightning_sdk.machine.Machine")\]) – The machine used by the deployment replicas.
    
*   **autoscale** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`AutoScaleConfig`](#lightning_sdk.api.deployment_api.AutoScaleConfig "lightning_sdk.api.deployment_api.AutoScaleConfig")\]) – The list of the metrics to autoscale on.
    
*   **ports** (`Union`\[[`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)"), [`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")\], [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The ports to reach your replica services.
    
*   **image** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The environement used by the deployment. Currentely, only docker images.
    
*   **release\_strategy** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`ReleaseStrategy`](#lightning_sdk.api.deployment_api.ReleaseStrategy "lightning_sdk.api.deployment_api.ReleaseStrategy")\]) – The release strategy to use when changing core deployment specs.
    
*   **entrypoint** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The docker container entrypoint.
    
*   **command** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The docker container command.
    
*   **env** (`Union`\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[`Union`\[[`Env`](#lightning_sdk.api.deployment_api.Env "lightning_sdk.api.deployment_api.Env"), [`Secret`](#lightning_sdk.api.deployment_api.Secret "lightning_sdk.api.deployment_api.Secret")\]\], [`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\], [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The environment variables or secrets to use.
    
*   **spot** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")\]) – Whether to use spot instances for the replicas.
    
*   **replicas** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – The number of replicas to deploy with.
    
*   **health\_check** (`Union`\[[`HttpHealthCheck`](#lightning_sdk.api.deployment_api.HttpHealthCheck "lightning_sdk.api.deployment_api.HttpHealthCheck"), [`ExecHealthCheck`](#lightning_sdk.api.deployment_api.ExecHealthCheck "lightning_sdk.api.deployment_api.ExecHealthCheck"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The health check config to know whether your service is ready to receive traffic.
    
*   **auth** (`Union`\[[`BasicAuth`](#lightning_sdk.api.deployment_api.BasicAuth "lightning_sdk.api.deployment_api.BasicAuth"), [`TokenAuth`](#lightning_sdk.api.deployment_api.TokenAuth "lightning_sdk.api.deployment_api.TokenAuth"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – The auth config to protect your services. Only Basic and Token supported.
    
*   **custom\_domain** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Whether your service would be referenced under a custom domain.
    
*   **cloudspace\_id** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Connect deployment to a Studio.
    
*   **quantity** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – The number of machines per replica to deploy.
    
*   **include\_credentials** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")\]) – Whether to include the environment variables for the SDK to authenticate
    
*   **from\_onboarding** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")\]) – Whether the deployment is from onboarding.
    
*   **max\_runtime** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – the duration (in seconds) for which to allocate the machine. Irrelevant for most machines, required for some of the top-end machines on GCP. If in doubt, set it. Won’t have an effect on machines not requiring it. Defaults to 3h
    
*   **path\_mappings** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]) – Maps container paths to data-connection paths in the form `{"<CONTAINER_PATH>": "<CONNECTION_NAME>:<PATH>"}` or `{"<CONTAINER_PATH>": "<CONNECTION_NAME>"}` for the root of a connection. Only applicable when deploying docker containers.
    
*   **studio** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ [_Studio_](/docs/sdk/2026.11.04/api/studio.md#lightning_sdk.Studio "lightning_sdk.studio.Studio") _|_ _None_)
    
*   **cloud** ([_CloudProvider_](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.CloudProvider "lightning_sdk.machine.CloudProvider") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **machine** ([_Machine_](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.Machine "lightning_sdk.machine.Machine") _|_ _None_)
    
*   **image** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **autoscale** ([_AutoScaleConfig_](#lightning_sdk.api.deployment_api.AutoScaleConfig "lightning_sdk.api.deployment_api.AutoScaleConfig") _|_ _None_)
    
*   **ports** ([_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") _|_ [_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **release\_strategy** ([_ReleaseStrategy_](#lightning_sdk.api.deployment_api.ReleaseStrategy "lightning_sdk.api.deployment_api.ReleaseStrategy") _|_ _None_)
    
*   **entrypoint** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **command** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **commands** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **env** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_Env_](#lightning_sdk.api.deployment_api.Env "lightning_sdk.api.deployment_api.Env") _|_ [_Secret_](#lightning_sdk.api.deployment_api.Secret "lightning_sdk.api.deployment_api.Secret")_\]_ _|_ [_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **spot** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") _|_ _None_)
    
*   **replicas** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **health\_check** ([_HttpHealthCheck_](#lightning_sdk.api.deployment_api.HttpHealthCheck "lightning_sdk.api.deployment_api.HttpHealthCheck") _|_ [_ExecHealthCheck_](#lightning_sdk.api.deployment_api.ExecHealthCheck "lightning_sdk.api.deployment_api.ExecHealthCheck") _|_ _None_)
    
*   **auth** ([_BasicAuth_](#lightning_sdk.api.deployment_api.BasicAuth "lightning_sdk.api.deployment_api.BasicAuth") _|_ [_TokenAuth_](#lightning_sdk.api.deployment_api.TokenAuth "lightning_sdk.api.deployment_api.TokenAuth") _|_ _None_)
    
*   **custom\_domain** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **cloudspace\_id** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **quantity** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **include\_credentials** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") _|_ _None_)
    
*   **from\_onboarding** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") _|_ _None_)
    
*   **from\_litserve** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") _|_ _None_)
    
*   **max\_runtime** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **path\_mappings** ([_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **model** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **hf\_token\_secret** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **base\_image\_variant** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **tensor\_parallel\_size** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **max\_model\_len** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **gpu\_memory\_utilization** ([_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") _|_ _None_)
    
*   **quantization** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **dtype** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **extra\_vllm\_args** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **enable\_weight\_reload** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") _|_ _None_)
    
*   **acknowledged\_warnings** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `stop()` {#lightning_sdk.Deployment.stop}

All the deployment replicas will be stopped and all their traffic blocked.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `update(machine=None, cloud=None, image=None, entrypoint=None, command=None, commands=None, env=None, spot=None, health_check=None, min_replicas=None, max_replicas=None, name=None, ports=None, release_strategy=None, replicas=None, auth=None, custom_domain=None, quantity=None, include_credentials=None, max_runtime=None, path_mappings=None)` {#lightning_sdk.Deployment.update}

Update the deployment configuration.

Changes to `machine`, `image`, `entrypoint`, `command`/`commands`, `env`, `spot`, `cloud`, or `health_check` create a new release. All other arguments (replica counts, ports, auth, etc.) are applied in-place without a new release.

Parameters:

*   **machine** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Machine`](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.Machine "lightning_sdk.machine.Machine")\]) – New machine type for the replicas.
    
*   **cloud** (`Union`\[[`CloudProvider`](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.CloudProvider "lightning_sdk.machine.CloudProvider"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – Cloud provider or cloud account to run replicas on.
    
*   **image** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – New docker image for the replicas.
    
*   **entrypoint** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – New container entrypoint.
    
*   **command** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – New container command string.
    
*   **commands** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]) – List of command strings, joined into a single command. Mutually exclusive with `command`.
    
*   **env** (`Union`\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[`Union`\[[`Env`](#lightning_sdk.api.deployment_api.Env "lightning_sdk.api.deployment_api.Env"), [`Secret`](#lightning_sdk.api.deployment_api.Secret "lightning_sdk.api.deployment_api.Secret")\]\], [`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\], [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – Environment variables or secrets to inject into replicas.
    
*   **spot** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")\]) – Whether to use spot/interruptible instances.
    
*   **health\_check** (`Union`\[[`HttpHealthCheck`](#lightning_sdk.api.deployment_api.HttpHealthCheck "lightning_sdk.api.deployment_api.HttpHealthCheck"), [`ExecHealthCheck`](#lightning_sdk.api.deployment_api.ExecHealthCheck "lightning_sdk.api.deployment_api.ExecHealthCheck"), [`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")\]) – Readiness probe configuration.
    
*   **min\_replicas** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – New minimum replica count for autoscaling.
    
*   **max\_replicas** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – New maximum replica count for autoscaling.
    
*   **name** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – New display name for the deployment.
    
*   **ports** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")\]\]) – Exposed port numbers.
    
*   **release\_strategy** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`ReleaseStrategy`](#lightning_sdk.api.deployment_api.ReleaseStrategy "lightning_sdk.api.deployment_api.ReleaseStrategy")\]) – How to roll out the new release (e.g. blue/green).
    
*   **replicas** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – Fixed number of replicas (overrides autoscaling).
    
*   **auth** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[`Auth`\]) – Authentication configuration for the deployment endpoint.
    
*   **custom\_domain** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Custom domain to attach to the deployment.
    
*   **quantity** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – Number of machines per replica.
    
*   **include\_credentials** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")\]) – Whether to inject SDK authentication env vars.
    
*   **max\_runtime** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – Maximum machine allocation duration in seconds.
    
*   **path\_mappings** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"), [`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]) – Container-path → data-connection-path mappings for docker jobs.
    
*   **machine** ([_Machine_](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.Machine "lightning_sdk.machine.Machine") _|_ _None_)
    
*   **cloud** ([_CloudProvider_](/docs/sdk/2026.11.04/api/machine.md#lightning_sdk.CloudProvider "lightning_sdk.machine.CloudProvider") _|_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **image** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **entrypoint** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **command** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **commands** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **env** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_Env_](#lightning_sdk.api.deployment_api.Env "lightning_sdk.api.deployment_api.Env") _|_ [_Secret_](#lightning_sdk.api.deployment_api.Secret "lightning_sdk.api.deployment_api.Secret")_\]_ _|_ [_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **spot** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") _|_ _None_)
    
*   **health\_check** ([_HttpHealthCheck_](#lightning_sdk.api.deployment_api.HttpHealthCheck "lightning_sdk.api.deployment_api.HttpHealthCheck") _|_ [_ExecHealthCheck_](#lightning_sdk.api.deployment_api.ExecHealthCheck "lightning_sdk.api.deployment_api.ExecHealthCheck") _|_ _None_)
    
*   **min\_replicas** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **max\_replicas** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **ports** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")_\]_ _|_ _None_)
    
*   **release\_strategy** ([_ReleaseStrategy_](#lightning_sdk.api.deployment_api.ReleaseStrategy "lightning_sdk.api.deployment_api.ReleaseStrategy") _|_ _None_)
    
*   **replicas** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **auth** (_Auth_ _|_ _None_)
    
*   **custom\_domain** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **quantity** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **include\_credentials** ([_bool_](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)") _|_ _None_)
    
*   **max\_runtime** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **path\_mappings** ([_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)
    

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `property auth: Auth | None` {#lightning_sdk.Deployment.auth}

The authentification configuration of the deployment.

Returns:

The authentication configuration, or `None` if not started.

Return type:

Optional\[Auth\]

#### `property autoscale: AutoScaleConfig | None` {#lightning_sdk.Deployment.autoscale}

The autoscaling configuration of the deployment.

Returns:

The autoscaling configuration, or `None` if not started.

Return type:

Optional\[[AutoScaleConfig](#lightning_sdk.api.deployment_api.AutoScaleConfig "lightning_sdk.api.deployment_api.AutoScaleConfig")\]

#### `property cloud_account: str | None` {#lightning_sdk.Deployment.cloud_account}

The cloud\_account of the replicas.

#### `property deleting_replicas: int | None` {#lightning_sdk.Deployment.deleting_replicas}

The number of deleting replicas.

#### `property env: List[Env | Secret] | None` {#lightning_sdk.Deployment.env}

The env configuration of the deployment.

Returns:

The environment variables and secrets, or `None` if not started.

Return type:

Optional\[List\[Union\[[Secret](#lightning_sdk.api.deployment_api.Secret "lightning_sdk.api.deployment_api.Secret"), [Env](#lightning_sdk.api.deployment_api.Env "lightning_sdk.api.deployment_api.Env")\]\]\]

#### `property failing_replicas: int | None` {#lightning_sdk.Deployment.failing_replicas}

The number of failing replicas.

#### `property health_check: HttpHealthCheck | ExecHealthCheck | None` {#lightning_sdk.Deployment.health_check}

The health check to validate the replicas are ready to receive traffic.

Returns:

The readiness probe configuration, or `None` if not started.

Return type:

Optional\[Union\[[HttpHealthCheck](#lightning_sdk.api.deployment_api.HttpHealthCheck "lightning_sdk.api.deployment_api.HttpHealthCheck"), [ExecHealthCheck](#lightning_sdk.api.deployment_api.ExecHealthCheck "lightning_sdk.api.deployment_api.ExecHealthCheck")\]\]

#### `property id: str | None` {#lightning_sdk.Deployment.id}

The deployment’s unique identifier, or None before it is created.

#### `property include_credentials: bool | None` {#lightning_sdk.Deployment.include_credentials}

The number of machines per replica.

#### `property max_replicas: int | None` {#lightning_sdk.Deployment.max_replicas}

The maximum number of replicas.

Returns:

The autoscaling maximum replica count, or `None` if not started.

Return type:

Optional\[[int](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]

#### `property min_replicas: int | None` {#lightning_sdk.Deployment.min_replicas}

The minimum number of replicas.

Returns:

The autoscaling minimum replica count, or `None` if not started.

Return type:

Optional\[[int](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]

#### `property pending_replicas: int | None` {#lightning_sdk.Deployment.pending_replicas}

The number of pending replicas.

Returns:

The count of replicas currently pending, or `None` if not started.

Return type:

Optional\[[int](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]

#### `property ports: List[int] | None` {#lightning_sdk.Deployment.ports}

The exposed ports on which you can reach your deployment.

Returns:

List of exposed port numbers, or `None` if not started.

Return type:

Optional\[List\[[int](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]\]

#### `property quantity: str | None` {#lightning_sdk.Deployment.quantity}

The number of machines per replica.

#### `property release_id: str | None` {#lightning_sdk.Deployment.release_id}

The release id of the deployment.

#### `property release_strategy: ReleaseStrategy | None` {#lightning_sdk.Deployment.release_strategy}

The release strategy of the deployment.

Returns:

The current release strategy, or `None` if not started.

Return type:

Optional\[[ReleaseStrategy](#lightning_sdk.api.deployment_api.ReleaseStrategy "lightning_sdk.api.deployment_api.ReleaseStrategy")\]

#### `property replicas: int | None` {#lightning_sdk.Deployment.replicas}

The default number of replicas the release starts with.

Returns:

The replica count, or `None` if the deployment has not been started.

Return type:

Optional\[[int](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]

#### `property running_replicas: int | None` {#lightning_sdk.Deployment.running_replicas}

The number of failing replicas.

Returns:

The count of replicas currently running and ready, or `None` if not started.

Return type:

Optional\[[int](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]

#### `property teamspace: Teamspace` {#lightning_sdk.Deployment.teamspace}

The teamspace of the deployment.

#### `property urls: List[str] | None` {#lightning_sdk.Deployment.urls}

The urls to reach the deployment.

Returns:

The list of URLs for the deployment, or `None` if not started.

Return type:

Optional\[List\[[str](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]\]

#### `property user: User | None` {#lightning_sdk.Deployment.user}

The user of the deployment.

### `class lightning_sdk.api.deployment_api.Env(name, value)` {#lightning_sdk.api.deployment_api.Env}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

The Env describes an environnement variable.

Parameters:

*   **name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **value** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    

#### `property env_var_name: str` {#lightning_sdk.api.deployment_api.Env.env_var_name}

The container environment variable name this entry occupies.

### `class lightning_sdk.api.deployment_api.Secret(name, env_name=None)` {#lightning_sdk.api.deployment_api.Secret}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

The Secret describes a protected environnement variable.

Parameters:

*   **name** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – Name of the Lightning secret to read the value from.
    
*   **env\_name** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – Environment variable name to inject the secret under. Defaults to `name`.
    
*   **name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **env\_name** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    

#### `property env_var_name: str` {#lightning_sdk.api.deployment_api.Secret.env_var_name}

The container environment variable name this entry occupies.

### `class lightning_sdk.api.deployment_api.BasicAuth(username, password)` {#lightning_sdk.api.deployment_api.BasicAuth}

Bases: `Auth`

The BasicAuth describes the basic auth mechanism where a username and password are required to authenticate.

Parameters:

*   **username** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **password** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))

### `class lightning_sdk.api.deployment_api.TokenAuth(token)` {#lightning_sdk.api.deployment_api.TokenAuth}

Bases: `Auth`

The TokenAuth describes the token auth mechanism where a token is required to authenticate.

Parameters:

**token** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))

### `class lightning_sdk.api.deployment_api.ReleaseStrategy` {#lightning_sdk.api.deployment_api.ReleaseStrategy}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

The base class for release strategy.

### `class lightning_sdk.api.deployment_api.RollingUpdateReleaseStrategy(max_surge=1, max_unavailable=0)` {#lightning_sdk.api.deployment_api.RollingUpdateReleaseStrategy}

Bases: [`ReleaseStrategy`](#lightning_sdk.api.deployment_api.ReleaseStrategy "lightning_sdk.api.deployment_api.ReleaseStrategy")

The RollingUpdateReleaseStrategy describes the rolling update strategy.

Parameters:

*   **max\_surge** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The max\_surge argument controls the maximum number of additional replicas that can be created during a rolling update. It specifies the number above the desired replica count that can be temporarily created. During an update, Lightning creates new replicas to replace the old ones, and the max\_surge argument ensures that the total number of pods does not exceed a certain limit.
    
*   **max\_unavailable** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The max\_unavailable argument determines the maximum number of replicas that can be unavailable during a rolling update. It specifies the maximum number that can be simultaneously removed from service during the update progresses. By default, Lightning terminates one replica at a time while creating new replicas, ensuring that the desired replica count is maintained.
    
*   **max\_surge** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **max\_unavailable** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))

### `class lightning_sdk.api.deployment_api.HealthCheck` {#lightning_sdk.api.deployment_api.HealthCheck}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

### `class lightning_sdk.api.deployment_api.ExecHealthCheck(command, initial_delay_seconds=0, failure_threshold=3600, interval_seconds=1, timeout_seconds=30)` {#lightning_sdk.api.deployment_api.ExecHealthCheck}

Bases: [`HealthCheck`](#lightning_sdk.api.deployment_api.HealthCheck "lightning_sdk.api.deployment_api.HealthCheck")

The ExecHealthCheck determines whether your service is ready using exec command in the container.

Parameters:

*   **command** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – The command to be executed within your container to decide whether the service is ready.
    
*   **timeout\_seconds** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The total number of time to wait before declaring the service as unhealthy.
    
*   **initial\_delay\_seconds** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The amount of time to wait before starting to execute the command.
    
*   **failure\_threshold** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The total number of retries to do befor declaring the service as unhealthy.
    
*   **interval\_seconds** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The amount of time between retries.
    
*   **command** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **initial\_delay\_seconds** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **failure\_threshold** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **interval\_seconds** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **timeout\_seconds** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))

### `class lightning_sdk.api.deployment_api.HttpHealthCheck(path, port, initial_delay_seconds=0, failure_threshold=3600, interval_seconds=1, timeout_seconds=30)` {#lightning_sdk.api.deployment_api.HttpHealthCheck}

Bases: [`HealthCheck`](#lightning_sdk.api.deployment_api.HealthCheck "lightning_sdk.api.deployment_api.HealthCheck")

The HttpHealthCheck determines whether your service is ready using http request.

Parameters:

*   **path** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")) – The server path to hit to check whether the server is healthy
    
*   **port** ([`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")) – The server port to hit to check whether the server is healthy
    
*   **timeout\_seconds** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The total number of time to wait before declaring the service as unhealthy.
    
*   **initial\_delay\_seconds** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The amount of time to wait before starting to execute the command.
    
*   **failure\_threshold** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The total number of retries to do befor declaring the service as unhealthy.
    
*   **interval\_seconds** ([`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")) – The amount of time between retries.
    
*   **path** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)"))
    
*   **port** ([_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)"))
    
*   **initial\_delay\_seconds** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **failure\_threshold** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **interval\_seconds** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **timeout\_seconds** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))

### `class lightning_sdk.api.deployment_api.AutoScalingMetric(name, target)` {#lightning_sdk.api.deployment_api.AutoScalingMetric}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

The AutoScalingMetric determines the metric used to decide whether we should autoscale.

Parameters:

*   **name** ([`Literal`](https://docs.python.org/3/library/typing.html#typing.Literal "(in Python v3.15)")\[`'GPU'`, `'CPU'`, `'RPM'`\]) – The name of the metric used to decide whether we should autoscale.
    
*   **target** ([`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")) – The metric threshold to decide whether we should autoscale.
    
*   **name** ([_Literal_](https://docs.python.org/3/library/typing.html#typing.Literal "(in Python v3.15)")_\[__'GPU'__,_ _'CPU'__,_ _'RPM'__\]_)
    
*   **target** ([_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)"))

### `class lightning_sdk.api.deployment_api.AutoScaleConfig(min_replicas=None, max_replicas=None, metric=None, threshold=None, target_metrics=None, idle_threshold_seconds=None, scale_down_cooldown_seconds=None, scale_up_cooldown_seconds=None)` {#lightning_sdk.api.deployment_api.AutoScaleConfig}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

The AutoScaleConfig determines how to autoscale your deployment.

Parameters:

*   **min\_replicas** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – The minimum number of replicas. When set to 0, the replicas will stop when there is no traffic left.
    
*   **max\_replicas** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")\]) – The maximum number of replicas.
    
*   **metric** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`Literal`](https://docs.python.org/3/library/typing.html#typing.Literal "(in Python v3.15)")\[`'GPU'`, `'CPU'`, `'RPM'`\]\]) – The metric used to decide whether we should autoscale.
    
*   **threshold** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`float`](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)")\]) – The metric threshold to decide whether we should autoscale.
    
*   **target\_metrics** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`List`](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")\[[`AutoScalingMetric`](#lightning_sdk.api.deployment_api.AutoScalingMetric "lightning_sdk.api.deployment_api.AutoScalingMetric")\]\]) – Multiple target metrics to autoscale the deployment.
    
*   **idle\_threshold\_seconds** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional "(in Python v3.15)")\[[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")\]) – The amount of time to wait before stopping a replica after the latest seen request.
    
*   **min\_replicas** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **max\_replicas** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)") _|_ _None_)
    
*   **metric** ([_Literal_](https://docs.python.org/3/library/typing.html#typing.Literal "(in Python v3.15)")_\[__'GPU'__,_ _'CPU'__,_ _'RPM'__\]_ _|_ _None_)
    
*   **threshold** ([_float_](https://docs.python.org/3/builtins/functions.html#float "(in Python v3.15)") _|_ _None_)
    
*   **target\_metrics** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.15)")_\[_[_AutoScalingMetric_](#lightning_sdk.api.deployment_api.AutoScalingMetric "lightning_sdk.api.deployment_api.AutoScalingMetric")_\]_ _|_ _None_)
    
*   **idle\_threshold\_seconds** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **scale\_down\_cooldown\_seconds** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)
    
*   **scale\_up\_cooldown\_seconds** ([_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") _|_ _None_)

### `class lightning_sdk.api.deployment_api.RequestCaptureExportResult(output_dir, manifest_path, csv_path, jsonl_path, row_count, captured_count, uncaptured_count, missing_content_count, content_error_count, uploaded_artifacts=None)` {#lightning_sdk.api.deployment_api.RequestCaptureExportResult}

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#object "(in Python v3.15)")

Parameters:

*   **output\_dir** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)"))
    
*   **manifest\_path** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)"))
    
*   **csv\_path** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)"))
    
*   **jsonl\_path** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.15)"))
    
*   **row\_count** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **captured\_count** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **uncaptured\_count** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **missing\_content\_count** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **content\_error\_count** ([_int_](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)"))
    
*   **uploaded\_artifacts** ([_Dict_](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.15)")_\[_[_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_,_ [_str_](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")_\]_ _|_ _None_)

---

**Navigation**

- Parent: [API Reference](/docs/sdk/2026.11.04/api.md)
