Create Customization Target#
Prerequisites#
Before you can create a customization target, make sure that you have:
Access to the NeMo Customizer service
The address of the base model you want to customize (
model_uri
)If using a HuggingFace-style (
hf://
)model_uri
, you must provide a HuggingFace endpoint (such ashttps://huggingface.co
); if not specified, the Data Store’s HF-compatible endpoint is used (http://<datastore-host>/hf
)
Review the customization target value reference guide to obtain the required values for the model you want to use.
Set the
CUSTOMIZER_BASE_URL
environment variable to your NeMo Customizer service endpoint
export CUSTOMIZER_BASE_URL="https://your-customizer-service-url"
Tip
Model files are large and can take time to download from the model_uri
. You can check the status of the download by getting target details and reviewing the status
.
Note
If you’re re-creating a target with the same name after deleting it, please contact your admin to verify that the model download job doesn’t exist for the deleted target. If it does, admin needs to update ttlSecondsAfterFinished
for modelDownloader
to 30 seconds or less (default TTL is set to 7200 seconds) and delete the job before proceeding.
To Create a Customization Target#
Choose one of the following options to create a customization target.
import os
from nemo_microservices import NeMoMicroservices
# Initialize the client
client = NeMoMicroservices(
base_url=os.environ['CUSTOMIZER_BASE_URL']
)
# Create a customization target
target = client.customization.targets.create(
name="llama-3.1-8b-instruct@2.0",
namespace="meta",
description="Customization target for Meta Llama 3.1 8B",
enabled=True,
base_model="meta/llama-3.1-8b",
model_path="llama-3_1-8b-instruct_2_0",
model_uri="ngc://nvidia/nemo/llama-3_1-8b:2.0",
hf_endpoint="<your HF endpoint>",
tokenizer={},
num_parameters=123456789,
precision="bf16-mixed",
project="urn:your-project-id"
)
print(f"Created target: {target.name}")
print(f"Target ID: {target.id}")
print(f"Status: {target.status}")
curl -X POST \
"${CUSTOMIZER_BASE_URL}/customization/targets" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "llama-3.1-8b-instruct@2.0",
"namespace": "meta",
"description": "Customization target for Meta Llama 3.1 8B",
"enabled": true,
"base_model": "meta/llama-3.1-8b",
"model_path": "llama-3_1-8b-instruct_2_0",
"model_uri": "ngc://nvidia/nemo/llama-3_1-8b:2.0",
"hf_endpoint": "<your HF endpoint>",
"tokenizer": {},
"num_parameters": 123456789,
"precision": "bf16-mixed",
"project": "urn:your-project-id"
}' | jq
Example Response
{
"id": "cust-target-abc123",
"name": "llama-3.1-8b-instruct@2.0",
"namespace": "meta",
"description": "Customization target for Meta Llama 3.1 8B",
"enabled": true,
"base_model": "meta/llama-3.1-8b",
"model_path": "llama-3_1-8b-instruct_2_0",
"model_uri": "ngc://nvidia/nemo/llama-3_1-8b:2.0",
"hf_endpoint": "<your HF endpoint>",
"tokenizer": {},
"num_parameters": 123456789,
"precision": "bf16-mixed",
"status": "created",
"ownership": {},
"custom_fields": {},
"created_at": "2024-05-08T12:00:00Z",
"updated_at": "2024-05-08T12:00:00Z"
}