Documentation
¶
Index ¶
Constants ¶
const ( // AnnotationFilepath is the annotation key for the file path of the layer. AnnotationFilepath = "org.cnai.model.filepath" // AnnotationFileMetadata is the annotation key for the file metadata of the layer. AnnotationFileMetadata = "org.cnai.model.file.metadata+json" // AnnotationUntested is the annotation key for file media type untested flag of the layer. AnnotationMediaTypeUntested = "org.cnai.model.file.mediatype.untested" )
const ( // MediaTypeModelConfig specifies the media type for a model configuration. MediaTypeModelConfig = "application/vnd.cnai.model.config.v1+json" // MediaTypeModelWeightRaw is the media type used for an unarchived, uncompressed model weights. MediaTypeModelWeightRaw = "application/vnd.cnai.model.weight.v1.raw" // MediaTypeModelWeight is the media type used for model weights. MediaTypeModelWeight = "application/vnd.cnai.model.weight.v1.tar" // MediaTypeModelWeightGzip is the media type used for gzipped model weights. MediaTypeModelWeightGzip = "application/vnd.cnai.model.weight.v1.tar+gzip" // MediaTypeModelWeightZstd is the media type used for zstd compressed model weights. MediaTypeModelWeightZstd = "application/vnd.cnai.model.weight.v1.tar+zstd" // MediaTypeModelWeightConfigRaw is the media type used for an unarchived, uncompressed model weights, including files like `tokenizer.json`, `config.json`, etc. MediaTypeModelWeightConfigRaw = "application/vnd.cnai.model.weight.config.v1.raw" // MediaTypeModelConfig specifies the media type for configuration of the model weights, including files like `tokenizer.json`, `config.json`, etc. MediaTypeModelWeightConfig = "application/vnd.cnai.model.weight.config.v1.tar" // MediaTypeModelConfigGzip specifies the media type for gzipped configuration of the model weights, including files like `tokenizer.json`, `config.json`, etc. MediaTypeModelWeightConfigGzip = "application/vnd.cnai.model.weight.config.v1.tar+gzip" // MediaTypeModelConfigZstd specifies the media type for zstd compressed configuration of the model weights, including files like `tokenizer.json`, `config.json`, etc. MediaTypeModelWeightConfigZstd = "application/vnd.cnai.model.weight.config.v1.tar+zstd" // MediaTypeModelDocRaw is the media type used for an unarchived, uncompressed model documentation, including documentation files like `README.md`, `LICENSE`, etc. MediaTypeModelDocRaw = "application/vnd.cnai.model.doc.v1.raw" // MediaTypeModelDoc specifies the media type for model documentation, including documentation files like `README.md`, `LICENSE`, etc. MediaTypeModelDoc = "application/vnd.cnai.model.doc.v1.tar" // MediaTypeModelDocGzip specifies the media type for gzipped model documentation, including documentation files like `README.md`, `LICENSE`, etc. MediaTypeModelDocGzip = "application/vnd.cnai.model.doc.v1.tar+gzip" // MediaTypeModelDocZstd specifies the media type for zstd compressed model documentation, including documentation files like `README.md`, `LICENSE`, etc. MediaTypeModelDocZstd = "application/vnd.cnai.model.doc.v1.tar+zstd" // MediaTypeModelCodeRaw is the media type used for an unarchived, uncompressed model code, including code artifacts like scripts, code files etc. MediaTypeModelCodeRaw = "application/vnd.cnai.model.code.v1.raw" // MediaTypeModelCode specifies the media type for model code, including code artifacts like scripts, code files etc. MediaTypeModelCode = "application/vnd.cnai.model.code.v1.tar" // MediaTypeModelCodeGzip specifies the media type for gzipped model code, including code artifacts like scripts, code files etc. MediaTypeModelCodeGzip = "application/vnd.cnai.model.code.v1.tar+gzip" // MediaTypeModelCodeZstd specifies the media type for zstd compressed model code, including code artifacts like scripts, code files etc. MediaTypeModelCodeZstd = "application/vnd.cnai.model.code.v1.tar+zstd" // MediaTypeModelDatasetRaw is the media type used for an unarchived, uncompressed model datasets, including datasets that may be needed throughout the lifecycle of AI/ML models. MediaTypeModelDatasetRaw = "application/vnd.cnai.model.dataset.v1.raw" // MediaTypeModelDataset specifies the media type for model datasets, including datasets that may be needed throughout the lifecycle of AI/ML models. MediaTypeModelDataset = "application/vnd.cnai.model.dataset.v1.tar" // MediaTypeModelDatasetGzip specifies the media type for gzipped model datasets, including datasets that may be needed throughout the lifecycle of AI/ML models. MediaTypeModelDatasetGzip = "application/vnd.cnai.model.dataset.v1.tar+gzip" // MediaTypeModelDatasetZstd specifies the media type for zstd compressed model datasets, including datasets that may be needed throughout the lifecycle of AI/ML models. MediaTypeModelDatasetZstd = "application/vnd.cnai.model.dataset.v1.tar+zstd" )
const (
// ArtifactTypeModelManifest specifies the artifact type for a model manifest.
ArtifactTypeModelManifest = "application/vnd.cnai.model.manifest.v1+json"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileMetadata ¶ added in v0.0.4
type FileMetadata struct { // File name Name string `json:"name"` // File permission mode (e.g., Unix permission bits) Mode uint32 `json:"mode"` // User ID (identifier of the file owner) Uid uint32 `json:"uid"` // Group ID (identifier of the file's group) Gid uint32 `json:"gid"` // File size (in bytes) Size int64 `json:"size"` // File last modification time ModTime time.Time `json:"mtime"` // File type flag (e.g., regular file, directory, etc.) Typeflag byte `json:"typeflag"` }
FileMetadata represents the metadata of file, which is the value definition of AnnotationFileMetadata.
type Modality ¶ added in v0.0.6
type Modality string
Modality defines the input and output types of the model such as text, image, audio, video, etc. It is used to define the input and output types of the model.
type Model ¶
type Model struct { // The model descriptor Descriptor ModelDescriptor `json:"descriptor"` // The model describes a layer content addresses ModelFS ModelFS `json:"modelfs"` // Config defines the execution parameters which should be used as a base when running a model using an inference engine. Config ModelConfig `json:"config,omitempty"` }
Model defines the basic information of a model. It provides the `application/vnd.cnai.model.config.v1+json` mediatype when marshalled to JSON.
type ModelCapabilities ¶ added in v0.0.6
type ModelCapabilities struct { // The model supports the following input types InputTypes []Modality `json:"input_types,omitempty"` // The model supports the following output types OutputTypes []Modality `json:"output_types,omitempty"` // KnowledgeCutoff is the date of the datasets that the model was trained on, formatted as defined by RFC 3339 KnowledgeCutoff *time.Time `json:"knowledge_cutoff,omitempty"` // Reasoning indicates whether the model can perform reasoning tasks Reasoning *bool `json:"reasoning,omitempty"` // ToolUsage indicates whether the model can use external tools // such as a calculator, a search engine, etc. ToolUsage *bool `json:"tool_usage,omitempty"` }
ModelCapabilities defines the special capabilities that the model supports
type ModelConfig ¶
type ModelConfig struct { // The model architecture, such as transformer, cnn, rnn, etc. Architecture string `json:"architecture,omitempty"` // The model format, such as onnx, tensorflow, pytorch, etc. Format string `json:"format,omitempty"` // The size of the model parameters, such as "8b", "16b", "32b", etc. ParamSize string `json:"paramSize,omitempty"` // The model precision, such as bf16, fp16, int8, mixed etc. Precision string `json:"precision,omitempty"` // The model quantization, such as awq, gptq, etc Quantization string `json:"quantization,omitempty"` // Special capabilities that the model supports Capabilities *ModelCapabilities `json:"capabilities,omitempty"` }
ModelConfig defines the execution parameters which should be used as a base when running a model using an inference engine.
type ModelDescriptor ¶
type ModelDescriptor struct { // Date and time on which the model was built CreatedAt *time.Time `json:"createdAt,omitempty"` // The contact details of the people or organization responsible for the model Authors []string `json:"authors,omitempty"` // The model family, such as llama3, gpt2, qwen2, etc. Family string `json:"family,omitempty"` // The model name, such as llama3-8b-instruct, gpt2-xl, qwen2-vl-72b-instruct, etc. Name string `json:"name,omitempty"` // The URL to get documentation on the model DocURL string `json:"docURL,omitempty"` // The URL to get source code for building the model SourceURL string `json:"sourceURL,omitempty"` // The version of the packaged software Version string `json:"version,omitempty"` // The source control revision identifier for the packaged software Revision string `json:"revision,omitempty"` // The name of the distributing entity, organization or individual Vendor string `json:"vendor,omitempty"` // The license(s) under which contained software is distributed as an SPDX License Expression Licenses []string `json:"licenses,omitempty"` // The human-readable title of the model Title string `json:"title,omitempty"` // The human-readable description of the software packaged in the model Description string `json:"description,omitempty"` }
ModelDescriptor defines the general information of a model
type ModelFS ¶
type ModelFS struct { // Type is the type of the rootfs. MUST be set to "layers". Type string `json:"type"` // DiffIDs is an array of layer content hashes (DiffIDs), in order from bottom-most to top-most. DiffIDs []digest.Digest `json:"diff_ids"` }
ModelFS describes a layer content addresses