Skip to content

Commit 5d50d45

Browse files
committed
feat: add media type for unkonwn file type
Signed-off-by: Zhao Chen <[email protected]>
1 parent b1d3255 commit 5d50d45

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/spec.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ The image manifest of model artifacts follows the [OCI Image Manifest Specificat
8282

8383
- `application/vnd.cnai.model.dataset.v1.tar+zstd`: The layer is a [tar archive][tar-archive] that includes datasets that may be needed for the lifecycle of AI/ML models. The archive is compressed with [zstd][rfc8478].
8484

85+
- `application/vnd.cnai.model.unknown.v1.raw`: The layer is an unarchived, uncompressed unknown model file type. If the files are large, implementations are RECOMMENDED to use this media type. If the type of model file cannot be determined, this media type can be used.
86+
87+
- `application/vnd.cnai.model.unknown.v1.tar`: The layer is a [tar archive][tar-archive] that includes unknown model file types. If the type of model file cannot be determined, this media type can be used.
88+
89+
- `application/vnd.cnai.model.unknown.v1.tar+gzip`: The layer is a [tar archive][tar-archive] that includes unknown model file types. The archive is compressed with [gzip][rfc1952_2]. If the type of model file cannot be determined, this media type can be used.
90+
91+
- `application/vnd.cnai.model.unknown.v1.tar+zstd`: The layer is a [tar archive][tar-archive] that includes unknown model file types. The archive is compressed with [zstd][rfc8478]. If the type of model file cannot be determined, this media type can be used.
92+
8593
- **`annotations`** _string-string map_
8694

8795
This OPTIONAL property contains arbitrary attributes for the layer. For metadata specific to models, implementations SHOULD use the predefined annotation keys as outlined in the [Layer Annotation Keys](./annotations.md#layer-annotation-keys).
@@ -137,6 +145,12 @@ The `application/vnd.cnai.model.weight.v1.tar+gzip` represents an `application/v
137145

138146
The `application/vnd.cnai.model.weight.v1.tar+zstd` represents an `application/vnd.cnai.model.weight.v1.tar` payload which has been compressed with the [zstd][rfc8478] algorithm. The mediaTypes `application/vnd.cnai.model.weight.config.v1.tar+zstd`, `application/vnd.cnai.model.doc.v1.tar+zstd`, `application/vnd.cnai.model.code.v1.tar+zstd`, `application/vnd.cnai.model.dataset.v1.tar+zstd` refer to the zstd compressed payloads of their corresponding type.
139147

148+
### `unknown` Media Types
149+
150+
The `application/vnd.cnai.model.unknown.v1.tar` media type and its friends represent an file type which is unknown to the implementation. In some cases, the model package system may not know the type of the file, or the file is not config, weight, doc, code or dataset. For instance, the file is a binary file, or the file is a model file but the type is not known, but it is still a valid model file, which is required by the downstream model serving/deployment platform.
151+
152+
The `application/vnd.cnai.model.unknown.v1.tar+gzip` and `application/vnd.cnai.model.unknown.v1.tar+zstd` media types represent the gzip and zstd compressed payloads of the `application/vnd.cnai.model.unknown.v1.tar` media type. If the file is large, implementations are RECOMMENDED to use `application/vnd.cnai.model.unknown.v1.raw` media type.
153+
140154
### File Attributes
141155

142156
Where supported, MUST include file attributes

specs-go/v1/mediatype.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,16 @@ const (
8484

8585
// MediaTypeModelDatasetZstd specifies the media type for zstd compressed model datasets, including datasets that may be needed throughout the lifecycle of AI/ML models.
8686
MediaTypeModelDatasetZstd = "application/vnd.cnai.model.dataset.v1.tar+zstd"
87+
88+
// MediaTypeModelUnknownRaw specifies the media type for an unarchived, uncompressed unknown file type.
89+
MediaTypeModelUnknownRaw = "application/vnd.cnai.model.unknown.v1.raw"
90+
91+
// MediaTypeModelUnknown specifies the media type for an unknown file type.
92+
MediaTypeModelUnknown = "application/vnd.cnai.model.unknown.v1.tar"
93+
94+
// MediaTypeModelUnknownGzip specifies the media type for a gzipped unknown file type.
95+
MediaTypeModelUnknownGzip = "application/vnd.cnai.model.unknown.v1.tar+gzip"
96+
97+
// MediaTypeModelUnknownZstd specifies the media type for a zstd compressed unknown file type.
98+
MediaTypeModelUnknownZstd = "application/vnd.cnai.model.unknown.v1.tar+zstd"
8799
)

0 commit comments

Comments
 (0)