Register a model from various sources
Register a model from various sources using a unified API
curl --request POST \
--url https://mycluster.domino.tech/api/registeredmodels/v2 \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"create": true,
"modelName": "churn-prediction-model",
"modelSource": {
"sourceType": "huggingface"
},
"description": "Customer churn prediction model trained on historical data",
"discoverable": false,
"modelCategory": "genai",
"modelType": "llm",
"projectId": "<string>"
}
'import requests
url = "https://mycluster.domino.tech/api/registeredmodels/v2"
payload = {
"create": True,
"modelName": "churn-prediction-model",
"modelSource": { "sourceType": "huggingface" },
"description": "Customer churn prediction model trained on historical data",
"discoverable": False,
"modelCategory": "genai",
"modelType": "llm",
"projectId": "<string>"
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
create: true,
modelName: 'churn-prediction-model',
modelSource: {sourceType: 'huggingface'},
description: 'Customer churn prediction model trained on historical data',
discoverable: false,
modelCategory: 'genai',
modelType: 'llm',
projectId: '<string>'
})
};
fetch('https://mycluster.domino.tech/api/registeredmodels/v2', 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://mycluster.domino.tech/api/registeredmodels/v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'create' => true,
'modelName' => 'churn-prediction-model',
'modelSource' => [
'sourceType' => 'huggingface'
],
'description' => 'Customer churn prediction model trained on historical data',
'discoverable' => false,
'modelCategory' => 'genai',
'modelType' => 'llm',
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$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://mycluster.domino.tech/api/registeredmodels/v2"
payload := strings.NewReader("{\n \"create\": true,\n \"modelName\": \"churn-prediction-model\",\n \"modelSource\": {\n \"sourceType\": \"huggingface\"\n },\n \"description\": \"Customer churn prediction model trained on historical data\",\n \"discoverable\": false,\n \"modelCategory\": \"genai\",\n \"modelType\": \"llm\",\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<api-key>")
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.post("https://mycluster.domino.tech/api/registeredmodels/v2")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"create\": true,\n \"modelName\": \"churn-prediction-model\",\n \"modelSource\": {\n \"sourceType\": \"huggingface\"\n },\n \"description\": \"Customer churn prediction model trained on historical data\",\n \"discoverable\": false,\n \"modelCategory\": \"genai\",\n \"modelType\": \"llm\",\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/registeredmodels/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"create\": true,\n \"modelName\": \"churn-prediction-model\",\n \"modelSource\": {\n \"sourceType\": \"huggingface\"\n },\n \"description\": \"Customer churn prediction model trained on historical data\",\n \"discoverable\": false,\n \"modelCategory\": \"genai\",\n \"modelType\": \"llm\",\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"modelVersion": {
"createdAt": "2022-03-12T02:13:44.467Z",
"modelName": "churn-prediction",
"modelVersion": 4,
"modelVersionDescription": "Customer churn model V1",
"ownerUsername": "martin_hito",
"project": {
"id": "62313ce67a0af0281c01a6a5",
"isGitBasedProject": true,
"name": "TO-DO",
"ownerUsername": "TO-DO"
},
"tags": {
"key": "value",
"key2": "anothervalue"
},
"updatedAt": "2022-03-12T02:13:44.467Z",
"versionUiDetails": {
"modelVersionDataSources": [
{
"dataSourceType": "<string>",
"id": "<string>",
"name": "<string>"
}
],
"modelVersionDatasets": [
{
"id": "<string>",
"name": "<string>",
"snapshotId": "<string>"
}
],
"experimentRunInfo": {
"metrics": [
{
"key": "<string>",
"timestamp": "2022-03-12T02:13:44.467Z",
"value": 123
}
],
"params": [
{
"key": "<string>",
"value": "<string>"
}
],
"runUrl": "<string>"
}
},
"buildStatus": "Succeeded",
"experimentRunId": "db79712b47084c27a463a188bf901943"
},
"registeredModel": {
"createdAt": "2022-03-12T02:13:44.467Z",
"description": "Customer churn model",
"name": "churn-prediction",
"ownerUsername": "martin_hito",
"project": {
"id": "62313ce67a0af0281c01a6a5",
"isGitBasedProject": true,
"name": "TO-DO",
"ownerUsername": "TO-DO"
},
"requestingUserAccess": {
"canEditModel": true,
"canEditProjectAssets": true,
"canEditPropertyValues": true,
"canEditTaxonomyTags": true,
"canViewExperimentRuns": true,
"canViewModelApis": true,
"canViewProject": true,
"canViewProjectFiles": true
},
"tags": {
"key": "value",
"key2": "anothervalue"
},
"updatedAt": "2022-03-12T02:13:44.467Z",
"discoverable": false,
"latestVersion": 1
}
}{
"error": "<string>"
}{
"code": "UNAUTHORIZED",
"message": "Authentication is required to access this resource."
}{
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action."
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
Details of the model to register
Indicates whether to create or update the registered model.
The name of the registered model
"churn-prediction-model"
Show child attributes
Show child attributes
Optional description of the registered model
"Customer churn prediction model trained on historical data"
Indicates whether this model is publicly discoverable. If true, users who are not project members will see this model in search results and can view basic model details.
Category of the model (e.g., "genai", "ml").
"genai"
Type of the model (e.g., "llm", "embedding", "other-genai", "ml").
"llm"
Project ID of the registered model. Required for Hugging Face models only. For MLflow models, this is ignored as the project is determined from the experiment run id.
Related topics
Manage models with model registryRegister a ModelRegister modelsRegister model through configWas this page helpful?
curl --request POST \
--url https://mycluster.domino.tech/api/registeredmodels/v2 \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"create": true,
"modelName": "churn-prediction-model",
"modelSource": {
"sourceType": "huggingface"
},
"description": "Customer churn prediction model trained on historical data",
"discoverable": false,
"modelCategory": "genai",
"modelType": "llm",
"projectId": "<string>"
}
'import requests
url = "https://mycluster.domino.tech/api/registeredmodels/v2"
payload = {
"create": True,
"modelName": "churn-prediction-model",
"modelSource": { "sourceType": "huggingface" },
"description": "Customer churn prediction model trained on historical data",
"discoverable": False,
"modelCategory": "genai",
"modelType": "llm",
"projectId": "<string>"
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
create: true,
modelName: 'churn-prediction-model',
modelSource: {sourceType: 'huggingface'},
description: 'Customer churn prediction model trained on historical data',
discoverable: false,
modelCategory: 'genai',
modelType: 'llm',
projectId: '<string>'
})
};
fetch('https://mycluster.domino.tech/api/registeredmodels/v2', 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://mycluster.domino.tech/api/registeredmodels/v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'create' => true,
'modelName' => 'churn-prediction-model',
'modelSource' => [
'sourceType' => 'huggingface'
],
'description' => 'Customer churn prediction model trained on historical data',
'discoverable' => false,
'modelCategory' => 'genai',
'modelType' => 'llm',
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$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://mycluster.domino.tech/api/registeredmodels/v2"
payload := strings.NewReader("{\n \"create\": true,\n \"modelName\": \"churn-prediction-model\",\n \"modelSource\": {\n \"sourceType\": \"huggingface\"\n },\n \"description\": \"Customer churn prediction model trained on historical data\",\n \"discoverable\": false,\n \"modelCategory\": \"genai\",\n \"modelType\": \"llm\",\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<api-key>")
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.post("https://mycluster.domino.tech/api/registeredmodels/v2")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"create\": true,\n \"modelName\": \"churn-prediction-model\",\n \"modelSource\": {\n \"sourceType\": \"huggingface\"\n },\n \"description\": \"Customer churn prediction model trained on historical data\",\n \"discoverable\": false,\n \"modelCategory\": \"genai\",\n \"modelType\": \"llm\",\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/registeredmodels/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"create\": true,\n \"modelName\": \"churn-prediction-model\",\n \"modelSource\": {\n \"sourceType\": \"huggingface\"\n },\n \"description\": \"Customer churn prediction model trained on historical data\",\n \"discoverable\": false,\n \"modelCategory\": \"genai\",\n \"modelType\": \"llm\",\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"modelVersion": {
"createdAt": "2022-03-12T02:13:44.467Z",
"modelName": "churn-prediction",
"modelVersion": 4,
"modelVersionDescription": "Customer churn model V1",
"ownerUsername": "martin_hito",
"project": {
"id": "62313ce67a0af0281c01a6a5",
"isGitBasedProject": true,
"name": "TO-DO",
"ownerUsername": "TO-DO"
},
"tags": {
"key": "value",
"key2": "anothervalue"
},
"updatedAt": "2022-03-12T02:13:44.467Z",
"versionUiDetails": {
"modelVersionDataSources": [
{
"dataSourceType": "<string>",
"id": "<string>",
"name": "<string>"
}
],
"modelVersionDatasets": [
{
"id": "<string>",
"name": "<string>",
"snapshotId": "<string>"
}
],
"experimentRunInfo": {
"metrics": [
{
"key": "<string>",
"timestamp": "2022-03-12T02:13:44.467Z",
"value": 123
}
],
"params": [
{
"key": "<string>",
"value": "<string>"
}
],
"runUrl": "<string>"
}
},
"buildStatus": "Succeeded",
"experimentRunId": "db79712b47084c27a463a188bf901943"
},
"registeredModel": {
"createdAt": "2022-03-12T02:13:44.467Z",
"description": "Customer churn model",
"name": "churn-prediction",
"ownerUsername": "martin_hito",
"project": {
"id": "62313ce67a0af0281c01a6a5",
"isGitBasedProject": true,
"name": "TO-DO",
"ownerUsername": "TO-DO"
},
"requestingUserAccess": {
"canEditModel": true,
"canEditProjectAssets": true,
"canEditPropertyValues": true,
"canEditTaxonomyTags": true,
"canViewExperimentRuns": true,
"canViewModelApis": true,
"canViewProject": true,
"canViewProjectFiles": true
},
"tags": {
"key": "value",
"key2": "anothervalue"
},
"updatedAt": "2022-03-12T02:13:44.467Z",
"discoverable": false,
"latestVersion": 1
}
}{
"error": "<string>"
}{
"code": "UNAUTHORIZED",
"message": "Authentication is required to access this resource."
}{
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action."
}{
"error": "<string>"
}{
"error": "<string>"
}