My Models - TypeScript SDK
client.myModels lists caller-owned Upload and Trained model assets. Only
Upload assets can be updated or deleted; Training-produced assets are read-only. The
high-level upload(...) workflow is the supported upload API; authorization,
multipart transfer, sealing, and registration are handled internally.
Overview
Available Operations
| Method | Description |
|---|---|
upload(path, options?) | Validate, hash, upload, register, and complete one model directory. |
list(options?) | Page the caller's model assets. |
get(id) | Read one model asset. |
update(id, body) | Update Upload model metadata. |
delete(id) | Delete an unreferenced Upload model asset. |
resumableUploads() | List interrupted uploads that can be resumed or cancelled. |
cancelUpload(taskId) | Cancel a resumable upload task. |
upload
Validate, hash, upload, register, and complete one model directory.
Request
path required; optional fields below.
Response
Ready MyModelVO.
list
Page the caller's model assets.
Request
Optional page, pageSize, keyword, status, source.
Response
PageResult<MyModelVO>.
get
Read one model asset.
Request
id: number | string required.
Response
MyModelVO.
update
Update Upload model metadata.
Request
Upload asset id and body required.
Response
Updated MyModelVO; Trained assets return 409.
delete
Delete an unreferenced Upload model asset.
Request
Upload asset id required.
Response
null; Trained assets return 409.
resumableUploads
List interrupted uploads that can be resumed or cancelled.
Request
This method has no parameters and sends no request body.
Response
MyModelStorageV2TaskResponse[].
cancelUpload
Cancel a resumable upload task.
Request
taskId: string required.
Response
null.
Field Reference and Examples
upload(...) options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | Directory name | Asset display name. |
description | string | No | - | Asset description. |
modelType | string | No | Detected | Model type such as LLM. |
modelArchitecture | string | No | Detected | Architecture override. |
parameterSize | string | No | Detected | Human-readable parameter size. |
servingConfigJson | string | No | - | Serialized serving metadata. |
clientRequestId | string | No | Generated UUID | Idempotency identity for upload recovery; maximum 64 characters. |
onProgress | (progress: UploadProgress) => void | No | - | Receives phase, file, completedBytes, and totalBytes. |
The uploader checks for a root config.json, model weights, supported
tokenizer files, Git LFS pointers, symlinks, duplicate paths, and size/count
limits before registering the asset.
A fixed request ID can resume an unfinished upload; replaying an ID whose task
has already completed is rejected instead of creating a duplicate asset.
Update body fields: optional name, description, modelType,
modelArchitecture, parameterSize, and servingConfigJson.
Key MyModelVO fields: id, name, source, status, state,
deployable, deploymentBlockReasonCode, modelType, modelArchitecture,
parameterSize, sizeBytes, fileCount, baseModelName, trainJobId,
createdAt, and updatedAt.
const asset = await client.myModels.upload<{ id: number }>("./model", {
name: "example-model",
modelType: "LLM",
onProgress: (progress) => {
console.log(progress.phase, progress.file, progress.completedBytes);
},
});
const page = await client.myModels.list({ page: 1, pageSize: 20, status: "READY" });
const detail = await client.myModels.get(asset.id);
const updated = await client.myModels.update(asset.id, { description: "validated" });
const tasks = await client.myModels.resumableUploads<Array<{ taskId: string }>>();
if (tasks.length > 0) await client.myModels.cancelUpload(tasks[0]!.taskId);
await client.myModels.delete(asset.id);
All methods use the shared authentication and typed error behavior described in Response Conventions and Retry and Security.