You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spec.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ The model specification needs to consider two factors:
11
11
packaging content other than OCI image specification.
12
12
2. The model needs to be mounted by the container runtime as
13
13
[read only volumes based on the OCI Artifacts in Kubernetes 1.31+](https://kubernetes.io/blog/2024/08/16/kubernetes-1-31-image-volume-source/).
14
-
Container runtimes can only pull OCI artifact that follows the OCI image specification.
14
+
Container runtimes can only pull OCI artifact that follow the OCI image specification.
15
15
16
16
Therefore, the model specification must be defined through the artifact extension based on the [OCI image specification](https://github.com/opencontainers/image-spec/blob/main/spec.md#image-format-specification). It can be better compatible with the kubernetes ecosystem.
17
17
@@ -51,14 +51,25 @@ The model specification is based on the [OCI image specification](https://github
51
51
52
52
-**`layers`**_array of objects_
53
53
54
+
-**`mediaType`**_string_
55
+
56
+
`mediaType` MUST follow the [OCI image specification](https://github.com/opencontainers/image-spec/blob/main/layer.md), because the model needs to be mounted
57
+
by the container runtime as [read only volumes based on the OCI Artifacts in Kubernetes 1.31+](https://kubernetes.io/blog/2024/08/16/kubernetes-1-31-image-volume-source/).
58
+
Container runtimes can only pull OCI artifact that follow the OCI image specification.
59
+
54
60
-**`artifactType`**_string_
55
61
56
62
Implementations MUST support at least the following media types:
57
63
58
-
-`application/vnd.cnai.model.layer.v1.tar`
59
-
-`application/vnd.cnai.model.layer.v1.tar+gzip`
60
-
61
-
If `mediaType` is `application/vnd.oci.image.layer.v1.tar`, the `artifactType` MUST be `application/vnd.cnai.model.layer.v1.tar`. If `mediaType` is `application/vnd.oci.image.layer.v1.tar+gzip`, the `artifactType` MUST be `application/vnd.cnai.model.layer.v1.tar+gzip`. The `mediaType` and `artifactType` MUST be consistent, for detailed definitions of Filesystem Layers, please refer to the [Image Layer Filesystem Changeset](https://github.com/opencontainers/image-spec/blob/main/layer.md).
64
+
-`application/vnd.cnai.model.layer.v1.tar`: The layer is a tarball that contains the model weight file. If the model has multiple weight files,
65
+
need to package them in separate layers.
66
+
-`application/vnd.cnai.model.layer.v1.tar+gzip`: The layer is a tarball that contains the model weight file and is compressed by gzip.
67
+
If the model has multiple weight files, need to package them in separate layers. But recommended package model weight files without compressed to
68
+
avoid the container runtime decompressing the model layer. Because the model weight files have been compressed, the container runtime will
69
+
cost long time to decompress the model layer.
70
+
-`application/vnd.cnai.model.doc.v1.tar`: The layer is a tarball that contains the model documentation file, such as README.md, LICENSE, etc.
71
+
-`application/vnd.cnai.model.config.v1.tar`: The layer is a tarball that contains the model configuration file,
72
+
such as config.json, tokenizer.json, generation_config.json, etc.
0 commit comments