manifest

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Defaults

type Defaults struct {
	SDKVersion string `yaml:"sdk_version"`
	CogVersion string `yaml:"cog_version"`
}

Defaults holds default versions

type Expectation

type Expectation struct {
	Type    string         `yaml:"type"`
	Value   any            `yaml:"value"`
	Pattern string         `yaml:"pattern"`
	Mime    string         `yaml:"mime"`
	Match   map[string]any `yaml:"match"`
	Keys    []string       `yaml:"keys"`
}

Expectation represents expected test output

type Manifest

type Manifest struct {
	Defaults Defaults `yaml:"defaults"`
	Models   []Model  `yaml:"models"`
}

Manifest represents the top-level structure of manifest.yaml

func Load

func Load(explicitPath string) (*Manifest, string, error)

Load loads a manifest from the given path or auto-detects it

func (*Manifest) FilterModels

func (m *Manifest) FilterModels(names []string, noGPU, gpuOnly bool) []Model

FilterModels returns models matching the given criteria

func (*Manifest) GetModel

func (m *Manifest) GetModel(name string) *Model

GetModel returns a model by name

type Model

type Model struct {
	Name                 string            `yaml:"name"`
	Repo                 string            `yaml:"repo"`
	Path                 string            `yaml:"path"`
	GPU                  bool              `yaml:"gpu"`
	Timeout              int               `yaml:"timeout"`
	RequiresEnv          []string          `yaml:"requires_env"`
	RequiresTools        []string          `yaml:"requires_tools"`
	Env                  map[string]string `yaml:"env"`
	SDKVersion           string            `yaml:"sdk_version"`
	CogYAMLOverrides     map[string]any    `yaml:"cog_yaml_overrides"`
	Setup                []string          `yaml:"setup"`
	SkipSchemaValidation bool              `yaml:"skip_schema_validation"`
	Tests                []TestCase        `yaml:"tests"`
	TrainTests           []TestCase        `yaml:"train_tests"`
}

Model represents a single model definition

type TestCase

type TestCase struct {
	Description string         `yaml:"description"`
	Inputs      map[string]any `yaml:"inputs"`
	Expect      Expectation    `yaml:"expect"`
}

TestCase represents a single test case

Jump to

Keyboard shortcuts

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