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

# Update Model

PATCH /apis/models/v2/workspaces/{workspace}/models/{name}
Content-Type: application/json

Update Model metadata.

Updates the metadata of an existing model entity. If the request body has an empty field,
the old value is kept.

Reference: https://docs.nvidia.com/nemo-platform/nemo-platform/v0.3.0/documentation/reference/api-reference/models/update-model-apis-models-v-2-workspaces-workspace-models-name-patch

## Request

### Path parameters

- `workspace` (string, required)
- `name` (string, required)

### Query parameters

- `verbose` (boolean, optional, default: false) — Whether to include full spec details

### Body (application/json)

- `description` (string, optional) — Optional description of the model
- `spec` (object, optional) — Detailed specification for the model
  - `checkpoint_model_name` (string, required) — Checkpoint Model identifier or model path
  - `family` (string, required) — Model architecture family (e.g., 'llama', 'mixtral', 'gpt2')
  - `num_layers` (integer, required) — Number of transformer layers
  - `hidden_size` (integer, required) — Hidden dimension size
  - `num_attention_heads` (integer, required) — Number of attention heads
  - `num_kv_heads` (integer, required) — Number of key-value heads (for GQA/MQA)
  - `ffn_hidden_size` (integer, required) — FFN intermediate size
  - `vocab_size` (integer, required) — Vocabulary size
  - `tied_embeddings` (boolean, required) — Whether embeddings are tied
  - `gated_mlp` (boolean, required) — Whether MLP uses gated activation
  - `base_num_parameters` (integer, required) — Total model parameters
  - `precision` (string, required) — Model precision (e.g., 'float16', 'bfloat16', 'float32', 'int8', 'int4')
  - `context_size` (integer, optional) — Context window size
  - `num_virtual_tokens` (integer, optional) — Number of virtual tokens for prompt tuning
  - `is_chat` (boolean, optional) — Whether this is a chat model
  - `is_embedding_model` (boolean, optional, default: false) — Whether this is an embedding model
  - `moe_config` (object, optional) — MoE configuration if applicable
    - `num_experts` (integer, required) — Total number of routed experts (sharded by EP)
    - `num_experts_per_tok` (integer, required) — Number of experts activated per token (top-k routing)
    - `num_expert_layers` (integer, required) — Number of layers with MoE
    - `expert_ffn_size` (integer, optional) — FFN size for experts (if different from main FFN)
    - `num_shared_experts` (integer, optional, default: 0) — Number of shared experts (replicated, not sharded by EP)
  - `mamba_config` (object, optional) — Mamba/SSM configuration if applicable
    - `is_hybrid` (boolean, required) — Whether model is Mamba-Transformer hybrid
    - `num_mamba_layers` (integer, required) — Number of Mamba/SSM layers
    - `num_attention_layers` (integer, optional, default: 0) — Number of attention layers (for hybrids)
    - `num_mlp_layers` (integer, optional, default: 0) — Number of standalone MLP layers (for interleaved architectures)
    - `state_size` (integer, optional, default: 16) — SSM state expansion factor (d_state)
    - `conv_kernel` (integer, optional, default: 4) — Convolution kernel size for Mamba (d_conv)
  - `sliding_window_config` (object, optional) — Sliding window attention config if applicable
    - `window_size` (integer, required) — Sliding window size (attends to last N tokens)
  - `linear_layers` (list of object, optional) — List of all linear/Conv1D layers with their dimensions. Used for LoRA parameter estimation without requiring model instantiation. Each entry contains the module name, in_features, and out_features.
    - `name` (string, required) — Module name (e.g., 'model.layers.0.self_attn.q_proj')
    - `in_features` (integer, required) — Input feature dimension
    - `out_features` (integer, required) — Output feature dimension
  - `chat_template` (string, optional) — Jinja2 chat template string for the model. Used by NIM to format chat completions. If not set, the model's built-in tokenizer template is used.
  - `tool_call_config` (object, optional) — Tool calling configuration for NIM deployments. Controls how the model handles function/tool calling in chat completions.
    - `tool_call_parser` (string, optional) — Name of the tool call parser to use (e.g., 'openai', 'hermes', 'pythonic', 'llama3_json', 'mistral').
    - `tool_call_plugin` (string, optional) — Reference to a fileset containing the custom tool call plugin Python file. Expected format: '\{workspace}/\{fileset\_name}'. The fileset is mounted separately from the model checkpoint at deployment time.
    - `auto_tool_choice` (boolean, optional) — Whether to enable automatic tool choice. When enabled, the model can decide to call tools without explicit user instruction.
  - `minimum_gpus_all_weights` (integer, optional) — Minimum GPUs required for full fine-tuning using default configurations.
  - `minimum_gpus_lora` (integer, optional) — Minimum GPUs required for LoRA fine-tuning using default configurations.
- `fileset` (string, optional) — A set of checkpoint files, configs, and other auxiliary info associated with this model - expected format \{workspace}/\{fileset\_name}
- `finetuning_type` (enum, optional) — Set for full weight finetuned models
  - Allowed values: `lora_merged`, `all_weights`, `last_layer`, `top_layers`, `gradual_unfreezing`, `bias_only`, `attention_only`, `lora`, `qlora`, `adalora`, `dora`, `lora_plus`, `prompt_tuning`, `prefix_tuning`, `p_tuning`, `p_tuning_v2`, `soft_prompt`, `ppo`, `dpo`, `cdpo`, `ipo`, `orpo`, `kto`, `rrhf`, `grpo`
- `base_model` (string, optional) — Link to another model which is used as a base for the current model
- `api_endpoint` (object, optional) — Data about the inference endpoint for this model
  - `url` (string, optional) — Endpoint URL
  - `model_id` (string, optional) — Model identifier at the endpoint
  - `api_key` (string, optional) — API key for authentication
  - `format` (string, optional) — API format (e.g., openai, nvidia)
- `backend_format` (enum, optional, nullable) — Inference API wire format expected by the backend. If unset, inference routing treats the model as OPENAI_CHAT.
  - Allowed values: `OPENAI_CHAT`, `ANTHROPIC_MESSAGES`
- `prompt` (object, optional) — Configuration for prompt engineering
  - `system_prompt` (string, optional) — System prompt template
  - `icl_few_shot_examples` (string, optional) — In-context learning examples
  - `inference_params` (object, optional) — Inference parameters that should be overridden.
    - `model` (string, optional) — Model identifier
    - `temperature` (double, optional) — Float value between 0 and 1. temp of 0 indicates greedy decoding, where the token with highest prob is chosen. Temperature can't be set to 0.0 currently
    - `max_tokens` (integer, optional) — Max tokens to generate
    - `max_completion_tokens` (integer, optional) — Max tokens to generate
    - `top_p` (double, optional) — Float value between 0 and 1; limits to the top tokens within a certain probability. top_p=0 means the model will only consider the single most likely token for the next prediction
    - `stop` (list of string, optional)
  - `system_prompt_template` (string, optional) — The template which will be used to compile the final prompt used for prompting the LLM. Currently supports only \{\{icl\_few\_shot\_examples}}
- `custom_fields` (map from string to any, optional) — Custom fields for additional metadata
- `ownership` (map from string to any, optional) — Ownership information for the model
- `model_providers` (list of string, optional) — List of ModelProvider workspace/name resource names that provide inference for this Model Entity
- `trust_remote_code` (boolean, optional) — Whether to trust remote code for the checkpoint. Some models without support in certain libraries such as Transformers require additional custom Python code to execute. Due to security ramifications of running arbitrary code, this can only be set to true on one of the following conditions: (1) the model's fileset's source is pre-approved in the platform config, or (2) the user creating this model is an administrator.

## Response

### 200

Update model metadata

- `id` (string, required) — Autogenerated id
- `name` (string, required) — Name of the entity. Name/workspace combo must be unique across all entities. Name must start with a lowercase letter, be 2-63 characters, and use lowercase letters, digits, hyphens, and dots (no consecutive hyphens, cannot end with a hyphen).
- `workspace` (string, required) — The workspace of the entity. Allowed characters: letters (a-z, A-Z), digits (0-9), underscores, hyphens, and dots.
- `created_at` (datetime, required) — The timestamp of model entity creation
- `updated_at` (datetime, required) — The timestamp of the last model entity update
- `project` (string, optional) — The URN of the project associated with this model entity.
- `description` (string, optional) — Optional description of the model.
- `spec` (object, optional) — Detailed specification for the model
  - `checkpoint_model_name` (string, required) — Checkpoint Model identifier or model path
  - `family` (string, required) — Model architecture family (e.g., 'llama', 'mixtral', 'gpt2')
  - `num_layers` (integer, required) — Number of transformer layers
  - `hidden_size` (integer, required) — Hidden dimension size
  - `num_attention_heads` (integer, required) — Number of attention heads
  - `num_kv_heads` (integer, required) — Number of key-value heads (for GQA/MQA)
  - `ffn_hidden_size` (integer, required) — FFN intermediate size
  - `vocab_size` (integer, required) — Vocabulary size
  - `tied_embeddings` (boolean, required) — Whether embeddings are tied
  - `gated_mlp` (boolean, required) — Whether MLP uses gated activation
  - `base_num_parameters` (integer, required) — Total model parameters
  - `precision` (string, required) — Model precision (e.g., 'float16', 'bfloat16', 'float32', 'int8', 'int4')
  - `context_size` (integer, optional) — Context window size
  - `num_virtual_tokens` (integer, optional) — Number of virtual tokens for prompt tuning
  - `is_chat` (boolean, optional) — Whether this is a chat model
  - `is_embedding_model` (boolean, optional, default: false) — Whether this is an embedding model
  - `moe_config` (object, optional) — MoE configuration if applicable
    - `num_experts` (integer, required) — Total number of routed experts (sharded by EP)
    - `num_experts_per_tok` (integer, required) — Number of experts activated per token (top-k routing)
    - `num_expert_layers` (integer, required) — Number of layers with MoE
    - `expert_ffn_size` (integer, optional) — FFN size for experts (if different from main FFN)
    - `num_shared_experts` (integer, optional, default: 0) — Number of shared experts (replicated, not sharded by EP)
  - `mamba_config` (object, optional) — Mamba/SSM configuration if applicable
    - `is_hybrid` (boolean, required) — Whether model is Mamba-Transformer hybrid
    - `num_mamba_layers` (integer, required) — Number of Mamba/SSM layers
    - `num_attention_layers` (integer, optional, default: 0) — Number of attention layers (for hybrids)
    - `num_mlp_layers` (integer, optional, default: 0) — Number of standalone MLP layers (for interleaved architectures)
    - `state_size` (integer, optional, default: 16) — SSM state expansion factor (d_state)
    - `conv_kernel` (integer, optional, default: 4) — Convolution kernel size for Mamba (d_conv)
  - `sliding_window_config` (object, optional) — Sliding window attention config if applicable
    - `window_size` (integer, required) — Sliding window size (attends to last N tokens)
  - `linear_layers` (list of object, optional) — List of all linear/Conv1D layers with their dimensions. Used for LoRA parameter estimation without requiring model instantiation. Each entry contains the module name, in_features, and out_features.
    - `name` (string, required) — Module name (e.g., 'model.layers.0.self_attn.q_proj')
    - `in_features` (integer, required) — Input feature dimension
    - `out_features` (integer, required) — Output feature dimension
  - `chat_template` (string, optional) — Jinja2 chat template string for the model. Used by NIM to format chat completions. If not set, the model's built-in tokenizer template is used.
  - `tool_call_config` (object, optional) — Tool calling configuration for NIM deployments. Controls how the model handles function/tool calling in chat completions.
    - `tool_call_parser` (string, optional) — Name of the tool call parser to use (e.g., 'openai', 'hermes', 'pythonic', 'llama3_json', 'mistral').
    - `tool_call_plugin` (string, optional) — Reference to a fileset containing the custom tool call plugin Python file. Expected format: '\{workspace}/\{fileset\_name}'. The fileset is mounted separately from the model checkpoint at deployment time.
    - `auto_tool_choice` (boolean, optional) — Whether to enable automatic tool choice. When enabled, the model can decide to call tools without explicit user instruction.
  - `minimum_gpus_all_weights` (integer, optional) — Minimum GPUs required for full fine-tuning using default configurations.
  - `minimum_gpus_lora` (integer, optional) — Minimum GPUs required for LoRA fine-tuning using default configurations.
- `finetuning_type` (enum, optional) — Set for full weight finetuned models
  - Allowed values: `lora_merged`, `all_weights`, `last_layer`, `top_layers`, `gradual_unfreezing`, `bias_only`, `attention_only`, `lora`, `qlora`, `adalora`, `dora`, `lora_plus`, `prompt_tuning`, `prefix_tuning`, `p_tuning`, `p_tuning_v2`, `soft_prompt`, `ppo`, `dpo`, `cdpo`, `ipo`, `orpo`, `kto`, `rrhf`, `grpo`
- `fileset` (string, optional) — A set of checkpoint files, configs, and other auxiliary info associated with this model - expected format \{workspace}/\{fileset\_name}
- `trust_remote_code` (boolean, optional, default: false) — Whether to trust remote code to load this model checkpoint.
- `base_model` (string, optional) — Link to another model which is used as a base for the current model
- `api_endpoint` (object, optional) — Data about the inference endpoint for this model
  - `url` (string, optional) — Endpoint URL
  - `model_id` (string, optional) — Model identifier at the endpoint
  - `api_key` (string, optional) — API key for authentication
  - `format` (string, optional) — API format (e.g., openai, nvidia)
- `backend_format` (enum, optional, nullable) — Inference API wire format expected by the backend. If unset, inference routing treats the model as OPENAI_CHAT.
  - Allowed values: `OPENAI_CHAT`, `ANTHROPIC_MESSAGES`
- `adapters` (list of object, optional) — Adapters that have been created against this model
  - `name` (string, required) — Name of the adapter. Name must be unique in the workspace for all Adapters and match the following regex: Allowed characters: letters (a-z, A-Z), digits (0-9), underscores, hyphens, and dots.
  - `workspace` (string, required) — Workspace of the adapter. Allowed characters: letters (a-z, A-Z), digits (0-9), underscores, hyphens, and dots.
  - `fileset` (string, required) — Fileset where the adapter files are stored expected format \{workspace}/\{fileset\_name}
  - `finetuning_type` (enum, required) — Type of finetuning (LORA, P_TUNING, etc.)
    - Allowed values: `lora_merged`, `all_weights`, `last_layer`, `top_layers`, `gradual_unfreezing`, `bias_only`, `attention_only`, `lora`, `qlora`, `adalora`, `dora`, `lora_plus`, `prompt_tuning`, `prefix_tuning`, `p_tuning`, `p_tuning_v2`, `soft_prompt`, `ppo`, `dpo`, `cdpo`, `ipo`, `orpo`, `kto`, `rrhf`, `grpo`
  - `description` (string, optional) — Optional description of the adapter
  - `enabled` (boolean, optional, default: true) — Whether to make this adapter available for inference post training
  - `lora_config` (object, optional) — Lora configuration specifics
    - `rank` (integer, required) — LoRA Rank
    - `alpha` (integer, optional) — Alpha scaling used for this adapter
  - `model` (string, optional) — Parent model entity reference. A single name (2-63 characters) or 'workspace/model_name' where each segment is a valid name (lowercase, digits, hyphens, and temporarily @ . + _; no leading/trailing or consecutive hyphens). If one slash, both sides must be non-empty.
  - `created_at` (datetime, optional)
  - `updated_at` (datetime, optional)
- `prompt` (object, optional) — Configuration for prompt engineering
  - `system_prompt` (string, optional) — System prompt template
  - `icl_few_shot_examples` (string, optional) — In-context learning examples
  - `inference_params` (object, optional) — Inference parameters that should be overridden.
    - `model` (string, optional) — Model identifier
    - `temperature` (double, optional) — Float value between 0 and 1. temp of 0 indicates greedy decoding, where the token with highest prob is chosen. Temperature can't be set to 0.0 currently
    - `max_tokens` (integer, optional) — Max tokens to generate
    - `max_completion_tokens` (integer, optional) — Max tokens to generate
    - `top_p` (double, optional) — Float value between 0 and 1; limits to the top tokens within a certain probability. top_p=0 means the model will only consider the single most likely token for the next prediction
    - `stop` (list of string, optional)
  - `system_prompt_template` (string, optional) — The template which will be used to compile the final prompt used for prompting the LLM. Currently supports only \{\{icl\_few\_shot\_examples}}
- `custom_fields` (map from string to any, optional) — Custom fields for additional metadata
- `ownership` (map from string to any, optional) — Ownership information for the model
- `model_providers` (list of string, optional) — List of ModelProvider workspace/name resource names that provide inference for this Model Entity

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "string",
  "name": "llama-3.1-8b",
  "workspace": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "project": "string",
  "description": "string",
  "spec": {
    "checkpoint_model_name": "string",
    "family": "string",
    "num_layers": 1,
    "hidden_size": 1,
    "num_attention_heads": 1,
    "num_kv_heads": 1,
    "ffn_hidden_size": 1,
    "vocab_size": 1,
    "tied_embeddings": true,
    "gated_mlp": true,
    "base_num_parameters": 1,
    "precision": "string",
    "context_size": 1,
    "num_virtual_tokens": 1,
    "is_chat": true,
    "is_embedding_model": false,
    "moe_config": {
      "num_experts": 1,
      "num_experts_per_tok": 1,
      "num_expert_layers": 1,
      "expert_ffn_size": 1,
      "num_shared_experts": 0
    },
    "mamba_config": {
      "is_hybrid": true,
      "num_mamba_layers": 1,
      "num_attention_layers": 0,
      "num_mlp_layers": 0,
      "state_size": 16,
      "conv_kernel": 4
    },
    "sliding_window_config": {
      "window_size": 1
    },
    "linear_layers": [
      {
        "name": "string",
        "in_features": 1,
        "out_features": 1
      }
    ],
    "chat_template": "string",
    "tool_call_config": {
      "tool_call_parser": "string",
      "tool_call_plugin": "string",
      "auto_tool_choice": true
    },
    "minimum_gpus_all_weights": 1,
    "minimum_gpus_lora": 1
  },
  "finetuning_type": "lora_merged",
  "fileset": "string",
  "trust_remote_code": false,
  "base_model": "string",
  "api_endpoint": {
    "url": "string",
    "model_id": "string",
    "api_key": "string",
    "format": "string"
  },
  "backend_format": "OPENAI_CHAT",
  "adapters": [
    {
      "name": "lora-adapter-v1",
      "workspace": "string",
      "fileset": "string",
      "finetuning_type": "lora_merged",
      "description": "string",
      "enabled": true,
      "lora_config": {
        "rank": 1,
        "alpha": 1
      },
      "model": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z"
    }
  ],
  "prompt": {
    "system_prompt": "string",
    "icl_few_shot_examples": "string",
    "inference_params": {
      "model": "string",
      "temperature": 1.1,
      "max_tokens": 1,
      "max_completion_tokens": 1,
      "top_p": 0.5,
      "stop": [
        "string"
      ]
    },
    "system_prompt_template": "string"
  },
  "custom_fields": {},
  "ownership": {},
  "model_providers": [
    "string"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/models/v2/workspaces/workspace/models/name"

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

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

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/models/v2/workspaces/workspace/models/name';
const options = {method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{}'};

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://api.example.com/apis/models/v2/workspaces/workspace/models/name"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", 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://api.example.com/apis/models/v2/workspaces/workspace/models/name")

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

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

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.patch("https://api.example.com/apis/models/v2/workspaces/workspace/models/name")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.example.com/apis/models/v2/workspaces/workspace/models/name', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/apis/models/v2/workspaces/workspace/models/name");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/models/v2/workspaces/workspace/models/name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```