Documentation
¶
Index ¶
- Constants
- func Fits(manifest Manifest, host HostCapacity) bool
- func LicenseTextFor(identifier string) (string, bool)
- func ReadCatalogFile(catalogDir, name string) ([]byte, string, error)
- type Artifact
- type Cache
- type Capabilities
- type Hardware
- type HostCapacity
- type License
- type LicenseAttribution
- type Limits
- type Listing
- type Manifest
- type MarketComparison
- type Policy
- type Pricing
- type Runtime
- type RuntimeArguments
- type Selection
- type Source
- type Verification
Constants ¶
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.
const AutoModelID = "auto"
AutoModelID is the explicit way to ask for hardware-based selection. An empty model id means the same thing.
const UnmeasuredVRAMFloorMB int64 = 8192
Fits reports whether the host satisfies a manifest's hardware floor. When VRAM is unknown the VRAM floor cannot be checked and is skipped; the caller is responsible for telling the operator that happened. UnmeasuredVRAMFloorMB is the VRAM an unmeasurable host is assumed to have: the platform minimum, not unlimited. Unmeasured VRAM used to mean "ignore the VRAM requirement", which on a 64GB-RAM machine with an unreadable card selected the largest model in the catalog and would OOM on any ordinary GPU. Assuming the floor picks something that will actually run; an operator who knows the real number can still pass --model explicitly.
const VRAMUnmeasured int64 = -1
VRAMUnmeasured marks a host whose VRAM could not be established. It is distinct from zero so "no measurement" never reads as "no memory".
Variables ¶
This section is empty.
Functions ¶
func Fits ¶
func Fits(manifest Manifest, host HostCapacity) bool
func LicenseTextFor ¶
LicenseTextFor returns the vendored license text for a manifest license identifier, and whether one exists.
func ReadCatalogFile ¶
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 Cache ¶
func (Cache) EnsureLicense ¶
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 HostCapacity ¶
HostCapacity is the measured host, in megabytes. VRAMTotalMB of zero or less means VRAM could not be established; selection then falls back to RAM alone and says so, rather than assuming a size.
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 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 LoadSelectableManifests ¶
LoadSelectableManifests lists every manifest that parses and is not hidden. Names come from the catalog directory when it exists and from the embedded catalog otherwise, because a released binary runs from an arbitrary working directory with no repo checkout — the same reason ReadCatalogFile falls back. Unparseable manifests (placeholders) are skipped, matching catalog sync.
func ParseManifestFile ¶
func (Manifest) CatalogDescription ¶
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 ¶
ListingStatus returns the normalized public listing status, defaulting to live so manifests written before the listing block keep their behavior.
type MarketComparison ¶
type Runtime ¶
type Runtime struct {
Engine string
BuildID string
ReleaseManifest string
BinarySHA256 string
Arguments RuntimeArguments
}
type RuntimeArguments ¶
type Selection ¶
type Selection struct {
ModelID string
Manifest Manifest
Reason string
// VRAMAssumed is true when VRAM could not be measured and the choice rests
// on RAM alone. Callers should surface this prominently.
VRAMAssumed bool
}
Selection is the outcome of auto-selection, carrying the reason so the node can log why this model was chosen.
func ResolveModel ¶
func ResolveModel(requested string, manifests []Manifest, host HostCapacity) (Selection, error)
ResolveModel applies the model flag. An explicit id is honored but still checked against the hardware, so a host fails fast with an actionable message instead of starting something that will exhaust VRAM mid-job.
func SelectModel ¶
func SelectModel(manifests []Manifest, host HostCapacity) (Selection, error)
SelectModel picks the largest catalog model the host can run.