> 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.

# Add Model Adapter

POST /apis/models/v2/workspaces/{workspace}/models/{model_name}/adapters
Content-Type: application/json

Adds an Adapter to the Model

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

## Request

### Path parameters

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

### Body (application/json)

- `name` (string, required) — Name of the adapter. Name must be unique in the workspace. 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).
- `fileset` (string, required) — Location where 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

## Response

### 201

Register a new adapter to the 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)

## Examples

**Request**

```json
{
  "name": "lora-adapter-v1",
  "fileset": "string",
  "finetuning_type": "lora_merged"
}
```

**Response**

```json
{
  "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"
}
```

**SDK Code**

```python
import requests

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

payload = {
    "name": "lora-adapter-v1",
    "fileset": "string",
    "finetuning_type": "lora_merged"
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/models/v2/workspaces/workspace/models/model_name/adapters';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"name":"lora-adapter-v1","fileset":"string","finetuning_type":"lora_merged"}'
};

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/model_name/adapters"

	payload := strings.NewReader("{\n  \"name\": \"lora-adapter-v1\",\n  \"fileset\": \"string\",\n  \"finetuning_type\": \"lora_merged\"\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://api.example.com/apis/models/v2/workspaces/workspace/models/model_name/adapters")

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  \"name\": \"lora-adapter-v1\",\n  \"fileset\": \"string\",\n  \"finetuning_type\": \"lora_merged\"\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://api.example.com/apis/models/v2/workspaces/workspace/models/model_name/adapters")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"lora-adapter-v1\",\n  \"fileset\": \"string\",\n  \"finetuning_type\": \"lora_merged\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/apis/models/v2/workspaces/workspace/models/model_name/adapters', [
  'body' => '{
  "name": "lora-adapter-v1",
  "fileset": "string",
  "finetuning_type": "lora_merged"
}',
  '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/model_name/adapters");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"lora-adapter-v1\",\n  \"fileset\": \"string\",\n  \"finetuning_type\": \"lora_merged\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "name": "lora-adapter-v1",
  "fileset": "string",
  "finetuning_type": "lora_merged"
] 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/model_name/adapters")! 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()
```