Apply
curl --request PUT \
--url https://{controlPlaneURL}/api/ml/v1/prompt-versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"manifest": {
"name": "<string>",
"description": "<string>",
"metadata": {},
"version_alias": "<string>",
"ml_repo": "<string>",
"version": 2,
"type": "model-version",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"framework": {
"type": "transformers",
"library_name": "transformers",
"pipeline_tag": "<string>",
"base_model": "<string>"
},
"environment": {
"python_version": "<string>",
"pip_packages": [
"<string>"
]
},
"step": 0,
"run_id": "<string>"
}
}'
{
"data": {
"id": "<string>",
"fqn": "<string>",
"created_by_subject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"manifest": {
"name": "<string>",
"description": "<string>",
"metadata": {},
"version_alias": "<string>",
"ml_repo": "<string>",
"version": 2,
"type": "chat_prompt",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"variables": {},
"model_configuration": {
"provider": "<string>",
"model": "<string>",
"parameters": {
"max_tokens": 123,
"temperature": 123,
"top_k": 123,
"top_p": 123,
"stop": [
"<string>"
]
},
"extra_parameters": {}
},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
]
},
"usage_code_snippet": "<string>",
"ml_repo_id": "<string>",
"prompt_id": "<string>"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Model Version artifact.
Name of the entity
256
Key value metadata. Should be valid JSON. For e.g. {"business-unit": "sales", "quality": "good", "rating": 4.5}
Name of the ML Repo
512
Version alias is alternate, ideally human readable, version string to reference an artifact version. It should start with v
followed by alphanumeric and it can include .
and -
in between (e.g. v1.0.0
, v1-prod
, v3-dev
, etc)
128
Version of the entity
x >= 1
model-version
Framework for the model version like Transformers, PyTorch, Sklearn, Xgboost etc with framework specific metadata. This will be used to infer model deployment configuration
Type of the framework
transformers
Name of the library for the framework
transformers
, sentence-transformers
, diffusers
The pipeline()
task this model can be used with e.g. text-generation
. See huggingface docs for all possible values
Base model Id from HuggingFace Hub. If this is a finetuned model, this points to the base model id used for finetuning.
Step/Epoch number in an iterative training loop the model version was created. Generally useful when logging a model version from a MLRepo Run
x >= 0
ID of the MLRepo Run that generated the model version
Response
Subject ID
Subject type
user
, team
, serviceaccount
Subject slug
Subject display name
Chat Prompt manifest.
Name of the entity
256
Key value metadata. Should be valid JSON. For e.g. {"business-unit": "sales", "quality": "good", "rating": 4.5}
Name of the ML Repo
List of messages in the chat conversation, must be non-empty
512
Version alias is alternate, ideally human readable, version string to reference an artifact version. It should start with v
followed by alphanumeric and it can include .
and -
in between (e.g. v1.0.0
, v1-prod
, v3-dev
, etc)
128
Version of the entity
x >= 1
chat_prompt
Variables referenced in messages and that can be replaced when running generation
Add a model from Gateway along with parameters to be used for chat completion
Name of the provider, must be one of the integration providers configured for the Gateway
Name of the model to be used for generations. This model should be available in the provider
Parameters to pass to the model when generating
Arbitrary extra parameters to pass to the model when generating
List of tools to be used in the chat prompt
Schema defining a tool for the chat prompt
Type of the tool
function
Schema defining a function for tool calls
Name of the function
Description of the function
Parameters schema for the function
Indicates if the function should be called strictly
curl --request PUT \
--url https://{controlPlaneURL}/api/ml/v1/prompt-versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"manifest": {
"name": "<string>",
"description": "<string>",
"metadata": {},
"version_alias": "<string>",
"ml_repo": "<string>",
"version": 2,
"type": "model-version",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"framework": {
"type": "transformers",
"library_name": "transformers",
"pipeline_tag": "<string>",
"base_model": "<string>"
},
"environment": {
"python_version": "<string>",
"pip_packages": [
"<string>"
]
},
"step": 0,
"run_id": "<string>"
}
}'
{
"data": {
"id": "<string>",
"fqn": "<string>",
"created_by_subject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"manifest": {
"name": "<string>",
"description": "<string>",
"metadata": {},
"version_alias": "<string>",
"ml_repo": "<string>",
"version": 2,
"type": "chat_prompt",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"variables": {},
"model_configuration": {
"provider": "<string>",
"model": "<string>",
"parameters": {
"max_tokens": 123,
"temperature": 123,
"top_k": 123,
"top_p": 123,
"stop": [
"<string>"
]
},
"extra_parameters": {}
},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
]
},
"usage_code_snippet": "<string>",
"ml_repo_id": "<string>",
"prompt_id": "<string>"
}
}