types

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MediaTypeModelConfigV01 is the media type for the model config json.
	MediaTypeModelConfigV01 = types.MediaType("application/vnd.docker.ai.model.config.v0.1+json")

	// MediaTypeGGUF indicates a file in GGUF version 3 format, containing a tensor model.
	MediaTypeGGUF = types.MediaType("application/vnd.docker.ai.gguf.v3")

	// MediaTypeSafetensors indicates a file in safetensors format, containing model weights.
	MediaTypeSafetensors = types.MediaType("application/vnd.docker.ai.safetensors")

	// MediaTypeVLLMConfigArchive indicates a tar archive containing vLLM-specific config files.
	MediaTypeVLLMConfigArchive = types.MediaType("application/vnd.docker.ai.vllm.config.tar")

	// MediaTypeDirTar indicates a tar archive containing a directory with its structure preserved.
	MediaTypeDirTar = types.MediaType("application/vnd.docker.ai.dir.tar")

	// MediaTypeLicense indicates a plain text file containing a license
	MediaTypeLicense = types.MediaType("application/vnd.docker.ai.license")

	// MediaTypeMultimodalProjector indicates a Multimodal projector file
	MediaTypeMultimodalProjector = types.MediaType("application/vnd.docker.ai.mmproj")

	// MediaTypeChatTemplate indicates a Jinja chat template
	MediaTypeChatTemplate = types.MediaType("application/vnd.docker.ai.chat.template.jinja")

	FormatGGUF        = Format("gguf")
	FormatSafetensors = Format("safetensors")

	// AnnotationFilePath specifies the file path of the layer (string)
	AnnotationFilePath = "org.cncf.model.filepath"

	// AnnotationFileMetadata specifies the metadata of the file (string), value is the JSON string of FileMetadata
	AnnotationFileMetadata = "org.cncf.model.file.metadata+json"

	// AnnotationMediaTypeUntested indicates whether the media type classification of files in the layer is untested (string)
	// Valid values are "true" or "false". When set to "true", it signals that the model packager has not verified
	// the media type classification and the type is inferred or assumed based on some heuristics.
	AnnotationMediaTypeUntested = "org.cncf.model.file.mediatype.untested"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Format       Format            `json:"format,omitempty"`
	Quantization string            `json:"quantization,omitempty"`
	Parameters   string            `json:"parameters,omitempty"`
	Architecture string            `json:"architecture,omitempty"`
	Size         string            `json:"size,omitempty"`
	GGUF         map[string]string `json:"gguf,omitempty"`
	Safetensors  map[string]string `json:"safetensors,omitempty"`
	ContextSize  *uint64           `json:"context_size,omitempty"`
}

Config describes the model.

type ConfigFile

type ConfigFile struct {
	Config     Config     `json:"config"`
	Descriptor Descriptor `json:"descriptor"`
	RootFS     v1.RootFS  `json:"rootfs"`
}

type Descriptor

type Descriptor struct {
	Created *time.Time `json:"created,omitempty"`
}

Descriptor provides metadata about the provenance of the model.

type FileMetadata added in v1.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. This follows the OCI image specification for model artifacts.

type Format

type Format string

type Model

type Model interface {
	ID() (string, error)
	GGUFPaths() ([]string, error)
	SafetensorsPaths() ([]string, error)
	ConfigArchivePath() (string, error)
	MMPROJPath() (string, error)
	Config() (Config, error)
	Tags() []string
	Descriptor() (Descriptor, error)
	ChatTemplatePath() (string, error)
}

type ModelArtifact

type ModelArtifact interface {
	ID() (string, error)
	Config() (Config, error)
	Descriptor() (Descriptor, error)
	v1.Image
}

type ModelBundle

type ModelBundle interface {
	RootDir() string
	GGUFPath() string
	SafetensorsPath() string
	ChatTemplatePath() string
	MMPROJPath() string
	RuntimeConfig() Config
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL