Create a Model FileSet

View as Markdown

Create a FileSet containing your base model checkpoint before creating a Model Entity.

Prerequisites

  • Obtained the base URL of your NeMo Platform.
  • For gated or private Hugging Face models: Created a secret with your HF token. Refer to Manage Secrets.
  • Set the NMP_BASE_URL environment variable.
export NMP_BASE_URL="https://your-nemo-platform-url"

From Hugging Face Hub

The most common method is downloading directly from Hugging Face. The example below uses Qwen/Qwen3-1.7B, a public model that requires no token:

import os
from nemo_platform import ConflictError, NeMoPlatform
from nemo_platform.types.files import HuggingfaceStorageConfigParam
client = NeMoPlatform(
base_url=os.environ.get("NMP_BASE_URL", "http://localhost:8080"),
workspace="default",
)
HF_REPO_ID = "Qwen/Qwen3-1.7B"
MODEL_NAME = "qwen3-1.7b"
# Create FileSet from Hugging Face
try:
fileset = client.files.filesets.create(
workspace="default",
name=MODEL_NAME,
description="Qwen3 1.7B from Hugging Face",
purpose="model",
storage=HuggingfaceStorageConfigParam(
type="huggingface",
repo_id=HF_REPO_ID,
repo_type="model",
),
)
print(f"Created FileSet: {fileset.name}")
except ConflictError:
print(f"FileSet '{MODEL_NAME}' already exists, retrieving...")
fileset = client.files.filesets.retrieve(workspace="default", name=MODEL_NAME)
print(f"FileSet ready: {fileset.name}")

Gated models (such as Llama) require a Hugging Face token. To use one:

  1. Accept the model license on the Hugging Face model page.
  2. Create a Hugging Face token with read access.
  3. Store the token as a secret in the platform (see Manage Secrets), then pass it as token_secret in the storage config:
storage=HuggingfaceStorageConfigParam(
type="huggingface",
repo_id="meta-llama/Llama-3.2-1B-Instruct",
repo_type="model",
token_secret="my-hf-token",
)

From NGC

For models from NVIDIA NGC:

import os
from nemo_platform import ConflictError, NeMoPlatform
from nemo_platform.types.files import NGCStorageConfigParam
client = NeMoPlatform(
base_url=os.environ.get("NMP_BASE_URL", "http://localhost:8080"),
workspace="default",
)
MODEL_NAME = "nemotron-mini-4b"
NGC_TARGET = "nemotron-mini-4b-instruct"
NGC_ORG = "nvidia"
NGC_TEAM = "nemo"
NGC_VERSION = "1.0"
NGC_API_KEY_SECRET = "my-ngc-key"
NGC_API_KEY = os.environ.get("NGC_API_KEY")
if not NGC_API_KEY:
raise RuntimeError("Set NGC_API_KEY before creating the NGC secret.")
# First, create a secret for your NGC API key (if not already created)
try:
ngc_secret = client.secrets.create(
name=NGC_API_KEY_SECRET,
workspace="default",
value=NGC_API_KEY,
)
print(f"Created secret: {NGC_API_KEY_SECRET}")
except ConflictError:
print(f"Secret '{NGC_API_KEY_SECRET}' already exists, continuing...")
ngc_secret = client.secrets.retrieve(name=NGC_API_KEY_SECRET, workspace="default")
# Create FileSet from NGC
try:
fileset = client.files.filesets.create(
workspace="default",
name=MODEL_NAME,
description="Nemotron Mini 4B from NGC",
purpose="model",
storage=NGCStorageConfigParam(
type="ngc",
org=NGC_ORG,
team=NGC_TEAM,
target=NGC_TARGET, # NGC asset name
target_type="resource",
version=NGC_VERSION,
api_key_secret=ngc_secret.name,
),
)
print(f"Created FileSet: {fileset.name}")
except ConflictError:
print("FileSet already exists, retrieving...")
fileset = client.files.filesets.retrieve(workspace="default", name=MODEL_NAME)

Check FileSet Status

Files are downloaded in the background after you create a FileSet. Check the status:

# List files in the FileSet
response = client.files.list(
workspace="default",
fileset="qwen3-1.7b",
)
files = response.data
print(f"Files in FileSet ({len(files)} total):")
for f in files[:10]: # Show first 10
print(f" - {f.path} ({f.size:,} bytes)")
{
"data": [
{
"file_ref": "/v2/workspaces/default/filesets/qwen3-1.7b/-/config.json",
"path": "config.json",
"size": 1234,
"cache_status": null
},
{
"file_ref": "/v2/workspaces/default/filesets/qwen3-1.7b/-/model.safetensors",
"path": "model.safetensors",
"size": 2400000000,
"cache_status": null
},
{
"file_ref": "/v2/workspaces/default/filesets/qwen3-1.7b/-/tokenizer.json",
"path": "tokenizer.json",
"size": 9085657,
"cache_status": null
},
{
"file_ref": "/v2/workspaces/default/filesets/qwen3-1.7b/-/tokenizer_config.json",
"path": "tokenizer_config.json",
"size": 901,
"cache_status": null
}
]
}

Next Steps

Proceed to create a Model Entity.