> ## Documentation Index
> Fetch the complete documentation index at: https://docs.together.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a deployment

> Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning.



## OpenAPI

````yaml PATCH /projects/{projectId}/endpoints/{endpointId}/deployments/{id}
openapi: 3.1.0
info:
  title: Together APIs
  description: The Together REST API. See https://docs.together.ai for more details.
  version: 2.0.0
  termsOfService: https://www.together.ai/terms-of-service
  contact:
    name: Together Support
    url: https://www.together.ai/contact
  license:
    name: MIT
    url: https://github.com/togethercomputer/openapi/blob/main/LICENSE
servers:
  - url: https://api.together.ai/v1
    description: Default environment for APIs
  - url: https://api-inference.together.ai/v2
    description: Optimized environment for inference
security:
  - bearerAuth: []
paths:
  /projects/{projectId}/endpoints/{endpointId}/deployments/{id}:
    patch:
      tags:
        - DeploymentService
      summary: Update a deployment
      description: >-
        Updates mutable deployment fields such as its model, configuration,
        autoscaling bounds, or LoRA support. Changes that affect serving may
        trigger asynchronous reprovisioning.
      operationId: DeploymentService_UpdateDeployment
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: updateMask
          in: query
          schema:
            type: string
            description: >-
              Fields to update. If not set, the fields populated on `deployment`
              are updated.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.UpdateDeploymentRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Deployment'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      servers:
        - url: https://api.together.ai/v2
components:
  schemas:
    DE.UpdateDeploymentRequest:
      type: object
      description: >-
        Mutable deployment settings. Use the resource-name fields or their
        deprecated ID alternatives for a model or config change, but not both.
      properties:
        name:
          type: string
          description: Updated inference-addressable deployment name.
        autoscaling:
          allOf:
            - $ref: '#/components/schemas/DE.Autoscaling'
          description: Updated autoscaling configuration.
        etag:
          type: string
          description: >-
            Current deployment version. The update is rejected if this value no
            longer matches.
    DE.Deployment:
      description: >-
        Serving workload that binds a model and immutable config to an endpoint
        and manages its replicas.
      type: object
      required:
        - id
        - projectId
        - endpointId
        - name
        - createdAt
        - updatedAt
        - modelId
        - modelRevisionId
        - model
        - autoscaling
        - configId
        - config
        - etag
        - hardware
        - trafficMode
        - status
      properties:
        id:
          readOnly: true
          type: string
          description: Unique deployment identifier.
        projectId:
          readOnly: true
          type: string
          description: ID of the project that owns the deployment.
        endpointId:
          type: string
          description: ID of the endpoint that contains the deployment.
        name:
          type: string
          description: >-
            Project- and endpoint-qualified deployment name in the form
            `<project_slug>/<endpoint_name>/<deployment_name>`. Pass it as
            `model` in an inference request to target this deployment directly
            instead of using the endpoint's traffic split.
        createdAt:
          readOnly: true
          type: string
          description: Timestamp when the deployment was created.
          format: date-time
        updatedAt:
          readOnly: true
          type: string
          description: Timestamp when the deployment was last updated.
          format: date-time
        modelId:
          type: string
          description: >-
            Deprecated. Use `model`. Model identifier being served, populated
            during migration.
        modelRevisionId:
          type: string
          description: >-
            Deprecated. Use `model` with a /revisions/{revisionId} segment. Pin
            to a specific model revision.
        model:
          type: string
          description: >-
            Pinned model resource in the form
            `projects/{projectId}/models/{modelId}/revisions/{revisionId}`.
        autoscaling:
          allOf:
            - $ref: '#/components/schemas/DE.AutoscalingResponse'
          description: >-
            Replica bounds, timing windows, and metrics that control horizontal
            scaling.
        configId:
          type: string
          description: >-
            Deprecated. Use `config`. Config revision identifier, populated
            during migration.
        config:
          type: string
          description: >-
            Immutable config revision in the form
            `projects/{projectId}/configs/{configRevisionId}`.
        speculatorId:
          readOnly: true
          type: string
          description: >-
            Deprecated. Use `speculator`. Speculative decoding model identifier
            derived from the deployment config.
        speculatorRevisionId:
          readOnly: true
          type: string
          description: >-
            Deprecated. Use `speculator`. ID of the speculative decoding
            draft-model revision pinned at creation time.
        speculator:
          readOnly: true
          type: string
          description: >-
            Pinned draft-model resource used for speculative decoding, in the
            same form as `model`. Omitted when speculative decoding is disabled.
        estimatedEffectiveTrafficShare:
          readOnly: true
          type: number
          format: double
          description: >-
            Estimated fraction in [0, 1] of endpoint traffic that reaches this
            deployment under the current routing configuration. Absent or
            unrouted deployments are 0.
        enableLora:
          type: boolean
          description: Whether the deployment can dynamically load LoRA adapters.
        etag:
          type: string
          description: >-
            Opaque version tag for optimistic concurrency control. Supply on
            update/delete to ensure consistent read-modify-write. If not set,
            the write overwrites based on current state.
        hardware:
          readOnly: true
          type: string
          description: >-
            Hardware selected by the deployment config, including GPU type and
            count.
        trafficMode:
          readOnly: true
          enum:
            - TRAFFIC_MODE_LIVE
            - TRAFFIC_MODE_SHADOW
          type: string
          description: >-
            Whether the deployment serves client-visible responses or only
            mirrored shadow traffic.
        runtimeInfo:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/DE.RuntimeInfo'
          description: >-
            Serving engine and feature support derived from the immutable
            config.
        desiredReplicas:
          readOnly: true
          type: integer
          description: >-
            Number of replicas the autoscaler currently wants across all
            regions.
        status:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/DE.DeploymentStatus'
          description: Current lifecycle state and observed replica counts.
        placement:
          allOf:
            - $ref: '#/components/schemas/DE.Placement'
          description: Region constraints used to schedule the deployment's replicas.
    ErrorData:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              nullable: false
            type:
              type: string
              nullable: false
            param:
              type: string
              nullable: true
              default: null
            code:
              type: string
              nullable: true
              default: null
          required:
            - type
            - message
    DE.Autoscaling:
      type: object
      properties:
        minReplicas:
          type: integer
          description: >-
            Minimum number of replicas. Omit on update to preserve the current
            value. Set both `minReplicas` and `maxReplicas` to `0` to stop the
            deployment.
        maxReplicas:
          type: integer
          description: >-
            Maximum number of replicas. Defaults to `minReplicas`; omitting it
            on update preserves the current value.
        scaleDownWindow:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: >-
            Time a lower replica recommendation must remain stable before
            scaling down. Defaults to `5m`.
        scaleUpWindow:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Stabilization window before scaling up.
        scaleToZeroWindow:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: >-
            Idle period after which the deployment automatically stops and
            releases its replicas.
        scalingMetrics:
          type: array
          items:
            $ref: '#/components/schemas/DE.ScalingMetric'
          description: >-
            Metrics and targets that drive replica recommendations. When
            omitted, the platform uses concurrent in-flight requests per
            replica.
      description: Autoscaling configuration for a deployment.
    DE.AutoscalingResponse:
      description: Resolved autoscaling configuration returned for a deployment.
      allOf:
        - $ref: '#/components/schemas/DE.Autoscaling'
        - type: object
          required:
            - minReplicas
            - maxReplicas
    DE.RuntimeInfo:
      type: object
      properties:
        engineType:
          type: string
          description: Serving engine, such as `vllm`, `trtllm`, or `sglang`.
        engineVersion:
          type: string
          description: Version of the serving engine.
        functionCallingSupported:
          type: boolean
          description: Whether the runtime accepts tool and function-calling requests.
        structuredOutputSupported:
          type: boolean
          description: >-
            Whether the runtime can constrain generation to a structured output
            schema.
      description: Runtime information derived from the deployment's configuration.
    DE.DeploymentStatus:
      type: object
      required:
        - state
        - message
      properties:
        state:
          enum:
            - DEPLOYMENT_STATE_PROVISIONING
            - DEPLOYMENT_STATE_READY
            - DEPLOYMENT_STATE_SCALING
            - DEPLOYMENT_STATE_DEGRADED
            - DEPLOYMENT_STATE_FAILED
            - DEPLOYMENT_STATE_STOPPED
            - DEPLOYMENT_STATE_STOPPING
          type: string
          description: High-level lifecycle state.
        readyReplicas:
          type: integer
          description: Total replicas actively serving traffic across all clusters.
        message:
          type: string
          description: Human-readable explanation of the current state.
        scheduledReplicas:
          type: integer
          description: Replicas the scheduler has placed on clusters.
      description: >-
        Current status of a deployment, derived at read time from internal
        state.
    DE.Placement:
      description: Placement controls where a deployment is scheduled.
      oneOf:
        - type: object
          x-stainless-variantName: Inline
          required:
            - inline
          properties:
            inline:
              description: Inline placement parameters evaluated at deploy time.
              allOf:
                - $ref: '#/components/schemas/DE.InlinePlacement'
        - type: object
          x-stainless-variantName: Profile
          required:
            - profile
          properties:
            profile:
              type: string
              description: UID of a saved placement profile.
    DE.ScalingMetric:
      type: object
      properties:
        name:
          type: string
          description: >-
            Metric name, such as `gpu_utilization`, `ttft`, `inflight_requests`,
            `e2e_latency`, `throughput_per_replica`, or `decoding_speed`.
        type:
          enum:
            - METRIC_TARGET_TYPE_VALUE
            - METRIC_TARGET_TYPE_UTILIZATION
            - METRIC_TARGET_TYPE_AVERAGE_VALUE
          type: string
          description: >-
            Whether `target` is an absolute value, a utilization percentage, or
            a per-replica average.
        target:
          type: number
          description: >-
            Target interpreted according to `type`. Utilization uses a
            percentage from 0 to 100, value uses an absolute measurement, and
            average value uses a per-replica measurement.
        percentile:
          type: string
          description: >-
            Percentile to evaluate for latency-based metrics: `p50`, `p90`,
            `p95`, or `p99`.
      description: Metric and target used by the autoscaler to recommend a replica count.
      required:
        - name
        - type
        - target
    DE.InlinePlacement:
      type: object
      properties:
        regions:
          type: array
          items:
            type: string
          description: >-
            Regions where the deployment is allowed to run. Multiple regions
            allow best-effort replica spreading.
        constraint:
          enum:
            - ENFORCEMENT_REQUIRED
            - ENFORCEMENT_PREFERRED
          type: string
          description: How strictly the regions list is enforced.
      description: >-
        Inline placement parameters expanded into scheduling rules by the
        server.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

````