> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://nemo-platform.docs.buildwithfern.com/nemo/platform/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://nemo-platform.docs.buildwithfern.com/nemo/platform/_mcp/server.

# Update ModelDeployment

POST https://host.com/apis/models/v2/workspaces/{workspace}/deployments/{name}
Content-Type: application/json

Update a ModelDeployment (creates a new immutable version).

Reference: https://nemo-platform.docs.buildwithfern.com/nemo/platform/nemo/platform/documentation/reference/api-reference/model-deployments/update-deployment-apis-models-v-2-workspaces-workspace-deployments-name-post

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/models/v2/workspaces/{workspace}/deployments/{name}:
    post:
      operationId: >-
        update-deployment-apis-models-v-2-workspaces-workspace-deployments-name-post
      summary: Update ModelDeployment
      description: Update a ModelDeployment (creates a new immutable version).
      tags:
        - subpackage_modelDeployments
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
        - name: name
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Update a model deployment (creates new version)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelDeployment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateModelDeploymentRequest'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    UpdateModelDeploymentRequest:
      type: object
      properties:
        config:
          type: string
          description: Reference to the ModelDeploymentConfig name
        config_version:
          type: integer
          description: >-
            Reference to a specific ModelDeploymentConfig version. If not
            specified, uses latest.
      required:
        - config
      description: Request model for updating a ModelDeployment (creates new version).
      title: UpdateModelDeploymentRequest
    ModelDeploymentStatus:
      type: string
      enum:
        - UNKNOWN
        - CREATED
        - PENDING
        - READY
        - ERROR
        - DELETING
        - DELETED
        - LOST
      description: Status enum for ModelDeployment objects.
      title: ModelDeploymentStatus
    ModelDeploymentStatusHistoryItem:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: When this status was recorded
        status:
          $ref: '#/components/schemas/ModelDeploymentStatus'
          description: The status at this point in time
        status_message:
          type: string
          default: ''
          description: Status message
      required:
        - timestamp
        - status
      description: Record of a status change in ModelDeployment history.
      title: ModelDeploymentStatusHistoryItem
    AuthContext:
      type: object
      properties:
        principal_id:
          type: string
          description: The principal's unique identifier
        principal_email:
          type: string
          description: The principal's email address
        principal_groups:
          type: array
          items:
            type: string
          description: Groups the principal belongs to
        principal_on_behalf_of:
          type: string
          description: If acting on behalf of another principal, their principal ID
        principal_on_behalf_of_groups:
          type: array
          items:
            type: string
          description: Groups the on-behalf-of principal belongs to
        principal_on_behalf_of_email:
          type: string
          description: The on-behalf-of principal's email address
      required:
        - principal_id
      description: >-
        Auth context captured at resource creation for delegated access.


        Stores a snapshot of the creating principal's identity so that
        controllers

        can later act on their behalf (e.g., accessing secrets).
      title: AuthContext
    ModelDeployment:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the deployment
        name:
          type: string
          description: >-
            Name of the entity. Name/workspace combo must be unique across all
            entities. Allowed characters: letters (a-z, A-Z), digits (0-9),
            underscores, hyphens, and dots.
        workspace:
          type: string
          description: >-
            The workspace of the entity. Allowed characters: letters (a-z, A-Z),
            digits (0-9), underscores, hyphens, and dots.
        project:
          type: string
          description: The URN of the project associated with this entity.
        created_at:
          type: string
          format: date-time
          description: The timestamp of model entity creation
        updated_at:
          type: string
          format: date-time
          description: The timestamp of the last model entity update
        entity_version:
          type: integer
          description: Version of this deployment. Automatically managed.
        config:
          type: string
          description: Reference to the ModelDeploymentConfig name
        config_version:
          type: integer
          description: Reference to the specific ModelDeploymentConfig version
        status:
          $ref: '#/components/schemas/ModelDeploymentStatus'
          default: UNKNOWN
          description: Current status of the deployment, populated by models controller
        status_message:
          type: string
          default: ''
          description: Detailed status message, populated by models controller
        status_history:
          type: array
          items:
            $ref: '#/components/schemas/ModelDeploymentStatusHistoryItem'
          description: History of status changes, ordered chronologically (oldest first)
        model_provider_id:
          type: string
          description: >-
            Optional reference to the auto-created ModelProvider workspace/name
            (format: workspace/name)
        auth_context:
          $ref: '#/components/schemas/AuthContext'
          description: 'Auth context captured at deployment creation. '
      required:
        - name
        - workspace
        - created_at
        - updated_at
        - entity_version
        - config
        - config_version
      description: >-
        ModelDeployment represents a deployed instance of a model with a
        specific configuration.

        These objects are immutable with automatic versioning, except for status
        updates.


        The unique identifier is the combination of
        workspace/name/entity_version.
      title: ModelDeployment
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          type: object
          additionalProperties:
            description: Any type
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError

```

## Examples



**Request**

```json
{
  "config": "llama-config-v2"
}
```

**Response**

```json
{
  "name": "llama-3.1-8b",
  "workspace": "research-team-alpha",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-04-20T14:45:00Z",
  "entity_version": 3,
  "config": "llama-config-v2",
  "config_version": 2,
  "id": "d4f1a2b3-c567-4e89-9f12-3456789abcde",
  "project": "proj-llama-2024",
  "status": "READY",
  "status_message": "Deployment is active and serving requests.",
  "status_history": [
    {
      "timestamp": "2024-01-15T09:30:00Z",
      "status": "CREATED",
      "status_message": "Deployment created."
    },
    {
      "timestamp": "2024-01-20T10:00:00Z",
      "status": "PENDING",
      "status_message": "Deployment is pending initialization."
    },
    {
      "timestamp": "2024-04-20T14:45:00Z",
      "status": "READY",
      "status_message": "Deployment is active and serving requests."
    }
  ],
  "model_provider_id": "provider-workspace/llama-provider",
  "auth_context": {
    "principal_id": "user-12345",
    "principal_email": "alice@example.com",
    "principal_groups": [
      "ml-engineers",
      "research-team-alpha"
    ],
    "principal_on_behalf_of": "user-67890",
    "principal_on_behalf_of_groups": [
      "project-managers"
    ],
    "principal_on_behalf_of_email": "bob@example.com"
  }
}
```

**SDK Code**

```python
import requests

url = "https://host.com/apis/models/v2/workspaces/workspace/deployments/name"

payload = { "config": "llama-config-v2" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://host.com/apis/models/v2/workspaces/workspace/deployments/name';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"config":"llama-config-v2"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://host.com/apis/models/v2/workspaces/workspace/deployments/name"

	payload := strings.NewReader("{\n  \"config\": \"llama-config-v2\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://host.com/apis/models/v2/workspaces/workspace/deployments/name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"config\": \"llama-config-v2\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/apis/models/v2/workspaces/workspace/deployments/name")
  .header("Content-Type", "application/json")
  .body("{\n  \"config\": \"llama-config-v2\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/apis/models/v2/workspaces/workspace/deployments/name', [
  'body' => '{
  "config": "llama-config-v2"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://host.com/apis/models/v2/workspaces/workspace/deployments/name");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"config\": \"llama-config-v2\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["config": "llama-config-v2"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/apis/models/v2/workspaces/workspace/deployments/name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```