models

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListingLive     = "live"
	ListingWaitlist = "waitlist"
	ListingHidden   = "hidden"
)

Listing status values describe how a model is presented on the public catalog. They are independent of the operational lifecycle in Status.

Variables

This section is empty.

Functions

func LicenseTextFor

func LicenseTextFor(identifier string) (string, bool)

LicenseTextFor returns the vendored license text for a manifest license identifier, and whether one exists.

func ReadCatalogFile

func ReadCatalogFile(catalogDir, name string) ([]byte, string, error)

ReadCatalogFile reads a catalog file from disk when present, falling back to the catalog embedded in the binary. Released binaries run from arbitrary working directories with no repo checkout, so the embedded copy is what makes `thirdshift start` work after a plain install.

Types

type Artifact

type Artifact struct {
	URL       string
	SHA256    string
	SizeBytes int64
}

type Cache

type Cache struct {
	Dir        string
	QuotaBytes int64
	HTTPClient *http.Client
}

func (Cache) Ensure

func (c Cache) Ensure(ctx context.Context, artifact Artifact, activeSHA256 string) (string, error)

func (Cache) EnsureLicense

func (c Cache) EnsureLicense(artifactSHA256, text string) (string, error)

EnsureLicense writes a model's license text next to its cached artifact as <sha256>.LICENSE.txt. Licenses that require distribution must accompany the model materials on every host, so callers treat failure as fatal to model preparation.

type Capabilities

type Capabilities struct {
	ChatCompletions bool
	Streaming       bool
	Tools           bool
	Embeddings      bool
}

type Hardware

type Hardware struct {
	MinVRAMMB          int
	MinRAMMB           int
	MinDiskMB          int
	EligibleGPUClasses []string
}

type License

type License struct {
	Identifier          string
	ReviewedAt          string
	Notes               string
	DistributeWithModel bool
	Attribution         *LicenseAttribution
}

type LicenseAttribution

type LicenseAttribution struct {
	DisplayText string
	NoticeText  string
	LicenseURL  string
	AUPURL      string
}

LicenseAttribution carries operator-facing attribution requirements a model license imposes on public surfaces (e.g. "Built with Llama").

type Limits

type Limits struct {
	MaxInputTokens  int
	MaxOutputTokens int
	MaxRequestBytes int
}

type Listing

type Listing struct {
	Status                        string
	Description                   string
	ExpectedOutputTokensPerSecond *float64
	MarketComparison              *MarketComparison
}

type Manifest

type Manifest struct {
	SchemaVersion int
	ModelID       string
	DisplayName   string
	Description   string
	Status        string
	Listing       Listing
	Source        Source
	License       License
	Runtime       Runtime
	Hardware      Hardware
	Limits        Limits
	Capabilities  Capabilities
	Policy        Policy
	Pricing       Pricing
	Verification  Verification
}

func LoadCatalogManifest

func LoadCatalogManifest(catalogDir, modelID string) (Manifest, string, error)

func ParseManifestFile

func ParseManifestFile(path string) (Manifest, error)

func (Manifest) CatalogDescription

func (m Manifest) CatalogDescription() string

CatalogDescription returns the manifest's public one-liner, preferring the listing block over the legacy top-level description. It stays empty when the manifest has neither so readers can fall back to the display name.

func (Manifest) ListingStatus

func (m Manifest) ListingStatus() string

ListingStatus returns the normalized public listing status, defaulting to live so manifests written before the listing block keep their behavior.

type MarketComparison

type MarketComparison struct {
	TypicalInputPerMillionUSD  float64
	TypicalOutputPerMillionUSD float64
	SourceNote                 string
}

type Policy

type Policy struct {
	DataClass            string
	ContentFilterProfile string
}

type Pricing

type Pricing struct {
	CustomerInputPerMillionUSD            float64
	CustomerOutputPerMillionUSD           float64
	HostCreditPerMillionAcceptedOutputUSD float64
}

type Runtime

type Runtime struct {
	Engine          string
	BuildID         string
	ReleaseManifest string
	BinarySHA256    string
	Arguments       RuntimeArguments
}

type RuntimeArguments

type RuntimeArguments struct {
	ContextSize int
	BatchSize   int
	GPULayers   string
	Device      string
	Parallel    int
	Host        string
	Port        string
}

type Source

type Source struct {
	Provider   string
	Repository string
	Revision   string
	File       string
	URL        string
	SHA256     string
	SizeBytes  int64
}

type Verification

type Verification struct {
	DuplicateSampleRate float64
	ChallengeRate       float64
}

Jump to

Keyboard shortcuts

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