curl --request PUT \
--url https://api-dev.narrative.io/models/{model_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Fine-tuned for marketing content generation",
"tags": [
"llm",
"instruct",
"marketing"
]
}
'import requests
url = "https://api-dev.narrative.io/models/{model_id}"
payload = {
"description": "Fine-tuned for marketing content generation",
"tags": ["llm", "instruct", "marketing"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Fine-tuned for marketing content generation',
tags: ['llm', 'instruct', 'marketing']
})
};
fetch('https://api-dev.narrative.io/models/{model_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/models/{model_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Fine-tuned for marketing content generation',
'tags' => [
'llm',
'instruct',
'marketing'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/models/{model_id}"
payload := strings.NewReader("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-dev.narrative.io/models/{model_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/models/{model_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"company_id": 1,
"name": "Llama-3.1-8B-Instruct",
"license_id": "META-LLAMA-COMMUNITY-3.1",
"repository": {
"type": "hugging_face",
"organization": "meta-llama"
},
"collaborators": {
"training": {
"type": "all"
},
"inference": {
"type": "all"
}
},
"description": "Fine-tuned Llama model for instruction following",
"tags": [
"llm",
"instruct"
],
"base_model_id": null,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": null,
"archived_at": null,
"version": 1,
"status": "active"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Update a model
Updates an existing model.
Only the fields provided in the request body will be updated.
curl --request PUT \
--url https://api-dev.narrative.io/models/{model_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Fine-tuned for marketing content generation",
"tags": [
"llm",
"instruct",
"marketing"
]
}
'import requests
url = "https://api-dev.narrative.io/models/{model_id}"
payload = {
"description": "Fine-tuned for marketing content generation",
"tags": ["llm", "instruct", "marketing"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Fine-tuned for marketing content generation',
tags: ['llm', 'instruct', 'marketing']
})
};
fetch('https://api-dev.narrative.io/models/{model_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/models/{model_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Fine-tuned for marketing content generation',
'tags' => [
'llm',
'instruct',
'marketing'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/models/{model_id}"
payload := strings.NewReader("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-dev.narrative.io/models/{model_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/models/{model_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Fine-tuned for marketing content generation\",\n \"tags\": [\n \"llm\",\n \"instruct\",\n \"marketing\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"company_id": 1,
"name": "Llama-3.1-8B-Instruct",
"license_id": "META-LLAMA-COMMUNITY-3.1",
"repository": {
"type": "hugging_face",
"organization": "meta-llama"
},
"collaborators": {
"training": {
"type": "all"
},
"inference": {
"type": "all"
}
},
"description": "Fine-tuned Llama model for instruction following",
"tags": [
"llm",
"instruct"
],
"base_model_id": null,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": null,
"archived_at": null,
"version": 1,
"status": "active"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a model.
Body
The license identifier.
Optional description of the model.
List of tags to associate with the model.
Defines which companies have access to train and run inference on this model.
Show child attributes
Show child attributes
{
"training": { "type": "all" },
"inference": {
"type": "inclusion",
"companies": [1, 2, 3]
}
}
A human readable name for the model.
Model names must be non-empty and can only contain up to 512 characters.
Response
OK
Unique identifier for the model.
The ID of the company that owns this model.
A unique identifier for the model within the company's namespace.
Model names must consist of only alphanumeric characters, underscores, dashes, and dots, and be <= 256 characters long.
The license identifier (e.g., "META-LLAMA-COMMUNITY-3.1", "apache-2.0").
- Option 1
- Option 2
Show child attributes
Show child attributes
{
"type": "hugging_face",
"organization": "meta-llama"
}
Defines which companies have access to train and run inference on this model.
Show child attributes
Show child attributes
{
"training": { "type": "all" },
"inference": {
"type": "inclusion",
"companies": [1, 2, 3]
}
}
List of tags associated with the model.
When the model was created.
Model version number.
Current status of the model.
active, archived A human readable name for the model.
Model names must be non-empty and can only contain up to 512 characters.
Optional description of the model.
ID of the base model this model was derived from (if applicable).
When the model was last updated.
When the model was archived (if applicable).
Was this page helpful?

