Documentation
¶
Index ¶
- Constants
- func DefaultReference() *registry.Reference
- func FormatRepositoryForDisplay(repo string) string
- func IsModelKitReference(ref string) bool
- func ParseReference(refString string) (reference *registry.Reference, extraTags []string, err error)
- func ReferenceIsDigest(ref string) bool
- type Code
- type DataSet
- type Docs
- type KitFile
- func (kf *KitFile) LoadModel(kitfileContent io.ReadCloser) (err error)
- func (kf *KitFile) MarshalToJSON() ([]byte, error)
- func (kf *KitFile) MarshalToYAML() ([]byte, error)
- func (kf *KitFile) ToModelPackConfig(diffIDs []digest.Digest) modelspecv1.Model
- func (kf *KitFile) Validate() (warnings []string, err error)
- type LayerInfo
- type Model
- type ModelPart
- type Package
- type PathType
- type Prompt
Constants ¶
const ( DefaultRegistry = "localhost" DefaultRepository = "_" )
Variables ¶
This section is empty.
Functions ¶
func DefaultReference ¶ added in v1.12.0
DefaultReference returns a reference that can be used when no reference is supplied. It uses the default registry and repository
func FormatRepositoryForDisplay ¶ added in v1.12.0
FormatRepositoryForDisplay removes default values from a repository string to avoid surfacing defaulted fields when displaying references, which may be confusing.
func IsModelKitReference ¶ added in v1.12.0
IsModelKitReference returns true if the ref string "looks" like a modelkit reference
func ParseReference ¶ added in v1.12.0
func ParseReference(refString string) (reference *registry.Reference, extraTags []string, err error)
ParseReference parses a reference string into a Reference struct. It attempts to make references conform to an expected structure, with a defined registry and repository by filling default values for registry and repository where appropriate. Where the first part of a reference doesn't look like a registry URL, the default registry is used, turning e.g. testorg/testrepo into localhost/testorg/testrepo. If refString does not contain a registry or a repository (i.e. is a base SHA256 hash), the returned reference uses placeholder values for registry and repository.
See FormatRepositoryForDisplay for removing default values from a registry for displaying to the user.
func ReferenceIsDigest ¶ added in v1.12.0
ReferenceIsDigest returns if the reference is a digest. If false, reference should be treated as a tag
Types ¶
type DataSet ¶
type DataSet struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
RemotePath string `json:"remotePath,omitempty" yaml:"remotePath,omitempty"`
RemoteHash string `json:"remoteHash,omitempty" yaml:"remoteHash,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
License string `json:"license,omitempty" yaml:"license,omitempty"`
// Parameters is an arbitrary section of yaml that can be used to store any additional
// metadata relevant to the dataset, with a few caveats:
// * Only a json-compatible subset of yaml is supported
// * Strings will be serialized without flow parameters, etc.
// * Numbers will be converted to decimal representations
// * Maps will be sorted alphabetically by key
// * It's recommended to store metadata like preprocessing steps, formats, etc.
Parameters any `json:"parameters,omitempty" yaml:"parameters,omitempty"`
*LayerInfo `json:",inline" yaml:",inline"`
}
type KitFile ¶
type KitFile struct {
ManifestVersion string `json:"manifestVersion" yaml:"manifestVersion"`
Package Package `json:"package,omitempty" yaml:"package,omitempty"`
Model *Model `json:"model,omitempty" yaml:"model,omitempty"`
Code []Code `json:"code,omitempty" yaml:"code,omitempty"`
DataSets []DataSet `json:"datasets,omitempty" yaml:"datasets,omitempty"`
Docs []Docs `json:"docs,omitempty" yaml:"docs,omitempty"`
Prompts []Prompt `json:"prompts,omitempty" yaml:"prompts,omitempty"`
}
func (*KitFile) MarshalToJSON ¶
func (*KitFile) MarshalToYAML ¶
func (*KitFile) ToModelPackConfig ¶ added in v1.10.0
func (kf *KitFile) ToModelPackConfig(diffIDs []digest.Digest) modelspecv1.Model
type Model ¶
type Model struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
License string `json:"license,omitempty" yaml:"license,omitempty"`
Framework string `json:"framework,omitempty" yaml:"framework,omitempty"`
Format string `json:"format,omitempty" yaml:"format,omitempty"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Parts []ModelPart `json:"parts,omitempty" yaml:"parts,omitempty"`
// Parameters is an arbitrary section of yaml that can be used to store any additional
// data that may be relevant to the current model, with a few caveats:
// * Only a json-compatible subset of yaml is supported
// * Strings will be serialized without flow parameters, etc.
// * Numbers will be converted to decimal representations (0xFF -> 255, 1.2e+3 -> 1200)
// * Maps will be sorted alphabetically by key
Parameters any `json:"parameters,omitempty" yaml:"parameters,omitempty"`
*LayerInfo `json:",inline" yaml:",inline"`
}
type ModelPart ¶
type ModelPart struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
License string `json:"license,omitempty" yaml:"license,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
*LayerInfo `json:",inline" yaml:",inline"`
}
type Package ¶
type Package struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
License string `json:"license,omitempty" yaml:"license,omitempty"`
Authors []string `json:"authors,omitempty" yaml:"authors,omitempty,flow"`
}
type PathType ¶ added in v1.12.0
type PathType int
PathType represents different types of paths in Kitfile fields, e.g. local on-disk paths or remote S3 URLs.