Manage Model Entities for Customization

View as Markdown

Before running a customization job, you need to set up a Model Entity that points to your base model checkpoint. This section covers creating the required FileSet and Model Entity.

Task Guides


Key Concepts

What is a FileSet?

A FileSet is a collection of files managed by the platform. For customization, you create a FileSet containing:

  • Model weights (.safetensors, .bin, or .nemo files)
  • Model configuration (config.json)
  • Tokenizer files (tokenizer.json, tokenizer_config.json, and so on)

FileSets can be populated from:

  • HuggingFace Hub - Download directly from HF repositories
  • NGC - Download from NVIDIA NGC catalogs
  • Local upload - Upload files from your local machine

What is a Model Entity?

A Model Entity is the platform’s representation of a model. It contains:

  • FileSet reference - Points to where the model files are stored
  • Model Spec - Auto-populated metadata about the model architecture
  • Adapters - LoRA or other adapters attached to this model (populated after training)
  • Base model link - For fine-tuned models, links back to the parent

Quick Start Example

Complete example of setting up a model for customization:

HuggingFace Token: If downloading from a gated HuggingFace repository (like Llama models), you will need to create a secret containing your HuggingFace API token first. Refer to Manage Secrets for instructions.

1import os
2import time
3from nemo_platform import NeMoPlatform
4from nemo_platform._exceptions import ConflictError
5from nemo_platform.types.files import HuggingfaceStorageConfigParam
6
7client = NeMoPlatform(
8 base_url=os.environ.get("NMP_BASE_URL", "http://localhost:8080"),
9 workspace="default",
10)
11
12# Step 1: Create FileSet from HuggingFace
13try:
14 fileset = client.files.filesets.create(
15 workspace="default",
16 name="qwen3-1.7b",
17 description="Qwen3 1.7B base model from HuggingFace",
18 storage=HuggingfaceStorageConfigParam(
19 type="huggingface",
20 repo_id="Qwen/Qwen3-1.7B",
21 repo_type="model",
22 ),
23 )
24 print(f"Created FileSet: {fileset.name}")
25except ConflictError:
26 print("FileSet already exists, retrieving...")
27 fileset = client.files.filesets.retrieve(workspace="default", name="qwen3-1.7b")
28
29# Step 2: Create Model Entity
30try:
31 model = client.models.create(
32 workspace="default",
33 name="qwen3-1.7b",
34 fileset="default/qwen3-1.7b", # Reference to the FileSet
35 description="Qwen3 1.7B base model for customization",
36 )
37 print(f"Created Model Entity: {model.name}")
38except ConflictError:
39 print("Model Entity already exists, retrieving...")
40 model = client.models.retrieve(workspace="default", name="qwen3-1.7b")
41
42# Step 3: Wait for ModelSpec to be auto-populated
43print("Waiting for model spec to be populated...")
44while not model.spec:
45 time.sleep(5)
46 model = client.models.retrieve(workspace="default", name="qwen3-1.7b")
47
48print(f"Model ready!")
49print(f" Architecture: {model.spec.family}")
50print(f" Parameters: {model.spec.base_num_parameters:,}")
51print(f" Layers: {model.spec.num_layers}")

After the Model Entity is ready (has a spec), you can use it in customization jobs with model: "default/qwen3-1.7b".