Documentation
¶
Index ¶
- Constants
- func BaseRefFor(id ModelID) string
- func CanonicalizeModifiers(mods []string) []string
- func ClassifyIDPrefix(id ModelID, p Provider) (IDPrefixClass, ModelID)
- func ContextWindowFor(id ModelID) int
- func DefaultDBPath() (string, error)
- func DerivedWeightsBytes(totalParams int64, q Quantization) (int64, bool)
- func DetectHost(id ModelID) (Host, ModelID)
- func DetectQuantization(id ModelID) (Quantization, string, ModelID)
- func EnrichedParamSize(id string) (token string, err error)
- func EntityKeys() []string
- func EntityModifiers(mods []string, fam Family) []string
- func EstimateVRAMBytes(weightsBytes int64, contextTokens, layers, kvHeads, headDim int) int64
- func ExtractDate(id ModelID, releaseDate string) string
- func ExtractModifier(id ModelID, family Family, variant string) (modifier string, modifierConsumed string)
- func ExtractParamSizeToken(id string) (token string, ok bool)
- func ExtractVersionBetweenFamilyAndVariant(id ModelID, family Family, variant string) (version string, residual []string)
- func ExtractVersionFromID(id ModelID, rawFamily Family) string
- func FamiliesJSONKeyError(data []byte) error
- func FamilyAliasesJSONError(data []byte) error
- func FormatAmbiguous(w io.Writer, e *ErrAmbiguous)
- func FormatModel(w io.Writer, model ModelInfo, format OutputFormat) error
- func FormatModels(w io.Writer, models []ModelInfo, format OutputFormat) error
- func IsArchiveSnapshotURL(url string) bool
- func IsEnforcedCanonicalFamily(f Family) bool
- func IsKnownFamily(f Family) bool
- func JoinEntityMetadata(ents []Entity, meta []EntityMetadata) (attached []Entity, unlinked []MetadataID, standalone []Entity)
- func ParamSizeFor(id ModelID) string
- func ParseDataReady() error
- func ParseFamilyDetailed(raw Family, id ModelID, p Provider) (Family, string, string, []string, *ParseFailure)
- func ParseParamSize(raw string) (string, error)
- func PreferredNomenValue(ref EntityRef) string
- func SuppressedModifiers(ref EntityRef) []string
- func VRAMEstimateIsPartial(layers, kvHeads, headDim int) bool
- func ValidateCreatorProviderTable() error
- func ValidateCreatorTable() error
- func ValidateDataSourceTable() error
- func ValidateEntitySourceTable() error
- func ValidateHFNomina() error
- func ValidateLineageTable() error
- func ValidateNoBetaInIdentity(entities []Entity) error
- func ValidateNomina(nomina []Nomen) error
- func ValidateParamSizePins() error
- func ValidateQuantVRAMTable() error
- func ValidateSuppression(entities []Entity) error
- func ValidateSuppressionSeed() error
- type AcceptabilityRating
- type AttestationAuthority
- type BenchmarkResult
- type CanonicalFilter
- type CanonicalScheme
- type Capability
- type CapabilityUnion
- type Catalog
- type Client
- func (c *Client) FetchCatalog(ctx context.Context) (Catalog, error)
- func (c *Client) FetchModelMetadata(ctx context.Context) ([]EntityMetadata, error)
- func (c *Client) FetchModels(ctx context.Context) ([]ModelInfo, error)
- func (c *Client) FetchModelsByProvider(ctx context.Context, p Provider) ([]ModelInfo, error)
- type ClientOption
- type ContextBound
- type CostTier
- type Creator
- type CreatorGroup
- type CreatorLabClass
- type CreatorLabDisagreement
- type DataSource
- type DataSourceID
- type DatasetIngested
- type DerivationKind
- type Designation
- type Entity
- type EntityMetadata
- type EntityRef
- type EntitySource
- type ErrAPIUnavailable
- type ErrAmbiguous
- type ErrNotFound
- type Family
- type FamilyGroup
- type FitBudget
- type FitFilter
- type FitResult
- type FitRow
- type Harness
- type Host
- type IDPrefixClass
- type IngestMethod
- type InputFormat
- type LineageEdge
- type LineageRecord
- type LinkType
- type MetadataID
- type Modalities
- type Modality
- type ModelID
- type ModelInfo
- func LookupModel(id ModelID) (ModelInfo, bool)
- func LookupModelByProvider(p Provider, name string) (ModelInfo, bool)
- func MergeModels(static, cached []ModelInfo) []ModelInfo
- func Models() []ModelInfo
- func ModelsByFamily(family Family) []ModelInfo
- func ModelsByProvider(p Provider) []ModelInfo
- func ParseAPIJSON(data []byte) ([]ModelInfo, error)
- func StaticModels() []ModelInfo
- type ModelLink
- type ModelRef
- type ModelStatus
- type ModifierClass
- type Nomen
- type NomenAttestation
- type NomenScheme
- type OutputFormat
- type ParamShape
- type ParseAttempt
- type ParseFailure
- type ParseFailureReason
- type ParseFailuresEnvelope
- type Provider
- type ProviderInstance
- type QuantVRAM
- type Quantization
- type ReasoningOption
- type ReasoningOptionKind
- type Region
- type Release
- type ReleaseGroup
- type ReleaseStage
- type ResolveOption
- type Series
- type SeriesGroup
- type SeriesShape
- type Store
- func (s *Store) Close() error
- func (s *Store) QueryByCanonical(ctx context.Context, f CanonicalFilter) ([]ModelInfo, error)
- func (s *Store) QueryCreators(ctx context.Context) (map[Family]Creator, error)
- func (s *Store) QueryCurrentIngests(ctx context.Context) ([]DatasetIngested, error)
- func (s *Store) QueryEntityMetadata(ctx context.Context) ([]EntityMetadata, error)
- func (s *Store) QueryIngestHistory(ctx context.Context, id DataSourceID) ([]DatasetIngested, error)
- func (s *Store) QueryModel(ctx context.Context, id ModelID) (ModelInfo, error)
- func (s *Store) QueryModels(ctx context.Context, provider Provider) ([]ModelInfo, error)
- func (s *Store) QueryModelsByID(ctx context.Context, id ModelID) ([]ModelInfo, error)
- func (s *Store) QueryNomina(ctx context.Context) ([]Nomen, error)
- func (s *Store) UpsertCreators(ctx context.Context) error
- func (s *Store) UpsertDataSources(ctx context.Context, sources []DataSource, ingested []DatasetIngested) error
- func (s *Store) UpsertEntityMetadata(ctx context.Context, rows []EntityMetadata) error
- func (s *Store) UpsertEntitySources(ctx context.Context, sources []EntitySource) error
- func (s *Store) UpsertModels(ctx context.Context, models []ModelInfo) error
- func (s *Store) UpsertNomina(ctx context.Context, nomina []Nomen) error
- type SuppressionEntry
- type TierCost
- type WeightsBasis
Constants ¶
const ( Entity__Abliterated = "abliterated" Entity__Abliterated_model__Large = "abliterated-model/large" Entity__Active = "active" Entity__Agent = "agent" Entity__Agents = "agents" Entity__Agi__Mini = "agi/mini" Entity__Agi__Pro = "agi/pro" Entity__Agi__Version_01 = "agi@01" Entity__Agnes__Flash__Version_2_0 = "agnes/flash@2.0" Entity__Agnes__Flash__Version_2_5 = "agnes/flash@2.5" Entity__Agnes__Lite__Version_1_5 = "agnes/lite@1.5" Entity__Agnes__Pro__Version_1_5 = "agnes/pro@1.5" Entity__Agnes__Pro__Version_2_5 = "agnes/pro@2.5" Entity__Aion__Mini__Version_3_0 = "aion/mini@3.0" Entity__Aion__Size_8b = "aion#8b" Entity__Aion__Version_2_0 = "aion@2.0" Entity__Aion__Version_3_0 = "aion@3.0" Entity__Aion_labs_aion_3_0__Mini__Version_3_0 = "aion-labs-aion-3-0/mini@3.0" Entity__Aion_labs_aion__Version_3_0 = "aion-labs-aion@3.0" Entity__Allam__Version_2__Size_7b = "allam@2#7b" Entity__Amazon = "amazon" Entity__Anubis_70b__V1_1__Size_70b = "anubis-70b/v1.1#70b" Entity__Anubis__Size_70b = "anubis#70b" Entity__Apertus__Size_70b = "apertus#70b" Entity__Apertus__Size_70b__Instruct = "apertus#70b{instruct}" Entity__Apertus__Size_8b__Instruct = "apertus#8b{instruct}" Entity__Apertus__V1_5_70B__Size_70b = "apertus/v1.5-70B#70b" Entity__Arrow__Version_1_1 = "arrow@1.1" Entity__Asi1__Mini = "asi1/mini" Entity__Asure__Size_12b = "asure#12b" Entity__Auto = "auto" Entity__Auto__Code = "auto{code}" Entity__Auto__Small = "auto/small" Entity__Autoglm__Size_9b = "autoglm#9b" Entity__Baichuan = "baichuan" Entity__Baichuan__Size_32b = "baichuan#32b" Entity__Baichuan__Turbo = "baichuan{turbo}" Entity__Bevformer = "bevformer" Entity__Bge = "bge" Entity__Bielik_11b__V2_6_Instruct__Size_11b__Instruct = "bielik-11b/v2.6-Instruct#11b{instruct}" Entity__Bielik_11b__V3_0_Instruct__Size_11b__Instruct = "bielik-11b/v3.0-Instruct#11b{instruct}" Entity__Big_pickle = "big-pickle" Entity__Bodybuilder = "bodybuilder" Entity__Brave = "brave" Entity__Brave__Pro = "brave/pro" Entity__Brick_complexity__Pro = "brick-complexity/pro" Entity__C4ai__Size_32b = "c4ai#32b" Entity__C4ai__Size_32b__Vision = "c4ai#32b{vision}" Entity__C4ai__Size_8b = "c4ai#8b" Entity__C4ai__Size_8b__Vision = "c4ai#8b{vision}" Entity__Canopylabs = "canopylabs" Entity__Celeris__Version_1 = "celeris@1" Entity__Cheap = "cheap" Entity__Chutesai__Size_24b__Instruct = "chutesai#24b{instruct}" Entity__Claude__Code = "claude{code}" Entity__Claude__Fable = "claude/fable" Entity__Claude__Fable__Version_5 = "claude/fable@5" Entity__Claude__Haiku = "claude/haiku" Entity__Claude__Haiku__Version_3 = "claude/haiku@3" Entity__Claude__Haiku__Version_3_5 = "claude/haiku@3.5" Entity__Claude__Haiku__Version_4_5 = "claude/haiku@4.5" Entity__Claude__Opus = "claude/opus" Entity__Claude__Opus__Version_3 = "claude/opus@3" Entity__Claude__Opus__Version_4_0 = "claude/opus@4.0" Entity__Claude__Opus__Version_4_1 = "claude/opus@4.1" Entity__Claude__Opus__Version_4_5 = "claude/opus@4.5" Entity__Claude__Opus__Version_4_6 = "claude/opus@4.6" Entity__Claude__Opus__Version_4_7 = "claude/opus@4.7" Entity__Claude__Opus__Version_4_8 = "claude/opus@4.8" Entity__Claude__Opus__Version_5 = "claude/opus@5" Entity__Claude__Sonnet = "claude/sonnet" Entity__Claude__Sonnet__Version_3_5 = "claude/sonnet@3.5" Entity__Claude__Sonnet__Version_3_7 = "claude/sonnet@3.7" Entity__Claude__Sonnet__Version_4_0 = "claude/sonnet@4.0" Entity__Claude__Sonnet__Version_4_5 = "claude/sonnet@4.5" Entity__Claude__Sonnet__Version_4_6 = "claude/sonnet@4.6" Entity__Claude__Sonnet__Version_5 = "claude/sonnet@5" Entity__Claude_mythos__Version_5 = "claude-mythos@5" Entity__Claudinio = "claudinio" Entity__Claudius = "claudius" Entity__Claw = "claw" Entity__Claw__Medium = "claw/medium" Entity__Code = "code" Entity__Codestral = "codestral" Entity__Codestral__Embed = "codestral/embed" Entity__Codestral__Version_0_1__Size_22b = "codestral@0.1#22b" Entity__Coding = "coding" Entity__Cogito__Version_2_1__Size_671b = "cogito@2.1#671b" Entity__Cohere__Embed = "cohere/embed" Entity__Command__A = "command/a" Entity__Command__A__Reasoning = "command/a{reasoning}" Entity__Command__A__Translate = "command/a{translate}" Entity__Command__A__Vision = "command/a{vision}" Entity__Command__A_plus = "command/a-plus" Entity__Command__R = "command/r" Entity__Command__R7b__Size_7b = "command/r7b#7b" Entity__Command__R_plus = "command/r-plus" Entity__Cosmos3 = "cosmos3" Entity__Cosmos__Size_2b = "cosmos#2b" Entity__Cosmos__Size_5b = "cosmos#5b" Entity__Cosmos__Size_7b = "cosmos#7b" Entity__Cosmos__Size_8b = "cosmos#8b" Entity__Cydonia_24b__V4_1__Size_24b = "cydonia-24b/v4.1#24b" Entity__Cydonia_24b__V4_3__Size_24b = "cydonia-24b/v4.3#24b" Entity__Cydonia__Size_24b = "cydonia#24b" Entity__Dall_e__Version_3 = "dall-e@3" Entity__Deepclaude = "deepclaude" Entity__Deepseek = "deepseek" Entity__Deepseek__Chat = "deepseek/chat" Entity__Deepseek__Chat__Version_3_1 = "deepseek/chat@3.1" Entity__Deepseek__Flash = "deepseek/flash" Entity__Deepseek__Flash__Size_284b = "deepseek/flash#284b" Entity__Deepseek__Flash__Version_4 = "deepseek/flash@4" Entity__Deepseek__Pro = "deepseek/pro" Entity__Deepseek__Size_14b = "deepseek#14b" Entity__Deepseek__Size_32b = "deepseek#32b" Entity__Deepseek__Size_671b = "deepseek#671b" Entity__Deepseek__Size_70b = "deepseek#70b" Entity__Deepseek__Size_8b = "deepseek#8b" Entity__Deepseek__Turbo = "deepseek{turbo}" Entity__Deepseek__V3_1 = "deepseek/v3.1" Entity__Deepseek__V3_1_maas = "deepseek/v3.1-maas" Entity__Deepseek__V3_1_terminus = "deepseek/v3.1-terminus" Entity__Deepseek__V3_2 = "deepseek/v3.2" Entity__Deepseek__V3_2_251201 = "deepseek/v3.2-251201" Entity__Deepseek__V3_2_exp = "deepseek/v3.2-exp" Entity__Deepseek__V3_2_maas = "deepseek/v3.2-maas" Entity__Deepseek__V3_2_speciale = "deepseek/v3.2-speciale" Entity__Deepseek__Version_2 = "deepseek@2" Entity__Deepseek__Version_3_2 = "deepseek@3.2" Entity__Deepseek_ocr__Version_2 = "deepseek-ocr@2" Entity__Devstral = "devstral" Entity__Devstral__Medium = "devstral/medium" Entity__Devstral__Small = "devstral/small" Entity__Devstral__Small__Version_2 = "devstral/small@2" Entity__Devstral__Version_2 = "devstral@2" Entity__Devstral__Version_2__Size_123b = "devstral@2#123b" Entity__Devstral__Version_2__Size_123b__Instruct = "devstral@2#123b{instruct}" Entity__Diffusiongemma__Size_26b_a4b = "diffusiongemma#26b-a4b" Entity__Dots__Version_3 = "dots@3" Entity__Doubao_1_5_thinking__Pro__Version_1_5 = "doubao-1.5-thinking/pro@1.5" Entity__Doubao_1_5_vision__Pro__Version_1_5 = "doubao-1.5-vision/pro@1.5" Entity__Doubao__Code = "doubao{code}" Entity__Doubao__Version_1_5 = "doubao@1.5" Entity__Doubao__Version_1_6 = "doubao@1.6" Entity__Doubao__Version_1_6__Vision = "doubao@1.6{vision}" Entity__Doubao_seed__Flash__Version_1_6 = "doubao-seed/flash@1.6" Entity__Doubao_seed__Lite__Version_2_0 = "doubao-seed/lite@2.0" Entity__Doubao_seed__Mini__Version_2_0 = "doubao-seed/mini@2.0" Entity__Doubao_seed__Pro__Version_2_0 = "doubao-seed/pro@2.0" Entity__Doubao_seed__Version_1_6 = "doubao-seed@1.6" Entity__Doubao_seed__Version_1_8 = "doubao-seed@1.8" Entity__Doubao_seed__Version_2_0__Code = "doubao-seed@2.0{code}" Entity__Doubao_seed_code_preview__Code = "doubao-seed-code-preview{code}" Entity__Dracarys__Size_70b__Instruct = "dracarys#70b{instruct}" Entity__Dracarys__Size_72b = "dracarys#72b" Entity__E2e = "e2e" Entity__Echo = "echo" Entity__Elevenlabs = "elevenlabs" Entity__Elevenlabs__V2_5__Turbo = "elevenlabs/v2.5{turbo}" Entity__Ernie = "ernie" Entity__Ernie__Version_4_5__Size_21b_a3b = "ernie@4.5#21b-a3b" Entity__Ernie__Version_4_5__Size_28b_a3b = "ernie@4.5#28b-a3b" Entity__Ernie__Version_4_5__Size_300b_a47b = "ernie@4.5#300b-a47b" Entity__Ernie__Version_4_5__Size_424b_a47b = "ernie@4.5#424b-a47b" Entity__Ernie__Version_5_0 = "ernie@5.0" Entity__Ernie__Version_5_1 = "ernie@5.1" Entity__Esm2__Size_650m = "esm2#650m" Entity__Esmfold = "esmfold" Entity__Eva__Version_0_2__Size_32b = "eva@0.2#32b" Entity__Exa = "exa" Entity__Fast__Fast = "fast{fast}" Entity__Fastgpt = "fastgpt" Entity__Fish_audio__S__Version_1 = "fish-audio/s@1" Entity__Fish_audio__S__Version_2_1__Pro = "fish-audio/s@2.1{pro}" Entity__Fish_audio__S__Version_2__Pro = "fish-audio/s@2{pro}" Entity__Fish_audio__Transcribe__Version_1 = "fish-audio/transcribe@1" Entity__Flux = "flux" Entity__Flux_1 = "flux_1" Entity__Flux__Pro = "flux/pro" Entity__Flux__Pro__Version_1_1 = "flux/pro@1.1" Entity__Flux__Pro__Version_2 = "flux/pro@2" Entity__Flux__Size_4b = "flux#4b" Entity__Flux__Version_2 = "flux@2" Entity__Flux__Version_2__Size_4b = "flux@2#4b" Entity__Flux__Version_2__Size_9b = "flux@2#9b" Entity__Flux__Version_3 = "flux@3" Entity__Free = "free" Entity__Fugu = "fugu" Entity__Fugu__Ultra = "fugu/ultra" Entity__Fugu__Ultra__Version_0 = "fugu/ultra@0" Entity__Fugu__Ultra__Version_1 = "fugu/ultra@1" Entity__Fugu__Ultra__Version_1_1 = "fugu/ultra@1.1" Entity__Fusion = "fusion" Entity__Gelab__Size_4b = "gelab#4b" Entity__Gemini = "gemini" Entity__Gemini__Deep_research = "gemini/deep-research" Entity__Gemini__Embedding = "gemini/embedding" Entity__Gemini__Embedding__Version_001 = "gemini/embedding@001" Entity__Gemini__Embedding__Version_2 = "gemini/embedding@2" Entity__Gemini__Flash = "gemini/flash" Entity__Gemini__Flash__Omni = "gemini/flash{omni}" Entity__Gemini__Flash__Version_2_0 = "gemini/flash@2.0" Entity__Gemini__Flash__Version_2_5 = "gemini/flash@2.5" Entity__Gemini__Flash__Version_3_0 = "gemini/flash@3.0" Entity__Gemini__Flash__Version_3_1 = "gemini/flash@3.1" Entity__Gemini__Flash__Version_3_5 = "gemini/flash@3.5" Entity__Gemini__Flash__Version_3_6 = "gemini/flash@3.6" Entity__Gemini__Flash__Version_3_7 = "gemini/flash@3.7" Entity__Gemini__Flash_lite = "gemini/flash-lite" Entity__Gemini__Flash_lite__Version_2_0 = "gemini/flash-lite@2.0" Entity__Gemini__Flash_lite__Version_2_5 = "gemini/flash-lite@2.5" Entity__Gemini__Flash_lite__Version_3_1 = "gemini/flash-lite@3.1" Entity__Gemini__Flash_lite__Version_3_5 = "gemini/flash-lite@3.5" Entity__Gemini__Pro = "gemini/pro" Entity__Gemini__Pro__Version_2_0 = "gemini/pro@2.0" Entity__Gemini__Pro__Version_2_5 = "gemini/pro@2.5" Entity__Gemini__Pro__Version_3_0 = "gemini/pro@3.0" Entity__Gemini__Pro__Version_3_1 = "gemini/pro@3.1" Entity__Gemini__Pro__Version_3_5__Translate = "gemini/pro@3.5{translate}" Entity__Gemini__Version_3_5 = "gemini@3.5" Entity__Gemma = "gemma" Entity__Gemma__Size_26b = "gemma#26b" Entity__Gemma__Size_27b = "gemma#27b" Entity__Gemma__Size_31b = "gemma#31b" Entity__Gemma__Size_9b = "gemma#9b" Entity__Gemma__Version_2__Size_27b = "gemma@2#27b" Entity__Gemma__Version_2__Size_2b = "gemma@2#2b" Entity__Gemma__Version_3 = "gemma@3" Entity__Gemma__Version_3__Size_12b = "gemma@3#12b" Entity__Gemma__Version_3__Size_27b = "gemma@3#27b" Entity__Gemma__Version_3__Size_4b = "gemma@3#4b" Entity__Gemma__Version_4 = "gemma@4" Entity__Gemma__Version_4__Size_12b = "gemma@4#12b" Entity__Gemma__Version_4__Size_26b_a4b = "gemma@4#26b-a4b" Entity__Gemma__Version_4__Size_31b = "gemma@4#31b" Entity__Gemma__Version_4__Size_31b__Turbo = "gemma@4#31b{turbo}" Entity__Gliguard__Size_300m = "gliguard#300m" Entity__Gliner = "gliner" Entity__Gliner2 = "gliner2" Entity__Gliner2__Base = "gliner2{base}" Entity__Glm = "glm" Entity__Glm__Air = "glm/air" Entity__Glm__Air__Version_4 = "glm/air@4" Entity__Glm__Air__Version_4_5 = "glm/air@4.5" Entity__Glm__Flash = "glm/flash" Entity__Glm__Flash__Version_4 = "glm/flash@4" Entity__Glm__Flash__Version_4_5 = "glm/flash@4.5" Entity__Glm__Flash__Version_4_7 = "glm/flash@4.7" Entity__Glm__Flash__Version_5_3 = "glm/flash@5.3" Entity__Glm__Large = "glm/large" Entity__Glm__Lite__Version_5_2 = "glm/lite@5.2" Entity__Glm__Ultra__Version_5_2 = "glm/ultra@5.2" Entity__Glm__V__Version_4_1 = "glm/v@4.1" Entity__Glm__V__Version_4_1__Flash = "glm/v@4.1{flash}" Entity__Glm__V__Version_4_5 = "glm/v@4.5" Entity__Glm__V__Version_4_6 = "glm/v@4.6" Entity__Glm__V__Version_4_6__Flash = "glm/v@4.6{flash}" Entity__Glm__V__Version_5 = "glm/v@5" Entity__Glm__V__Version_5__Z = "glm/v@5{z}" Entity__Glm__V__Version_6__Flash = "glm/v@6{flash}" Entity__Glm__Version_4 = "glm@4" Entity__Glm__Version_4_5 = "glm@4.5" Entity__Glm__Version_4_6 = "glm@4.6" Entity__Glm__Version_4_7 = "glm@4.7" Entity__Glm__Version_4__Size_32b = "glm@4#32b" Entity__Glm__Version_4__Size_9b = "glm@4#9b" Entity__Glm__Version_5 = "glm@5" Entity__Glm__Version_5_1 = "glm@5.1" Entity__Glm__Version_5_2 = "glm@5.2" Entity__Glm__Version_5_3 = "glm@5.3" Entity__Glm__Z = "glm/z" Entity__Glm__Z__Size_9b = "glm/z#9b" Entity__Google = "google" Entity__Gpt = "gpt" Entity__Gpt__4o = "gpt/4o" Entity__Gpt__4o__Fast = "gpt/4o{fast}" Entity__Gpt__4o__Fast__Mini = "gpt/4o{fast,mini}" Entity__Gpt__4o__Mini = "gpt/4o{mini}" Entity__Gpt__Audio = "gpt/audio" Entity__Gpt__Audio__Mini = "gpt/audio{mini}" Entity__Gpt__Chat = "gpt{chat}" Entity__Gpt__Codex = "gpt/codex" Entity__Gpt__Codex__Version_5 = "gpt/codex@5" Entity__Gpt__Codex__Version_5_1 = "gpt/codex@5.1" Entity__Gpt__Codex__Version_5_2 = "gpt/codex@5.2" Entity__Gpt__Codex__Version_5_3 = "gpt/codex@5.3" Entity__Gpt__Codex__Version_5_3__Fast = "gpt/codex@5.3{fast}" Entity__Gpt__Codex_mini = "gpt/codex-mini" Entity__Gpt__Codex_mini__Version_5_1 = "gpt/codex-mini@5.1" Entity__Gpt__Codex_spark__Version_5_3 = "gpt/codex-spark@5.3" Entity__Gpt__Image = "gpt/image" Entity__Gpt__Image__Version_1 = "gpt/image@1" Entity__Gpt__Image__Version_1_5 = "gpt/image@1.5" Entity__Gpt__Image__Version_2 = "gpt/image@2" Entity__Gpt__Image__Version_5 = "gpt/image@5" Entity__Gpt__Image__Version_5_4 = "gpt/image@5.4" Entity__Gpt__Luna = "gpt/luna" Entity__Gpt__Luna__Version_5_6 = "gpt/luna@5.6" Entity__Gpt__Luna__Version_5_6__Fast = "gpt/luna@5.6{fast}" Entity__Gpt__Luna__Version_5_6__Pro = "gpt/luna@5.6{pro}" Entity__Gpt__Mini = "gpt/mini" Entity__Gpt__Mini__Version_4_1 = "gpt/mini@4.1" Entity__Gpt__Mini__Version_4_1__Fast = "gpt/mini@4.1{fast}" Entity__Gpt__Mini__Version_5 = "gpt/mini@5" Entity__Gpt__Mini__Version_5_4 = "gpt/mini@5.4" Entity__Gpt__Mini__Version_5_4__Fast = "gpt/mini@5.4{fast}" Entity__Gpt__Mini__Version_5__Fast = "gpt/mini@5{fast}" Entity__Gpt__Nano = "gpt/nano" Entity__Gpt__Nano__Version_4_1 = "gpt/nano@4.1" Entity__Gpt__Nano__Version_4_1__Fast = "gpt/nano@4.1{fast}" Entity__Gpt__Nano__Version_5 = "gpt/nano@5" Entity__Gpt__Nano__Version_5_4 = "gpt/nano@5.4" Entity__Gpt__O__Version_1 = "gpt/o@1" Entity__Gpt__O__Version_1__Mini = "gpt/o@1{mini}" Entity__Gpt__O__Version_1__Pro = "gpt/o@1{pro}" Entity__Gpt__O__Version_3 = "gpt/o@3" Entity__Gpt__O__Version_3__Deep_research = "gpt/o@3{deep-research}" Entity__Gpt__O__Version_3__Fast = "gpt/o@3{fast}" Entity__Gpt__O__Version_3__Mini = "gpt/o@3{mini}" Entity__Gpt__O__Version_3__Pro = "gpt/o@3{pro}" Entity__Gpt__O__Version_4__Fast__Mini = "gpt/o@4{fast,mini}" Entity__Gpt__O__Version_4__Mini = "gpt/o@4{mini}" Entity__Gpt__Oss = "gpt/oss" Entity__Gpt__Oss__Size_120b = "gpt/oss#120b" Entity__Gpt__Oss__Size_120b__Fast = "gpt/oss#120b{fast}" Entity__Gpt__Oss__Size_20b = "gpt/oss#20b" Entity__Gpt__Pro = "gpt/pro" Entity__Gpt__Pro__Version_5 = "gpt/pro@5" Entity__Gpt__Pro__Version_5_2 = "gpt/pro@5.2" Entity__Gpt__Pro__Version_5_4 = "gpt/pro@5.4" Entity__Gpt__Pro__Version_5_5 = "gpt/pro@5.5" Entity__Gpt__Sol = "gpt/sol" Entity__Gpt__Sol__Version_5_6 = "gpt/sol@5.6" Entity__Gpt__Sol__Version_5_6__Fast = "gpt/sol@5.6{fast}" Entity__Gpt__Sol__Version_5_6__Pro = "gpt/sol@5.6{pro}" Entity__Gpt__Terra = "gpt/terra" Entity__Gpt__Terra__Version_5_6 = "gpt/terra@5.6" Entity__Gpt__Terra__Version_5_6__Fast = "gpt/terra@5.6{fast}" Entity__Gpt__Terra__Version_5_6__Pro = "gpt/terra@5.6{pro}" Entity__Gpt__Version_1_5 = "gpt@1.5" Entity__Gpt__Version_2 = "gpt@2" Entity__Gpt__Version_2_1 = "gpt@2.1" Entity__Gpt__Version_3_5__Instruct__Turbo = "gpt@3.5{turbo,instruct}" Entity__Gpt__Version_3_5__Turbo = "gpt@3.5{turbo}" Entity__Gpt__Version_4 = "gpt@4" Entity__Gpt__Version_4_1 = "gpt@4.1" Entity__Gpt__Version_4_1__Fast = "gpt@4.1{fast}" Entity__Gpt__Version_4__Turbo = "gpt@4{turbo}" Entity__Gpt__Version_4__Turbo__Vision = "gpt@4{vision,turbo}" Entity__Gpt__Version_5 = "gpt@5" Entity__Gpt__Version_5_1 = "gpt@5.1" Entity__Gpt__Version_5_1__Chat = "gpt@5.1{chat}" Entity__Gpt__Version_5_1__Fast = "gpt@5.1{fast}" Entity__Gpt__Version_5_2 = "gpt@5.2" Entity__Gpt__Version_5_2__Chat = "gpt@5.2{chat}" Entity__Gpt__Version_5_2__Fast = "gpt@5.2{fast}" Entity__Gpt__Version_5_3 = "gpt@5.3" Entity__Gpt__Version_5_3__Chat = "gpt@5.3{chat}" Entity__Gpt__Version_5_4 = "gpt@5.4" Entity__Gpt__Version_5_4__Fast = "gpt@5.4{fast}" Entity__Gpt__Version_5_5 = "gpt@5.5" Entity__Gpt__Version_5_5__Fast = "gpt@5.5{fast}" Entity__Gpt__Version_5__Chat = "gpt@5{chat}" Entity__Gpt__Version_5__Fast = "gpt@5{fast}" Entity__Granite__Small__Version_4 = "granite/small@4" Entity__Granite__Version_4_0 = "granite@4.0" Entity__Granite__Version_4_1__Size_8b = "granite@4.1#8b" Entity__Granite__Version_4_2__Size_8b = "granite@4.2#8b" Entity__Green = "green" Entity__Green_s__Pro = "green-s/pro" Entity__Greg = "greg" Entity__Greg_1__Mini__Version_1 = "greg-1/mini@1" Entity__Greg_2__Ultra__Version_2 = "greg-2/ultra@2" Entity__Greg__Version_2 = "greg@2" Entity__Grok = "grok" Entity__Grok__Code = "grok{code}" Entity__Grok__Code_fast__Version_1 = "grok/code-fast@1" Entity__Grok__Image = "grok/image" Entity__Grok__Mini__Version_3 = "grok/mini@3" Entity__Grok__Version_3 = "grok@3" Entity__Grok__Version_4 = "grok@4" Entity__Grok__Version_4_1 = "grok@4.1" Entity__Grok__Version_4_1__Fast = "grok@4.1{fast}" Entity__Grok__Version_4_1__Fast__Reasoning = "grok@4.1{reasoning,fast}" Entity__Grok__Version_4_1__Non_reasoning = "grok@4.1{non-reasoning}" Entity__Grok__Version_4_2 = "grok@4.2" Entity__Grok__Version_4_20 = "grok@4.20" Entity__Grok__Version_4_20__Non_reasoning = "grok@4.20{non-reasoning}" Entity__Grok__Version_4_20__Reasoning = "grok@4.20{reasoning}" Entity__Grok__Version_4_2__Fast = "grok@4.2{fast}" Entity__Grok__Version_4_2__Non_reasoning = "grok@4.2{non-reasoning}" Entity__Grok__Version_4_3 = "grok@4.3" Entity__Grok__Version_4_5 = "grok@4.5" Entity__Grok__Version_4_6 = "grok@4.6" Entity__Grok__Version_4__Fast = "grok@4{fast}" Entity__Grok__Version_4__Fast__Reasoning = "grok@4{reasoning,fast}" Entity__Grok__Version_4__Non_reasoning = "grok@4{non-reasoning}" Entity__Grok_build__Version_0_1 = "grok-build@0.1" Entity__Groq = "groq" Entity__Groq__Mini = "groq/mini" Entity__Happyhorse__Version_1_1 = "happyhorse@1.1" Entity__Hermes = "hermes" Entity__Hermes__Medium = "hermes/medium" Entity__Hermes__Pro__Version_2__Size_8b = "hermes/pro@2#8b" Entity__Hermes__Version_3__Size_405b = "hermes@3#405b" Entity__Hermes__Version_3__Size_70b = "hermes@3#70b" Entity__Hermes__Version_4__Size_405b = "hermes@4#405b" Entity__Hermes__Version_4__Size_70b = "hermes@4#70b" Entity__Holo2__Size_30b_a3b = "holo2#30b-a3b" Entity__Holo3__Size_35b_a3b = "holo3#35b-a3b" Entity__Hunyuan = "hunyuan" Entity__Hunyuan__Instruct = "hunyuan{instruct}" Entity__Hunyuan__Size_7b = "hunyuan#7b" Entity__Hunyuan__Version_2_0 = "hunyuan@2.0" Entity__Hunyuan__Version_2_0__Instruct = "hunyuan@2.0{instruct}" Entity__Hy = "hy" Entity__Hy__Lite = "hy/lite" Entity__Hy__Pro = "hy/pro" Entity__Hy__Size_1_8b = "hy#1.8b" Entity__Hy__Size_30b_a3b = "hy#30b-a3b" Entity__Hy__Size_7b = "hy#7b" Entity__Hy__Version_3 = "hy@3" Entity__Ideogram = "ideogram" Entity__Ideogram__Turbo = "ideogram{turbo}" Entity__Imagen__Ultra__Version_4_0 = "imagen/ultra@4.0" Entity__Imagen__Version_3 = "imagen@3" Entity__Imagen__Version_3__Fast = "imagen@3{fast}" Entity__Imagen__Version_4 = "imagen@4" Entity__Imagen__Version_4_0__Fast = "imagen@4.0{fast}" Entity__Inflection__Version_3 = "inflection@3" Entity__Inkling = "inkling" Entity__Inkling__Small = "inkling/small" Entity__Intellect__Version_3 = "intellect@3" Entity__Interfaze = "interfaze" Entity__Jamba__Large = "jamba/large" Entity__Jamba__Large__Version_1_6 = "jamba/large@1.6" Entity__Jamba__Large__Version_1_7 = "jamba/large@1.7" Entity__Jamba__Mini = "jamba/mini" Entity__Jamba__Mini__Version_1_6 = "jamba/mini@1.6" Entity__Jamba__Mini__Version_1_7 = "jamba/mini@1.7" Entity__Kat__Coder = "kat/coder" Entity__Kimi = "kimi" Entity__Kimi__Coder = "kimi/coder" Entity__Kimi__K__Version_2 = "kimi/k@2" Entity__Kimi__K__Version_2_5 = "kimi/k@2.5" Entity__Kimi__K__Version_2_6 = "kimi/k@2.6" Entity__Kimi__K__Version_2_7 = "kimi/k@2.7" Entity__Kimi__K__Version_2_7__Code = "kimi/k@2.7{code}" Entity__Kimi__K__Version_2_7__Size_1100b__Code = "kimi/k@2.7#1100b{code}" Entity__Kimi__K__Version_2__Instruct = "kimi/k@2{instruct}" Entity__Kimi__K__Version_3 = "kimi/k@3" Entity__Kling__I2v__Version_2_5__Turbo = "kling/i2v@2.5{turbo}" Entity__Kling__I2v__Version_2_6 = "kling/i2v@2.6" Entity__Kling__I2v__Version_3_0 = "kling/i2v@3.0" Entity__Kling__Motion_control__Version_2_6 = "kling/motion-control@2.6" Entity__Kling__Motion_control__Version_3_0 = "kling/motion-control@3.0" Entity__Kling__T2v__Version_2_5__Turbo = "kling/t2v@2.5{turbo}" Entity__Kling__T2v__Version_2_6 = "kling/t2v@2.6" Entity__Kling__T2v__Version_3_0 = "kling/t2v@3.0" Entity__Kling__Version_2_6 = "kling@2.6" Entity__L31_70b_euryale__V2_2__Size_70b = "l31-70b-euryale/v2.2#70b" Entity__L3_70b_euryale__V2_1__Size_70b = "l3-70b-euryale/v2.1#70b" Entity__Laguna = "laguna" Entity__Laguna__M__Version_1 = "laguna/m@1" Entity__Laguna__Xs__Version_2 = "laguna/xs@2" Entity__Laguna__Xs__Version_2_1 = "laguna/xs@2.1" Entity__Laguna_s = "laguna-s" Entity__Laguna_s__Version_2_1 = "laguna-s@2.1" Entity__Leanstral__Version_1_5 = "leanstral@1.5" Entity__Lfm__Version_2_5__Size_2_6b = "lfm@2.5#2.6b" Entity__Ling__Flash__Version_2_0 = "ling/flash@2.0" Entity__Ling__Flash__Version_2_6 = "ling/flash@2.6" Entity__Ling__Flash__Version_3_0 = "ling/flash@3.0" Entity__Ling__Flash_free__Version_2_6 = "ling/flash-free@2.6" Entity__Ling__Size_1t = "ling#1t" Entity__Ling__Version_2_6__Size_1t = "ling@2.6#1t" Entity__Ling__Version_3_0 = "ling@3.0" Entity__Liquid__Size_24b_a2b = "liquid#24b-a2b" Entity__Llama__Embed__Size_300m = "llama/embed#300m" Entity__Llama__Large__Size_70b = "llama/large#70b" Entity__Llama__Lite__Version_3__Size_8b = "llama/lite@3#8b" Entity__Llama__Maverick__Version_4__Size_17b_128e = "llama/maverick@4#17b-128e" Entity__Llama__Maverick__Version_4__Size_17b_128e__Instruct = "llama/maverick@4#17b-128e{instruct}" Entity__Llama__R__Version_2__Size_70b = "llama/r@2#70b" Entity__Llama__Scout__Version_4__Size_17b_16e = "llama/scout@4#17b-16e" Entity__Llama__Scout__Version_4__Size_17b_16e__Instruct = "llama/scout@4#17b-16e{instruct}" Entity__Llama__Size_12b = "llama#12b" Entity__Llama__Size_24b = "llama#24b" Entity__Llama__Size_70b = "llama#70b" Entity__Llama__Size_70b__Instruct = "llama#70b{instruct}" Entity__Llama__Size_8b = "llama#8b" Entity__Llama__Size_8b__Instruct = "llama#8b{instruct}" Entity__Llama__Ultra__Version_3_1__Size_253b = "llama/ultra@3.1#253b" Entity__Llama__Version_2__Size_22m = "llama@2#22m" Entity__Llama__Version_2__Size_86m = "llama@2#86m" Entity__Llama__Version_3_05__Size_70b = "llama@3.05#70b" Entity__Llama__Version_3_1__Size_405b__Instruct = "llama@3.1#405b{instruct}" Entity__Llama__Version_3_1__Size_405b__Instruct__Turbo = "llama@3.1#405b{turbo,instruct}" Entity__Llama__Version_3_1__Size_70b = "llama@3.1#70b" Entity__Llama__Version_3_1__Size_70b__Instruct = "llama@3.1#70b{instruct}" Entity__Llama__Version_3_1__Size_8b = "llama@3.1#8b" Entity__Llama__Version_3_1__Size_8b__Instruct = "llama@3.1#8b{instruct}" Entity__Llama__Version_3_1__Size_8b__Instruct__Turbo = "llama@3.1#8b{turbo,instruct}" Entity__Llama__Version_3_2__Size_11b__Instruct = "llama@3.2#11b{instruct}" Entity__Llama__Version_3_2__Size_11b__Instruct__Vision = "llama@3.2#11b{vision,instruct}" Entity__Llama__Version_3_2__Size_1b = "llama@3.2#1b" Entity__Llama__Version_3_2__Size_1b__Instruct = "llama@3.2#1b{instruct}" Entity__Llama__Version_3_2__Size_3b = "llama@3.2#3b" Entity__Llama__Version_3_2__Size_3b__Instruct = "llama@3.2#3b{instruct}" Entity__Llama__Version_3_2__Size_90b__Instruct__Vision = "llama@3.2#90b{vision,instruct}" Entity__Llama__Version_3_3__Size_70b = "llama@3.3#70b" Entity__Llama__Version_3_3__Size_70b__Fast__Instruct = "llama@3.3#70b{fast,instruct}" Entity__Llama__Version_3_3__Size_70b__Instruct = "llama@3.3#70b{instruct}" Entity__Llama__Version_3_3__Size_70b__Instruct__Turbo = "llama@3.3#70b{turbo,instruct}" Entity__Llama__Version_3_3__Size_8b__Instruct = "llama@3.3#8b{instruct}" Entity__Llama__Version_3__Size_70b__Instruct = "llama@3#70b{instruct}" Entity__Llama__Version_3__Size_8b = "llama@3#8b" Entity__Llama__Version_3__Size_8b__Instruct = "llama@3#8b{instruct}" Entity__Llama__Version_4 = "llama@4" Entity__Llama__Version_4__Size_12b = "llama@4#12b" Entity__Longcat = "longcat" Entity__Longcat__Flash__Chat = "longcat/flash{chat}" Entity__Longcat__Flash_lite = "longcat/flash-lite" Entity__Longcat__Version_2_0 = "longcat@2.0" Entity__Lucid = "lucid" Entity__Lyria = "lyria" Entity__Lyria__Pro__Version_3 = "lyria/pro@3" Entity__Lyria__Version_3 = "lyria@3" Entity__Magibu__Size_11b = "magibu#11b" Entity__Magidonia_24b__V4_3__Size_24b = "magidonia-24b/v4.3#24b" Entity__Magistral__Medium = "magistral/medium" Entity__Magistral__Small = "magistral/small" Entity__Magnum__Size_72b = "magnum#72b" Entity__Magpie = "magpie" Entity__Mai = "mai" Entity__Mai__Version_1 = "mai@1" Entity__Medgemma__Size_4b = "medgemma#4b" Entity__Mellum2__Size_12b__Instruct = "mellum2#12b{instruct}" Entity__Mercury__Coder = "mercury/coder" Entity__Mercury__Version_2 = "mercury@2" Entity__Mercury_edit__Version_2 = "mercury-edit@2" Entity__Mimo__Version_2_5 = "mimo@2.5" Entity__Mimo__Version_2_5__Pro = "mimo@2.5{pro}" Entity__Mimo__Version_2_5__Tts = "mimo@2.5{tts}" Entity__Mimo__Version_2_5__Tts__Voiceclone = "mimo@2.5{tts,voiceclone}" Entity__Mimo__Version_2_5__Tts__Voicedesign = "mimo@2.5{tts,voicedesign}" Entity__Mimo__Version_2__Flash = "mimo@2{flash}" Entity__Mimo__Version_2__Omni = "mimo@2{omni}" Entity__Mimo__Version_2__Pro = "mimo@2{pro}" Entity__Mimo__Version_2__Tts = "mimo@2{tts}" Entity__Minicpm_v__Version_4_5 = "minicpm-v@4.5" Entity__Minimax = "minimax" Entity__Minimax__M__Version_1 = "minimax/m@1" Entity__Minimax__M__Version_2 = "minimax/m@2" Entity__Minimax__M__Version_2_1 = "minimax/m@2.1" Entity__Minimax__M__Version_2_5 = "minimax/m@2.5" Entity__Minimax__M__Version_2_7 = "minimax/m@2.7" Entity__Minimax__M__Version_3 = "minimax/m@3" Entity__Minimax__Version_01 = "minimax@01" Entity__Ministral__Size_14b = "ministral#14b" Entity__Ministral__Size_14b__Instruct = "ministral#14b{instruct}" Entity__Ministral__Size_3b = "ministral#3b" Entity__Ministral__Size_8b = "ministral#8b" Entity__Ministral__Size_8b__Instruct = "ministral#8b{instruct}" Entity__Ministral__Version_3__Size_14b__Instruct = "ministral@3#14b{instruct}" Entity__Ministral__Version_3__Size_14b__Reasoning = "ministral@3#14b{reasoning}" Entity__Ministral__Version_3__Size_3b__Instruct = "ministral@3#3b{instruct}" Entity__Ministral__Version_3__Size_3b__Reasoning = "ministral@3#3b{reasoning}" Entity__Ministral__Version_3__Size_8b__Instruct = "ministral@3#8b{instruct}" Entity__Mistral = "mistral" Entity__Mistral__Code = "mistral{code}" Entity__Mistral__Embed = "mistral/embed" Entity__Mistral__Large = "mistral/large" Entity__Mistral__Large__Instruct = "mistral/large{instruct}" Entity__Mistral__Large__Size_675b = "mistral/large#675b" Entity__Mistral__Large__Version_3 = "mistral/large@3" Entity__Mistral__Large__Version_3__Size_675b__Instruct = "mistral/large@3#675b{instruct}" Entity__Mistral__Medium = "mistral/medium" Entity__Mistral__Medium__Instruct = "mistral/medium{instruct}" Entity__Mistral__Medium__Version_3 = "mistral/medium@3" Entity__Mistral__Medium__Version_3_1 = "mistral/medium@3.1" Entity__Mistral__Medium__Version_3_5 = "mistral/medium@3.5" Entity__Mistral__Medium__Version_3_5__Size_128b = "mistral/medium@3.5#128b" Entity__Mistral__Medium__Version_3__Instruct = "mistral/medium@3{instruct}" Entity__Mistral__Nemo = "mistral/nemo" Entity__Mistral__Nemo__Instruct = "mistral/nemo{instruct}" Entity__Mistral__Nemo__Size_12b = "mistral/nemo#12b" Entity__Mistral__Nemo__Size_12b__Instruct = "mistral/nemo#12b{instruct}" Entity__Mistral__Size_24b = "mistral#24b" Entity__Mistral__Size_7b = "mistral#7b" Entity__Mistral__Size_7b__Instruct = "mistral#7b{instruct}" Entity__Mistral__Small = "mistral/small" Entity__Mistral__Small__Size_119b = "mistral/small#119b" Entity__Mistral__Small__Size_24b__Instruct = "mistral/small#24b{instruct}" Entity__Mistral__Small__Version_3_1__Size_24b__Instruct = "mistral/small@3.1#24b{instruct}" Entity__Mistral__Small__Version_3_2__Size_24b__Instruct = "mistral/small@3.2#24b{instruct}" Entity__Mistral__Small__Version_4 = "mistral/small@4" Entity__Mistral__Small__Version_4__Size_119b = "mistral/small@4#119b" Entity__Mistral__Version_0_2__Size_7b__Instruct = "mistral@0.2#7b{instruct}" Entity__Mistral__Version_0_3__Size_7b__Instruct = "mistral@0.3#7b{instruct}" Entity__Mixtral__Size_8x22b = "mixtral#8x22b" Entity__Mixtral__Size_8x22b__Instruct = "mixtral#8x22b{instruct}" Entity__Mixtral__Size_8x7b = "mixtral#8x7b" Entity__Mixtral__Size_8x7b__Instruct = "mixtral#8x7b{instruct}" Entity__Mixtral__Version_0_1__Size_8x22b__Instruct = "mixtral@0.1#8x22b{instruct}" Entity__Mixtral__Version_0_1__Size_8x7b__Instruct = "mixtral@0.1#8x7b{instruct}" Entity__Mm_poly__Size_8b = "mm-poly#8b" Entity__Model_router = "model-router" Entity__Model_router__Mini = "model-router/mini" Entity__Morph__Fast = "morph{fast}" Entity__Morph__Large = "morph/large" Entity__Motif__Version_3 = "motif@3" Entity__Muse = "muse" Entity__Muse__Image__Version_1_0 = "muse/image@1.0" Entity__Muse__Size_30b = "muse#30b" Entity__Muse__Spark__Version_1_1 = "muse/spark@1.1" Entity__Muse__Spark__Version_1_2 = "muse/spark@1.2" Entity__Mythomax__Size_13b = "mythomax#13b" Entity__Namazu = "namazu" Entity__Nano_banana = "nano-banana" Entity__Nano_banana__Pro = "nano-banana/pro" Entity__Nemotron = "nemotron" Entity__Nemotron__Embed__Size_1b = "nemotron/embed#1b" Entity__Nemotron__Mini__Size_4b__Instruct = "nemotron/mini#4b{instruct}" Entity__Nemotron__Nano__Size_12b = "nemotron/nano#12b" Entity__Nemotron__Nano__Size_30b = "nemotron/nano#30b" Entity__Nemotron__Nano__Size_30b_a3b = "nemotron/nano#30b-a3b" Entity__Nemotron__Nano__Size_8b = "nemotron/nano#8b" Entity__Nemotron__Nano__Size_9b = "nemotron/nano#9b" Entity__Nemotron__Nano__Version_3__Omni = "nemotron/nano@3{omni}" Entity__Nemotron__Nano__Version_3__Size_30b = "nemotron/nano@3#30b" Entity__Nemotron__Nano__Version_3__Size_30b__Omni = "nemotron/nano@3#30b{omni}" Entity__Nemotron__Nano__Version_3__Size_30b_a3b = "nemotron/nano@3#30b-a3b" Entity__Nemotron__Nano__Version_3__Size_30b_a3b__Omni = "nemotron/nano@3#30b-a3b{omni}" Entity__Nemotron__Nano__Version_3__Size_30b_a3b__Omni__Reasoning = "nemotron/nano@3#30b-a3b{reasoning,omni}" Entity__Nemotron__Size_120b_a12b = "nemotron#120b-a12b" Entity__Nemotron__Size_1b = "nemotron#1b" Entity__Nemotron__Size_32b = "nemotron#32b" Entity__Nemotron__Size_49b = "nemotron#49b" Entity__Nemotron__Size_4b__Reasoning = "nemotron#4b{reasoning}" Entity__Nemotron__Size_70b = "nemotron#70b" Entity__Nemotron__Size_70b__Instruct = "nemotron#70b{instruct}" Entity__Nemotron__Size_8b = "nemotron#8b" Entity__Nemotron__Ultra__Size_253b = "nemotron/ultra#253b" Entity__Nemotron__Ultra__Size_550b_a55b = "nemotron/ultra#550b-a55b" Entity__Nemotron__Ultra__Version_3 = "nemotron/ultra@3" Entity__Nemotron__Ultra__Version_3__Size_550b = "nemotron/ultra@3#550b" Entity__Nemotron__Ultra__Version_3__Size_550b_a55b = "nemotron/ultra@3#550b-a55b" Entity__Nemotron__V1_5__Version_3_3__Size_49b = "nemotron/v1.5@3.3#49b" Entity__Nemotron__Version_2__Size_30b_a3b = "nemotron@2#30b-a3b" Entity__Nemotron__Version_3 = "nemotron@3" Entity__Nemotron__Version_3_5 = "nemotron@3.5" Entity__Nemotron__Version_3_5__Size_30b_a3b = "nemotron@3.5#30b-a3b" Entity__Nemotron__Version_3__Size_120b = "nemotron@3#120b" Entity__Nemotron__Version_3__Size_120b_a12b = "nemotron@3#120b-a12b" Entity__Nemotron__Version_3__Size_30b = "nemotron@3#30b" Entity__Neosmith_intelligent = "neosmith.intelligent" Entity__Neosmith_intelligent__Pro = "neosmith.intelligent/pro" Entity__Neosmith_neolite = "neosmith.neolite" Entity__Nomic = "nomic" Entity__North__Mini = "north/mini" Entity__North__Mini__Code = "north/mini{code}" Entity__Nova = "nova" Entity__Nova__Flash = "nova/flash" Entity__Nova__Lite = "nova/lite" Entity__Nova__Lite__Version_2 = "nova/lite@2" Entity__Nova__Micro = "nova/micro" Entity__Nova__Mini = "nova/mini" Entity__Nova__Pro = "nova/pro" Entity__Nova__Pro__Version_2 = "nova/pro@2" Entity__Nova__Size_100b = "nova#100b" Entity__Nv = "nv" Entity__Nv__Size_7b = "nv#7b" Entity__Nvidia__Size_1b = "nvidia#1b" Entity__Olmo__Version_3__Size_32b = "olmo@3#32b" Entity__Ornith__Version_1_0__Size_35b = "ornith@1.0#35b" Entity__Ornith__Version_1_5__Size_35b_a3b = "ornith@1.5#35b-a3b" Entity__Ornith__Version_1_5__Size_397b = "ornith@1.5#397b" Entity__Ornith__Version_1_5__Size_9b = "ornith@1.5#9b" Entity__Osmosis__Size_0_6b = "osmosis#0.6b" Entity__Ox_alpha = "ox-alpha" Entity__Paddleocr = "paddleocr" Entity__Paddleocr_vl__Version_1_5 = "paddleocr-vl@1.5" Entity__Palmyra = "palmyra" Entity__Pareto__Code = "pareto{code}" Entity__Perceptron = "perceptron" Entity__Perplexity = "perplexity" Entity__Phi__Mini__Version_4 = "phi/mini@4" Entity__Phi__Mini__Version_4__Instruct = "phi/mini@4{instruct}" Entity__Phi__Mini__Version_4__Reasoning = "phi/mini@4{reasoning}" Entity__Phi__Version_4 = "phi@4" Entity__Phi__Version_4__Instruct__Multimodal = "phi@4{multimodal,instruct}" Entity__Phi__Version_4__Multimodal = "phi@4{multimodal}" Entity__Phi__Version_4__Reasoning = "phi@4{reasoning}" Entity__Pixtral__Large = "pixtral/large" Entity__Pixtral__Size_12b = "pixtral#12b" Entity__Pokee = "pokee" Entity__Pplx__Size_4b = "pplx#4b" Entity__Qvq = "qvq" Entity__Qwen = "qwen" Entity__Qwen3guard__Size_0_6b = "qwen3guard#0.6b" Entity__Qwen3guard__Size_8b = "qwen3guard#8b" Entity__Qwen__3_6 = "qwen/3.6" Entity__Qwen__3_6__Size_27b = "qwen/3.6#27b" Entity__Qwen__Coder = "qwen/coder" Entity__Qwen__Coder__Size_30b_a3b = "qwen/coder#30b-a3b" Entity__Qwen__Coder__Size_480b_a35b = "qwen/coder#480b-a35b" Entity__Qwen__Coder__Version_2_5__Size_0_5b = "qwen/coder@2.5#0.5b" Entity__Qwen__Coder__Version_2_5__Size_32b = "qwen/coder@2.5#32b" Entity__Qwen__Coder__Version_2_5__Size_32b__Instruct = "qwen/coder@2.5#32b{instruct}" Entity__Qwen__Coder__Version_2_5__Size_7b__Fast = "qwen/coder@2.5#7b{fast}" Entity__Qwen__Coder__Version_2_5__Size_7b__Instruct = "qwen/coder@2.5#7b{instruct}" Entity__Qwen__Coder__Version_3 = "qwen/coder@3" Entity__Qwen__Coder__Version_3__Size_30b = "qwen/coder@3#30b" Entity__Qwen__Coder__Version_3__Size_30b_a3b = "qwen/coder@3#30b-a3b" Entity__Qwen__Coder__Version_3__Size_30b_a3b__Instruct = "qwen/coder@3#30b-a3b{instruct}" Entity__Qwen__Coder__Version_3__Size_480b_a35b = "qwen/coder@3#480b-a35b" Entity__Qwen__Coder__Version_3__Size_480b_a35b__Instruct = "qwen/coder@3#480b-a35b{instruct}" Entity__Qwen__Deep_research = "qwen/deep-research" Entity__Qwen__Embedding__Version_3__Size_0_6b = "qwen/embedding@3#0.6b" Entity__Qwen__Embedding__Version_3__Size_4b = "qwen/embedding@3#4b" Entity__Qwen__Embedding__Version_3__Size_8b = "qwen/embedding@3#8b" Entity__Qwen__Flash = "qwen/flash" Entity__Qwen__Flash__Version_3 = "qwen/flash@3" Entity__Qwen__Flash__Version_3_5 = "qwen/flash@3.5" Entity__Qwen__Flash__Version_3_5__Omni = "qwen/flash@3.5{omni}" Entity__Qwen__Flash__Version_3_6 = "qwen/flash@3.6" Entity__Qwen__Flash__Version_3_7 = "qwen/flash@3.7" Entity__Qwen__Flash__Version_3_8 = "qwen/flash@3.8" Entity__Qwen__Flash__Version_3__Livetranslate = "qwen/flash@3{livetranslate}" Entity__Qwen__Flash__Version_3__Omni = "qwen/flash@3{omni}" Entity__Qwen__Free__Version_3_8__Size_27b = "qwen/free@3.8#27b" Entity__Qwen__Image = "qwen/image" Entity__Qwen__Image__Version_2_0 = "qwen/image@2.0" Entity__Qwen__Max = "qwen/max" Entity__Qwen__Max__Version_3 = "qwen/max@3" Entity__Qwen__Max__Version_3_6 = "qwen/max@3.6" Entity__Qwen__Max__Version_3_7 = "qwen/max@3.7" Entity__Qwen__Max__Version_3_8 = "qwen/max@3.8" Entity__Qwen__Next__Size_80b_a3b = "qwen/next#80b-a3b" Entity__Qwen__Next__Version_3__Size_80b = "qwen/next@3#80b" Entity__Qwen__Next__Version_3__Size_80b_a3b = "qwen/next@3#80b-a3b" Entity__Qwen__Next__Version_3__Size_80b_a3b__Fast = "qwen/next@3#80b-a3b{fast}" Entity__Qwen__Next__Version_3__Size_80b_a3b__Instruct = "qwen/next@3#80b-a3b{instruct}" Entity__Qwen__Plus = "qwen/plus" Entity__Qwen__Plus__Version_3_5 = "qwen/plus@3.5" Entity__Qwen__Plus__Version_3_5__Omni = "qwen/plus@3.5{omni}" Entity__Qwen__Plus__Version_3_6 = "qwen/plus@3.6" Entity__Qwen__Plus__Version_3_7 = "qwen/plus@3.7" Entity__Qwen__Size_14b = "qwen#14b" Entity__Qwen__Size_235b_a22b = "qwen#235b-a22b" Entity__Qwen__Size_27b = "qwen#27b" Entity__Qwen__Size_32b = "qwen#32b" Entity__Qwen__Size_35b_a3b = "qwen#35b-a3b" Entity__Qwen__Size_397b = "qwen#397b" Entity__Qwen__Size_5b = "qwen#5b" Entity__Qwen__Size_72b = "qwen#72b" Entity__Qwen__Size_7b = "qwen#7b" Entity__Qwen__Size_8b = "qwen#8b" Entity__Qwen__Size_9b = "qwen#9b" Entity__Qwen__Turbo = "qwen/turbo" Entity__Qwen__Turbo__Omni = "qwen/turbo{omni}" Entity__Qwen__Turbo__Version_2_5__Size_7b = "qwen/turbo@2.5#7b" Entity__Qwen__Version_2_5__Size_14b__Instruct = "qwen@2.5#14b{instruct}" Entity__Qwen__Version_2_5__Size_32b__Instruct = "qwen@2.5#32b{instruct}" Entity__Qwen__Version_2_5__Size_72b__Instruct = "qwen@2.5#72b{instruct}" Entity__Qwen__Version_2_5__Size_7b__Instruct = "qwen@2.5#7b{instruct}" Entity__Qwen__Version_2_5__Size_7b__Instruct__Vision = "qwen@2.5#7b{vision,instruct}" Entity__Qwen__Version_2_5__Size_7b__Omni = "qwen@2.5#7b{omni}" Entity__Qwen__Version_3 = "qwen@3" Entity__Qwen__Version_35__Size_397b_a17b = "qwen@35#397b-a17b" Entity__Qwen__Version_3_5 = "qwen@3.5" Entity__Qwen__Version_3_5__Size_0_8b = "qwen@3.5#0.8b" Entity__Qwen__Version_3_5__Size_122b = "qwen@3.5#122b" Entity__Qwen__Version_3_5__Size_122b_a10b = "qwen@3.5#122b-a10b" Entity__Qwen__Version_3_5__Size_27b = "qwen@3.5#27b" Entity__Qwen__Version_3_5__Size_2b = "qwen@3.5#2b" Entity__Qwen__Version_3_5__Size_35b_a3b = "qwen@3.5#35b-a3b" Entity__Qwen__Version_3_5__Size_397b_a17b = "qwen@3.5#397b-a17b" Entity__Qwen__Version_3_5__Size_397b_a17b__Fast = "qwen@3.5#397b-a17b{fast}" Entity__Qwen__Version_3_5__Size_4b = "qwen@3.5#4b" Entity__Qwen__Version_3_5__Size_9b = "qwen@3.5#9b" Entity__Qwen__Version_3_6__Size_27b = "qwen@3.6#27b" Entity__Qwen__Version_3_6__Size_35b = "qwen@3.6#35b" Entity__Qwen__Version_3_6__Size_35b__Fast = "qwen@3.6#35b{fast}" Entity__Qwen__Version_3_6__Size_35b_a3b = "qwen@3.6#35b-a3b" Entity__Qwen__Version_3_7 = "qwen@3.7" Entity__Qwen__Version_3_8 = "qwen@3.8" Entity__Qwen__Version_3_8_2__Size_4t = "qwen@3.8.2#4t" Entity__Qwen__Version_3_8__Size_27b = "qwen@3.8#27b" Entity__Qwen__Version_3_8__Size_2_4t = "qwen@3.8#2.4t" Entity__Qwen__Version_3__Size_0_6b = "qwen@3#0.6b" Entity__Qwen__Version_3__Size_14b = "qwen@3#14b" Entity__Qwen__Version_3__Size_14b__Instruct = "qwen@3#14b{instruct}" Entity__Qwen__Version_3__Size_1_7b__Base = "qwen@3#1.7b{base}" Entity__Qwen__Version_3__Size_235b = "qwen@3#235b" Entity__Qwen__Version_3__Size_235b_a22b = "qwen@3#235b-a22b" Entity__Qwen__Version_3__Size_235b_a22b__Fast = "qwen@3#235b-a22b{fast}" Entity__Qwen__Version_3__Size_235b_a22b__Instruct = "qwen@3#235b-a22b{instruct}" Entity__Qwen__Version_3__Size_27b = "qwen@3#27b" Entity__Qwen__Version_3__Size_30b = "qwen@3#30b" Entity__Qwen__Version_3__Size_30b_a3b = "qwen@3#30b-a3b" Entity__Qwen__Version_3__Size_30b_a3b__Instruct = "qwen@3#30b-a3b{instruct}" Entity__Qwen__Version_3__Size_30b_a3b__Instruct__Omni = "qwen@3#30b-a3b{instruct,omni}" Entity__Qwen__Version_3__Size_30b_a3b__Omni = "qwen@3#30b-a3b{omni}" Entity__Qwen__Version_3__Size_32b = "qwen@3#32b" Entity__Qwen__Version_3__Size_35b_a3b = "qwen@3#35b-a3b" Entity__Qwen__Version_3__Size_4b = "qwen@3#4b" Entity__Qwen__Version_3__Size_4b__Base = "qwen@3#4b{base}" Entity__Qwen__Version_3__Size_4b__Instruct = "qwen@3#4b{instruct}" Entity__Qwen__Version_3__Size_8b = "qwen@3#8b" Entity__Qwen__Vl = "qwen/vl" Entity__Qwen__Vl__Size_235b_a22b = "qwen/vl#235b-a22b" Entity__Qwen__Vl__Version_2_5__Size_32b__Instruct = "qwen/vl@2.5#32b{instruct}" Entity__Qwen__Vl__Version_2_5__Size_72b__Instruct = "qwen/vl@2.5#72b{instruct}" Entity__Qwen__Vl__Version_2_5__Size_7b__Instruct = "qwen/vl@2.5#7b{instruct}" Entity__Qwen__Vl__Version_2__Size_72b__Instruct = "qwen/vl@2#72b{instruct}" Entity__Qwen__Vl__Version_3 = "qwen/vl@3" Entity__Qwen__Vl__Version_3__Instruct = "qwen/vl@3{instruct}" Entity__Qwen__Vl__Version_3__Size_235b_a22b = "qwen/vl@3#235b-a22b" Entity__Qwen__Vl__Version_3__Size_235b_a22b__Instruct = "qwen/vl@3#235b-a22b{instruct}" Entity__Qwen__Vl__Version_3__Size_30b_a3b = "qwen/vl@3#30b-a3b" Entity__Qwen__Vl__Version_3__Size_30b_a3b__Instruct = "qwen/vl@3#30b-a3b{instruct}" Entity__Qwen__Vl__Version_3__Size_32b = "qwen/vl@3#32b" Entity__Qwen__Vl__Version_3__Size_32b__Instruct = "qwen/vl@3#32b{instruct}" Entity__Qwen__Vl__Version_3__Size_8b = "qwen/vl@3#8b" Entity__Qwen__Vl__Version_3__Size_8b__Instruct = "qwen/vl@3#8b{instruct}" Entity__Qwerky__Size_72b = "qwerky#72b" Entity__Qwq__Plus = "qwq/plus" Entity__Qwq__Size_32b = "qwq#32b" Entity__Ray = "ray" Entity__Recraft = "recraft" Entity__Recraft__Pro = "recraft/pro" Entity__Recraft__V4_1 = "recraft/v4.1" Entity__Recraft__V4_1_utility = "recraft/v4.1-utility" Entity__Reka = "reka" Entity__Reka__Flash__Version_3 = "reka/flash@3" Entity__Relace = "relace" Entity__Relace_apply__Version_3 = "relace-apply@3" Entity__Remm__Size_13b = "remm#13b" Entity__Rerank__Fast = "rerank{fast}" Entity__Rerank__Lite__Version_2_5 = "rerank/lite@2.5" Entity__Rerank__Pro = "rerank{pro}" Entity__Rerank__Size_4b = "rerank#4b" Entity__Rerank__V3_5 = "rerank/v3.5" Entity__Rerank__Version_2_5 = "rerank@2.5" Entity__Ring__Size_1t = "ring#1t" Entity__Ring__Version_2_6__Size_1t = "ring@2.6#1t" Entity__Riva_translate_4b_instruct__V1_1__Size_4b__Instruct__Translate = "riva-translate-4b-instruct/v1.1#4b{instruct,translate}" Entity__Rnj__Version_1__Instruct = "rnj@1{instruct}" Entity__Roc = "roc" Entity__Rocinante_12b__V1_1__Size_12b = "rocinante-12b/v1.1#12b" Entity__Runway = "runway" Entity__Runway__Version_4__Turbo = "runway@4{turbo}" Entity__Sakana_namazu = "sakana-namazu" Entity__Sap_abap__Version_1 = "sap-abap@1" Entity__Sarvam = "sarvam" Entity__Sarvam__Size_105b = "sarvam#105b" Entity__Sarvam__Size_30b = "sarvam#30b" Entity__Seed = "seed" Entity__Seed__Code = "seed{code}" Entity__Seed__Fast = "seed{fast}" Entity__Seed__Flash = "seed/flash" Entity__Seed__Flash__Version_1_6 = "seed/flash@1.6" Entity__Seed__Lite = "seed/lite" Entity__Seed__Lite__Version_2_0 = "seed/lite@2.0" Entity__Seed__Mini = "seed/mini" Entity__Seed__Mini__Version_2_0 = "seed/mini@2.0" Entity__Seed__Oss__Size_36b__Instruct = "seed/oss#36b{instruct}" Entity__Seed__Pro = "seed/pro" Entity__Seed__Pro__Fast = "seed/pro{fast}" Entity__Seed__Pro__Version_2_0 = "seed/pro@2.0" Entity__Seed__Turbo = "seed{turbo}" Entity__Seed__Version_1_6 = "seed@1.6" Entity__Seed__Version_1_8 = "seed@1.8" Entity__Seed__Version_2_0__Code = "seed@2.0{code}" Entity__Seed__Version_2_1__Turbo = "seed@2.1{turbo}" Entity__Seed__Vision = "seed{vision}" Entity__Skyfall__Size_36b = "skyfall#36b" Entity__Smollm3__Size_3b__Base = "smollm3#3b{base}" Entity__Solar = "solar" Entity__Solar__Mini = "solar/mini" Entity__Solar__Pro = "solar/pro" Entity__Solar__Pro__Version_3 = "solar/pro@3" Entity__Solar__Size_10_7b__Instruct = "solar#10.7b{instruct}" Entity__Sonar = "sonar" Entity__Sonar__Deep_research = "sonar/deep-research" Entity__Sonar__Pro = "sonar/pro" Entity__Sonar__Reasoning = "sonar/reasoning" Entity__Sora__Pro__Version_2 = "sora/pro@2" Entity__Sora__Version_2 = "sora@2" Entity__Sparsedrive = "sparsedrive" Entity__Stable_diffusion = "stable-diffusion" Entity__Stable_diffusion__Large__Version_3_5 = "stable-diffusion/large@3.5" Entity__Step = "step" Entity__Step__Flash__Version_3_5 = "step/flash@3.5" Entity__Step__Flash__Version_3_7 = "step/flash@3.7" Entity__Step__Mini = "step/mini" Entity__Step__Version_1 = "step@1" Entity__Step__Version_2 = "step@2" Entity__Step__Version_3 = "step@3" Entity__Step__Version_3_5 = "step@3.5" Entity__Step__Version_3_7 = "step@3.7" Entity__Streampetr = "streampetr" Entity__Studiovoice = "studiovoice" Entity__Synth = "synth" Entity__Synth__Code = "synth{code}" Entity__Synthetic = "synthetic" Entity__Tako = "tako" Entity__Text = "text" Entity__Text_embedding = "text-embedding" Entity__Text_embedding_3__Large__Version_3 = "text-embedding-3/large@3" Entity__Text_embedding_3__Small__Version_3 = "text-embedding-3/small@3" Entity__Text_embedding__Embedding__Version_005 = "text-embedding/embedding@005" Entity__Text_embedding__Large = "text-embedding/large" Entity__Text_embedding__Large__Instruct = "text-embedding/large{instruct}" Entity__Text_embedding__Large__Version_3 = "text-embedding/large@3" Entity__Text_embedding__Mini = "text-embedding/mini" Entity__Text_embedding__Small__Version_3 = "text-embedding/small@3" Entity__Text_embedding__Version_002 = "text-embedding@002" Entity__Tim__Size_27b = "tim#27b" Entity__Titan__Embed = "titan/embed" Entity__Topazlabs = "topazlabs" Entity__Trinity__Large = "trinity/large" Entity__Trinity__Mini = "trinity/mini" Entity__Tts__Version_1 = "tts@1" Entity__Tts__Version_1__Hd = "tts@1{hd}" Entity__Ui__Size_7b = "ui#7b" Entity__Universal = "universal" Entity__Unslopnemo_12b__V4_1__Size_12b = "unslopnemo-12b/v4.1#12b" Entity__Unslopnemo__Size_12b = "unslopnemo#12b" Entity__Unsloth__Size_12b = "unsloth#12b" Entity__Unsloth__Size_27b = "unsloth#27b" Entity__Unsloth__Size_4b = "unsloth#4b" Entity__Usdcode = "usdcode" Entity__Usdvalidate = "usdvalidate" Entity__V0__Size_0_6b = "v0#0.6b" Entity__V0__Version_1_0 = "v0@1.0" Entity__V0__Version_1_5 = "v0@1.5" Entity__Venice = "venice" Entity__Venice__Version_1_2 = "venice@1.2" Entity__Veo = "veo" Entity__Veo__Version_2 = "veo@2" Entity__Veo__Version_3_0 = "veo@3.0" Entity__Veo__Version_3_1 = "veo@3.1" Entity__Veo__Version_3_1__Fast = "veo@3.1{fast}" Entity__Veo__Version_3__Fast = "veo@3{fast}" Entity__Virtuoso__Large = "virtuoso/large" Entity__Voxtral__Mini = "voxtral/mini" Entity__Voxtral__Mini__Size_3b = "voxtral/mini#3b" Entity__Voxtral__Small = "voxtral/small" Entity__Voxtral__Small__Size_24b = "voxtral/small#24b" Entity__Voyage__Large__Version_3 = "voyage/large@3" Entity__Voyage__Large__Version_4 = "voyage/large@4" Entity__Voyage__Lite__Version_3_5 = "voyage/lite@3.5" Entity__Voyage__Lite__Version_4 = "voyage/lite@4" Entity__Voyage__Version_2 = "voyage@2" Entity__Voyage__Version_3 = "voyage@3" Entity__Voyage__Version_3_5 = "voyage@3.5" Entity__Voyage__Version_4 = "voyage@4" Entity__Wan2_7__Image = "wan2.7/image" Entity__Wan2_7_image__Pro = "wan2.7-image/pro" Entity__Wan2__Version_2 = "wan2@2" Entity__Wan__V2_5_t2v = "wan/v2.5-t2v" Entity__Wan__V2_6_i2v = "wan/v2.6-i2v" Entity__Wan__V2_6_i2v_flash = "wan/v2.6-i2v-flash" Entity__Wan__V2_6_r2v = "wan/v2.6-r2v" Entity__Wan__V2_6_r2v_flash = "wan/v2.6-r2v-flash" Entity__Wan__V2_6_t2v = "wan/v2.6-t2v" Entity__Wan__V2_7_r2v = "wan/v2.7-r2v" Entity__Wan__V2_7_t2v = "wan/v2.7-t2v" Entity__Wan__V3_0_video = "wan/v3.0-video" Entity__Wan_v2__Version_6 = "wan-v2@6" Entity__Weaver = "weaver" Entity__Whisper = "whisper" Entity__Whisper__Large = "whisper/large" Entity__Whisper__Large__Version_3 = "whisper/large@3" Entity__Whisper__Large__Version_3__Turbo = "whisper/large@3{turbo}" Entity__Whisper__Version_1 = "whisper@1" Entity__Wizardlm__Version_2__Size_8x22b = "wizardlm@2#8x22b" Entity__X_preview_f = "x-preview-f" Entity__Xpersona_frieren__Coder = "xpersona-frieren/coder" Entity__Yi = "yi" Entity__Yi__Large = "yi/large" Entity__Zdev = "zdev" Entity__Zdr = "zdr" )
Entity__* constants provide compile-time references to every model ENTITY in the static registry. Each value is the canonical entity key (family[/variant][@version][#size]{identity-mods}); names follow the grammar:
Entity__<Family>__<Variant>?__Version_<version>?__Size_<size>?__<Mod>?...
Segments are plain-Pascal (no brand-casing, no camel-fold); the Version_/Size_ word sentinels and the separator-preserving sanitizer (every non-alphanumeric character becomes '_') keep the names injective. Provider access is via the API (ProvidersOf / ProvidersOfModel), never the constant namespace.
const BestiarySchemaVersion = "0.7.0"
BestiarySchemaVersion is the semantic version of the bestiary JSON Schema (the public CLI JSON output schema in bestiary.schema.json). It follows semver (major.minor.patch) and must be incremented whenever the public output schema changes.
This is DISTINCT from the SQLite store's currentSchemaVersion (store.go), which versions the on-disk cache migrations and bumps on its own cadence. Do not conflate the two: the JSON output schema and the SQLite cache schema evolve independently.
Changelog:
- 0.0.2 → 0.0.3: widened the Modifier field string → []string (backward-INCOMPATIBLE public schema change).
- 0.0.3 → 0.1.0: added the v0.2.3 entity-model fields (ModelInfo.Host, ModelInfo.Lineage; ModelRef.Host; new $defs EntityRef, LineageEdge, DerivationKind). Additive and backward-COMPATIBLE: the new fields are optional/zero-value, so 0.0.x records still validate.
- 0.1.0 → 0.2.0: added the v0.2.4 VRAM/quantization/provenance fields (ModelInfo.ParamSize, ModelInfo.QuantVRAM, ModelInfo.Source; EntityRef.ParamSize; new $defs Quantization, QuantVRAM, ProviderInstance, CapabilityUnion, Entity, DataSource, DatasetIngested, EntitySource). Additive and backward-COMPATIBLE: every new field is optional/zero-value, so 0.1.x records still validate.
- 0.2.0 → 0.3.0: added the v0.2.5 models.dev harmonization fields — the instance-level ModelInfo props (Description, Status, StatusRaw, ReasoningOptions, CostInputAudioPerMTok, CostOutputAudioPerMTok, CostContextOver200k, CostTiers), the Entity.Metadata join projection, ModelRef.ParamSize (the #size identity carrier on the identity tuple), and new $defs ModelStatus, LinkType, ModelLink, BenchmarkResult, ReasoningOption, TierCost, CostTier, EntityMetadata. (Catalog is a parser return container, not a serialized output document, so it is deliberately NOT a $def.) Additive and backward-COMPATIBLE: every new property is optional/zero-value, so 0.2.x records still validate.
- 0.3.0 → 0.4.0: stamps the v0.2.6 parameter-shape fields decomposed from ParamSize (ModelInfo.TotalParams, ActiveParams, PerExpertParams, ExpertCount). These are DERIVED presentation facts, never entity-key material, and follow the ParamShapeNull (-1) in-domain NULL sentinel contract: -1 = not populated by parser or curation, a positive value = an attested count, and a genuine 0 is reachable only for ExpertCount (a dense shape attests zero experts). The schema pins minimum -1 on each. Additive and backward-COMPATIBLE: every new property is optional, so 0.3.x records still validate. (The full-bulk #size re-key that lands this epoch changes many EntityRef keys but is a data change, not a schema-shape change — the ParamSize carrier and its grammar are unchanged.)
- 0.4.0 → 0.5.0: adds the v0.2.7 naming layer and the Region axis. The naming layer: new $defs Nomen + NomenScheme and an optional Entity.Nomina array (the read projection of an entity's recorded namings — canonical Preferred nomen, provider-ID Admitted nomina, curated third-party alias claims). The Region axis: ModelInfo.Region + ModelInfo.RegionRaw (the AWS Bedrock cross-region inference-profile jurisdiction, a per-instance attribute never part of entity identity), ProviderInstance.Region + RegionRaw projected at registry roll-up, an optional Entity.Regions sorted-unique aggregate, and a new $defs Region closed string enum (which INCLUDES "unspecified" for the RegionNone zero value). Additive and backward-COMPATIBLE: every new property is optional/zero-value (Region defaults to "unspecified", RegionRaw to "", Nomina/Regions absent), so 0.4.x records still validate. This is the SOLE schema bump for the naming + region work — do not add another this epoch.
- 0.5.0 → 0.6.0: adds the v0.2.8 creator dimension, the multi-attestation naming model, and the OCI external-identifier scheme. The creator dimension: a new $defs Creator (open string type — the SPDX originator / training lab, distinct from Provider the supplier) and the DERIVED join projections ModelInfo.Creator and Entity.Creator (baked / projected from Family via the curated creators.json seed, never a stored column — Family → Creator is a function). The naming model: a new $defs NomenAttestation (the per-claim evidence record) plus the AttestationAuthority and IngestMethod element enums, and an optional Nomen.Attestations array (a name HAS-MANY attestations; provenance is no longer fused onto the name row). The external-identifier scheme: "oci" appended to the $defs.CanonicalScheme enum tail (a per-quant-digest scheme token; ModelRef.Format returns "" for it by design, as a bare ref carries no single OCI identity). Additive and backward-COMPATIBLE: every new property is optional/zero-value (Creator defaults to "", Attestations absent, "oci" a new enum member), and none is added to any required[] array, so 0.5.x records still validate.
- 0.6.0 → 0.7.0: adds the v0.2.10 harvest-durability and multi-metadata fields. (1) NomenAttestation.ArchivedURL — an archive.org snapshot OF the attestation's SourceURL, recorded for the HARVESTED layer (whose SourceURL is a live page that can rot) by the offline HuggingFace bot via the Wayback Availability API, and empty whenever no snapshot is recorded. It is ADDITIVE — SourceURL stays primary and unchanged — and it does NOT touch the curated archive-only fence, whose source_url already IS the snapshot. Because a NomenAttestation always serializes every field, ArchivedURL joins the $defs.NomenAttestation required[] list (all six); that is not a compatibility break, since a 0.6.x-shaped attestation document was itself always emitted with all of its fields present. (2) Entity.MetadataAll — the multi-metadata read projection alongside the existing single Entity.Metadata slot, optional and absent when unpopulated. Both additions are additive and backward-COMPATIBLE at the record level: no existing property changes type or meaning, and no top-level required[] array grows. This is the SOLE schema bump for v0.2.10 — one paragraph, one document, covering BOTH additions; do not add another this epoch.
const ParamShapeNull = -1
ParamShapeNull is the in-domain NULL sentinel for the four parameter-shape integer fields (ParamShape and the inline ModelInfo TotalParams / ActiveParams / PerExpertParams / ExpertCount). A field set to ParamShapeNull means "not populated by the parser or curation": the shape genuinely does not carry that fact (a dense token attests no active or per-expert count), or the size is entirely unknown. It is DISTINCT from a genuine 0, which under this contract is reachable only for ExpertCount (a dense shape attests exactly zero experts). Modelling the fields as a NULLable tabular domain — rather than overloading 0 for both "absent" and "zero" — lets a consumer tell an unpopulated field from an attested count. See ParseParamShape for the per-shape population contract.
const ReleaseVersion = "0.4.0"
ReleaseVersion is the module release this source tree builds — the third version axis, distinct from both BestiarySchemaVersion (the public JSON output contract) and the SQLite store schema number. It exists so anything that has to NAME the running build — today the offline ingest bots' User-Agent — reads one constant instead of carrying its own literal. The Ollama bot's User-Agent sat at "0.2.4" for three releases precisely because it was a literal, and a stale version misreports the tool to the operators whose registry it polls.
It is the module tag WITHOUT the leading "v": tag v0.2.11 -> "0.2.11". Bump it on the release branch, in the same commit that cuts the CHANGELOG stanza (see AGENTS.md, "Releases"); TestReleaseVersion_Exact pins the current value so the bump cannot be silently skipped.
const UpstreamGitCommit = "bf55e760"
UpstreamGitCommit is the short Git commit hash of the models.dev repository revision that corresponds to UpstreamSchemaVersion.
const UpstreamGitRemote = "git@github.com:anomalyco/models.dev.git"
UpstreamGitRemote is the canonical Git remote URL for the models.dev repository from which the upstream schema was sourced.
const UpstreamSchemaVersion = "2026.07.12-a0d8cb006e5c2b848dd96fe622e4a61cf405906a1f4bb9a2dc03fdd890ddaac8"
UpstreamSchemaVersion identifies the exact snapshot of the models.dev schema that this bestiary schema was derived from. Format: YYYY.MM.DD-sha256 where sha256 is the full 64 lowercase hex character SHA-256 hash of the upstream schema file (packages/core/src/schema.ts).
const VRAMFormulaVersion = 2
VRAMFormulaVersion identifies the VRAM estimation formula in use. Version 2 uses ingested GGUF file size as the weights term (never derived from bits-per-weight) and fp16 KV cache with no overhead constant.
const VRAMKVElemBytes = 2
VRAMKVElemBytes is the number of bytes per element in the KV cache. The KV cache is stored in fp16 (half-precision float), so each element occupies 2 bytes.
Variables ¶
This section is empty.
Functions ¶
func BaseRefFor ¶ added in v0.2.4
BaseRefFor returns the curated base model reference string for the model identified by id, or the empty string when no base_ref is curated for it. Matching is case-insensitive.
Codegen uses this to infer a DerivationFinetune lineage edge for community finetunes whose base model is known from Ollama metadata. An empty result means the model is not a curated finetune (or its base is not known).
func CanonicalizeModifiers ¶ added in v0.2.2
CanonicalizeModifiers returns a NEW slice containing the modifiers de-duplicated (case-insensitively, first spelling wins) and sorted into the canonical order. An empty or all-empty input returns nil (the canonical "no modifiers" value), so the public contract is: empty → nil; single → 1-elem; multiple → canonical-ordered. It never mutates the input slice.
func ClassifyIDPrefix ¶ added in v0.2.10
func ClassifyIDPrefix(id ModelID, p Provider) (IDPrefixClass, ModelID)
ClassifyIDPrefix classifies the leading token of id given the provider serving it, and returns the id the decomposition should read. On IDPrefixNone the id comes back byte-identical; on any other class the leading token and its separator are removed.
Namespaced ids (containing "/") are never split here: their org segment is already the vendor/namespace strip's job (lastPathSegment), and a token that merely begins with a vendor word inside an org segment must not be touched — the same guard DetectHost carries.
The rules, in order, each stated as the carrier that makes it safe:
SELF-PROVIDER. The token equals the serving provider's slug, so the Provider field already holds it. Measured: databricks prefixes all 30 of its own ids with "databricks-".
CREATOR. The token is in the Creator vocabulary AND the family the remainder names declares that same creator, so the Creator axis already holds it. Measured: "openai-gpt-5.6-luna" (snowflake-cortex, digitalocean, venice) and "openai.gpt-5.6-luna" (amazon-bedrock's region-less profile form) both decompose to family gpt, whose curated creator IS openai.
Both rules are gated on the remainder still naming a known family, so a strip can never leave a stub behind (see remainderFamily).
WHAT IS DELIBERATELY NOT STRIPPED, because no carrier holds it:
- A backend-host label — a token naming a provider OTHER than the serving one. nano-gpt's "azure-gpt-4o" is served by nano-gpt, not by Azure, so "azure" is the only place that routing fact appears; it fails rule 1 (wrong provider) and rule 2 (not a creator) and is left alone. The Host axis is where it is carried when curated. A blanket provider-name strip erased exactly this label once, and the rule above is what makes that a consequence of the definition rather than a remembered exception.
- A product-surface namespace. Measured: gitlab prefixes all 22 of its ids with "duo-chat-". "duo-chat" is neither the provider slug ("gitlab") nor a creating lab, and no axis in the entity model records which of a provider's surfaces served a model, so stripping it would delete a fact nothing else holds. The constancy of the prefix across a provider's ids is NOT on its own a carrier test: measured, 28 providers prefix every one of their ids with a single token, and for most of them (anthropic's "claude-", xai's "grok-", zai's "glm-", moonshotai's "kimi-", xiaomi's "mimo-", upstage's "solar-") that token is the FAMILY. Constancy would strip identity.
- A lab token the Creator axis spells differently. Measured: amazon-bedrock serves "zai.glm-…" and "moonshot.kimi-…", but the curated creators of glm and kimi are "zhipu" and "moonshotai". The carrier does not hold the value the id spells, so rule 2 correctly declines; a creator-alias vocabulary is the honest fix and is not in this change.
func ContextWindowFor ¶ added in v0.2.4
ContextWindowFor returns the curated maximum context window in tokens for the model identified by id, or 0 when no context_window is curated for it. Matching is case-insensitive.
Codegen uses this as the model-max override when computing VRAMBytes: a non-zero value from this function takes precedence over ModelInfo.ContextWindow from the models.dev catalog.
func DefaultDBPath ¶
DefaultDBPath returns the default path for the models database. It uses $XDG_CACHE_HOME/bestiary/models.db, falling back to ~/.cache/bestiary/models.db when XDG_CACHE_HOME is not set.
func DerivedWeightsBytes ¶ added in v0.2.10
func DerivedWeightsBytes(totalParams int64, q Quantization) (int64, bool)
DerivedWeightsBytes estimates a weights footprint from an attested TOTAL parameter count and a quantization's bits-per-weight.
It returns ok=false rather than a wrong number whenever the figure would be dishonest: when totalParams is ParamShapeNull or non-positive (upstream published no total), or when BitsPerWeight is 0 — the six members none, awq, gptq, int8, int4 and other, whose effective bits-per-weight is configuration-dependent and not ingested. A zero-byte row would read as "fits in any budget", which is the opposite of what an absent fact means.
It NEVER writes to QuantVRAM and never feeds VRAMBytes; see the invariant amendment in vram.go.
func DetectHost ¶ added in v0.2.3
DetectHost inspects a model ID for a curated serving-host PREFIX and, on a match, returns the corresponding Host plus the host-stripped ID. For example "azure-gpt-4o" → (HostAzure, "gpt-4o"). When no curated prefix matches it returns (HostNone, id) unchanged.
Detection is intentionally curated and ID-PREFIX-ONLY:
- It NEVER consults the Provider field. A genuine host-as-provider (e.g. provider "azure-cognitive-services" serving a plain "gpt-4o" ID) carries no host prefix on its ID, so Host stays HostNone — the host is implied by the Provider, not duplicated as an instance attribute. This is the guard against the v0.2.2 blanket provider-name strip that erased a backend label.
- Namespaced IDs (org/model, containing "/") are never split, so an org token that merely begins with a host word (e.g. "azure-cognitive-services/gpt-4o") is left untouched and Host stays HostNone.
Host is a per-instance ATTRIBUTE: stripping it makes the remaining (Family,Variant,Version) tuple host-independent, so a host-routed instance shares its entity identity with the plainly-served model.
func DetectQuantization ¶ added in v0.2.4
func DetectQuantization(id ModelID) (Quantization, string, ModelID)
DetectQuantization inspects a model ID for an embedded or trailing quantization tag in Ollama-style notation (e.g. "llama3.3:70b-instruct-q4_K_M") and returns:
- q: the matched Quantization constant (QuantizationNone when no tag is found; QuantizationOther when a quant-looking tag is present but unrecognised).
- raw: the raw tag string as it appears in the id, without case normalisation (e.g. "q4_K_M"). Empty when no tag is found.
- stripped: the model ID with the quant tag (and its leading separator "-") removed. Equal to id when no tag is found.
Matching is case-insensitive against quantNames so both "Q4_K_M" and "q4_k_m" resolve to QuantQ4_K_M. The function never panics.
This extends DetectHost's (value, stripped-id) shape with the raw matched tag as a third return value.
func EnrichedParamSize ¶ added in v0.2.6
EnrichedParamSize resolves the canonical parameter-size token for a model ID via the PRESENCE-based precedence pin > mechanical > ParamSizeFor:
- a curated pin (param_size_overrides.json) is authoritative when PRESENT, even when its token is "" — a suppress-pin deliberately yields NO size and must never fall through to the mechanical extractor (presence, not value, decides);
- else the mechanical ExtractParamSizeToken decomposition of the ID;
- else the fetch-owned ParamSizeFor fallback (curated quant_vram.json), which ranks LAST so an Ollama-bot refresh of a fetch-owned param_size can never flip a stable ID-derived entity key.
The returned err is a DISAGREEMENT signal — non-nil only when the ID is UNPINNED and BOTH the mechanical token and the ParamSizeFor fallback are present yet differ. That is a curation gap a human must resolve (add a pin). The returned token is still valid (the mechanical token wins per precedence), so runtime callers ignore the error and degrade gracefully; codegen treats it as a LOUD, actionable failure.
func EntityKeys ¶ added in v0.2.7
func EntityKeys() []string
EntityKeys returns the canonical entity-key values of every generated Entity__* constant. The returned slice is a defensive copy; mutating it does not affect future calls. See ProvidersOf in registry.go to enumerate an entity's providers.
func EntityModifiers ¶ added in v0.2.3
EntityModifiers returns the IDENTITY-class subset of mods, de-duplicated and in canonical order (see CanonicalizeModifiers). It is the projection used to build the "{identity-mods}" segment of an entity key: attribute-class modifiers are dropped because they do not affect identity. An empty/all-attribute input returns nil (the canonical "no identity modifiers" value).
EntityModifiers is implemented in terms of ClassifyModifier, so it tracks the curated table automatically: a token classifies as identity (and is retained here) unless the table — global or per-family override — demotes it to attribute. Unknown tokens default to identity and are retained — EXCEPT migrated stage-axis tokens (preview/latest/original), which are routed out FIRST (via isStageToken, before ClassifyModifier) so their absence from the curated table never lets the identity fail-safe pull them into the key.
func EstimateVRAMBytes ¶ added in v0.2.4
EstimateVRAMBytes estimates the total VRAM requirement in bytes for a model given its weights footprint and architectural parameters.
Formula:
total = weightsBytes + KV KV = 2 * layers * kvHeads * headDim * contextTokens * VRAMKVElemBytes
The KV term accounts for both the K and V matrices (hence the leading 2), fp16 element size (VRAMKVElemBytes = 2), and is GQA-aware: kvHeads is the KV-head count, not the query-head count.
The weights term is always the ingested GGUF file size passed in as weightsBytes — for every BAKED figure it is the ground-truth measurement, never derived from bits-per-weight arithmetic.
Amendment: a separately-typed DERIVED weights projection exists for entities with an attested total parameter count and no ingested file size (WeightsBasis / DerivedWeightsBytes in fit.go). It is computed at display time from TotalParams x BitsPerWeight, always carries BasisDerived and a weights-only qualification, and NEVER reaches this function, QuantVRAM.WeightsBytes or VRAMBytes. VRAMFormulaVersion is unaffected by it and stays 2. The invariant this paragraph amends is about what the stored datum is, not about what a caller may estimate for display.
KV = 0 (weights-only lower bound) when ANY of layers, kvHeads, headDim, or contextTokens is <= 0. When baking a QuantVRAM row, the caller sets VRAMEstimatePartial = VRAMEstimateIsPartial(layers, kvHeads, headDim). Note: a zero-context bake yields KV=0 WITHOUT partial — partial is reserved for structurally absent arch-facts; the caller chooses its bake context independently. See VRAMEstimateIsPartial for the exact predicate.
Integer arithmetic is int64 throughout. The maximum realistic KV cache (e.g. 200 layers × 128 heads × 256 dim × 2 M context × 2 bytes ≈ 52 TB) is well within int64 range (~9.2 EB), so no overflow protection is needed for any plausible model at the time of writing.
func ExtractDate ¶
ExtractDate extracts a date string from a model ID or release date field, normalizing to the YYYY-MM-DD form.
Matching priority:
- id is scanned for a YYYYMMDD or YYYY-MM-DD substring.
- If id has no match, releaseDate is scanned.
Returns "" when no date is found in either field. The returned string always uses the YYYY-MM-DD format (hyphens added for YYYYMMDD).
func ExtractModifier ¶ added in v0.2.0
func ExtractModifier(id ModelID, family Family, variant string) (modifier string, modifierConsumed string)
ExtractModifier returns the modifier suffix found at the trailing end of id (after family and variant are resolved) and the literal substring of id that was consumed (including the leading hyphen).
Resolution: after family + variant are known, the function scans the model ID for a trailing "-<modifier>" token where modifier is in the allowlist from parse/data/modifiers.json. Matching is longest-suffix-first so that "think" does not shadow "thinking" when both are seeded.
Return values:
- modifier: the bare modifier token (e.g. "thinking"), or "" when none found.
- modifierConsumed: the substring removed from id (e.g. "-thinking"), or "" when none found.
The caller should strip modifierConsumed from the model ID before passing to ExtractVersionFromID and ExtractDate, so that the modifier token does not pollute version/date heuristics.
ExtractModifier does not modify ModelInfo or ModelRef fields — it is a pure function that returns values for the caller to wire. Pipeline order:
- ParseFamily (raw → family + variant)
- ExtractModifier (id, family, variant) → modifier, consumed
- Strip consumed from id
- ExtractVersionFromID on cleaned id
- ExtractDate on cleaned id
func ExtractParamSizeToken ¶ added in v0.2.6
ExtractParamSizeToken is the single grammar authority for pulling a parameter-size token out of a model ID. It is shared (by the enrichment path, the metadata join, the offline Ollama tool, and parseBaseRef) so every site decomposes sizes identically and no site re-implements a greedy scan.
It tokenizes id on [-:/] ONLY — '.' and '_' are NOT separators ('.' carries decimal sizes; '_' matches both existing sites' no-underscore behavior and has zero extraction benefit catalog-wide). Candidate windows are contiguous token runs rejoined with their ORIGINAL separators (each window is a contiguous substring of id); the LONGEST window that is a valid size wins (ties break to the leftmost). It returns the CANONICAL token (ParseParamSize-normalized), so callers get the same spelling the entity key uses. Any static-vs-derived skew (a baked ParamSize that disagrees with what this returns) is caught by TestCodegen_UpToDate rather than silently tolerated.
"qwen3-235b-a22b" -> ("235b-a22b", true) // longest whole window, not "235b"
"llama-4-scout-17b-16e" -> ("17b-16e", true)
"lfm-2.5-1.2b" -> ("1.2b", true) // decimal intact
"qwen3-embedding-0.6b" -> ("0.6b", true) // never "6b"
"command-r7b" -> ("", false) // r7b is one token; never substring "7b"
"upstage/solar-10_7b-instruct" -> ("", false) // '_' not a separator; sized via curated pin
func ExtractVersionBetweenFamilyAndVariant ¶ added in v0.2.2
func ExtractVersionBetweenFamilyAndVariant(id ModelID, family Family, variant string) (version string, residual []string)
ExtractVersionBetweenFamilyAndVariant extracts the numeric version component from a model ID that embeds version digits BETWEEN the normalized family prefix and the variant name. This handles the common case where raw_family does not embed the version but the model ID does:
id="claude-3-5-haiku-20241022", family="claude", variant="haiku" → "3.5" id="claude-3.5-haiku", family="claude", variant="haiku" → "3.5" id="gpt-5-mini", family="gpt", variant="mini" → "5"
Returns (version, residual) where:
- version is the dot-joined leading numeric tokens found between family and variant.
- residual contains any tokens between the version and variant that are neither numeric nor the variant first-token (honest-audit signal).
N-M equivalence: hyphen-separated pure-digit tokens are dot-joined so that "3-5" → "3.5" and "4-6" → "4.6". This brings parity with ParseFamilyWithVersion.
Parity contract: ExtractVersionBetweenFamilyAndVariant fires if and only if detectVersionDigitsInID (parse.go) would also fire on the same (id, family, variant). This invariant is enforced by TestExtractVersionBetweenFamilyAndVariant_Parity (parse_internal_test.go), which asserts: detector fires ⟺ extractor returns non-empty version OR non-empty residual.
Algorithm:
- Normalize the family to a canonical single-word form (first alphabetic token of family for multi-token families like "claude-opus" → "claude").
- Strip "<normalizedFamily>-" prefix from the ID. Return ("","") when absent.
- Strip any trailing compact/dash date from the remainder.
- Tokenize on "-". Collect leading purely-numeric tokens up to the first variant-first-token (or end of tokens if variant is empty).
- Dot-join the numeric tokens → version. Tokens after the numeric run that are neither the variant first-token nor purely-numeric are residual.
func ExtractVersionFromID ¶ added in v0.2.0
ExtractVersionFromID extracts a numeric version (e.g. "4.5", "4.6", "2.5", "4o") from a model ID after stripping the known family prefix. Returns "" if no version-like token follows the family prefix.
This is the ID-as-authoritative-source companion to ParseFamilyWithVersion. It is called by codegen (genToModelInfo) when ParseFamilyWithVersion on the raw family field yields an empty version — which is the common case because the upstream models.dev API family strings do not embed version numbers ("claude-opus" not "claude-opus-4-5"). The model ID is where the version lives ("claude-opus-4-5-20251101", "claude-opus-4-6").
Algorithm:
- Strip "<rawFamily>-" from the start of id. If the ID does not begin with that prefix, return "".
- Strip any trailing compact date (YYYYMMDD or YYYY-MM-DD) from the remainder, since those are not version tokens.
- From the remaining string, attempt version extraction: a. All-hyphen-separated-digit tokens (e.g. "4-5") → dot-join → "4.5" b. Dot-version suffix (e.g. "2.5") → return directly c. Single alphanumeric-suffix token (e.g. "4o") → return as-is d. Otherwise → return ""
Examples:
ExtractVersionFromID("claude-opus-4-5-20251101", "claude-opus") → "4.5"
ExtractVersionFromID("claude-opus-4-6-20250514", "claude-opus") → "4.6"
ExtractVersionFromID("claude-opus-4-6", "claude-opus") → "4.6"
ExtractVersionFromID("gemini-2.5-flash", "gemini") → "2.5"
ExtractVersionFromID("gpt-4o", "gpt") → "4o"
ExtractVersionFromID("claude-opus", "claude-opus") → ""
ExtractVersionFromID("claude-3-5-sonnet-20241022","claude") → "" (non-version interleaved tokens)
func FamiliesJSONKeyError ¶ added in v0.2.2
FamiliesJSONKeyError validates that every non-comment key in the raw families.json-style bytes is a known Family (case-insensitive match against allFamilies). Returns nil when all keys are valid, or an actionable error on the first unrecognised key.
Used by tests to verify the validation contract without modifying the embedded data, and by to validate family_aliases.json target keys.
BDD: Given families.json with a typo key "claud" (should be "claude"), When FamiliesJSONKeyError is called, Then a non-nil error is returned mentioning the bad key.
func FamilyAliasesJSONError ¶ added in v0.2.2
FamilyAliasesJSONError validates the canonical-winner ledger bytes (family_aliases.json shape: {"_comment": ..., "aliases": {key: target, ...}}). Each alias TARGET (the canonical family value) must be a known Family (case-insensitive match against allFamilies). Alias KEYS are mislabels and are deliberately NOT validated — they need not be canonical. Returns nil when every target is valid, or an actionable error on the first unknown target.
Reuses familyKeyKnown so the ledger and families.json share one fail-fast validation contract. Used by initParseData (load-time fail-fast) and by tests to verify the contract without mutating embedded data.
BDD: Given a ledger row {"l3": "lluma"} (typo target), When FamilyAliasesJSONError is called, Then a non-nil error naming the bad target is returned.
func FormatAmbiguous ¶
func FormatAmbiguous(w io.Writer, e *ErrAmbiguous)
FormatAmbiguous writes a human-readable two-section disambiguation message for e to w (typically os.Stderr).
Output format (no leading "bestiary: " prefix — the caller supplies the sole one on its wrapped error; see the header comment in the body):
"<input>" matched several distinct models — candidates below: [no matches in namespace "..." — ... (when PURLMissedNamespace is set)] * = canonical provider (only when Section 1 renders) Canonical: (Section 1 — only when canonical rows exist) * <canonical-form> ... (up to 5 rows; "+N more" when >5) Candidates: (Section 1' — only when NO canonical rows exist) <entity-key> ... (up to 5 rows; "… and N more" when >5) Also rehosted by: (omitted when RehostProviders is empty) <provider-name> (one per line, up to 5; "+N more" when >5) <provider-name> ... To see all providers/variants: bestiary list (or: bestiary list --provider <slug>)
The exact-ID escape hatch (--format=raw) is intentionally NOT repeated here: the CLI's wrapped ErrAmbiguous message (runShow, cmd/bestiary/main.go) already carries that instruction as part of its narrowing list, immediately below this output on stderr — one tip, one place, so the two blocks complement rather than restate each other.
Section 1 (Canonical) shows up to 5 representatives from Candidates where the Provider is the canonical/originating provider for the family. Each row is prefixed with "* " to visually mark the canonical origin. When NO candidate has a canonical provider, Section 1' (Candidates) lists up to 5 candidate entity keys instead, so the guidance's "candidates ... listed above" holds for every family class rather than pointing at bare provider slugs.
Section 2 (Also rehosted by) lists up to 5 distinct provider names taken directly from ErrAmbiguous.RehostProviders. The section is omitted entirely when RehostProviders is empty.
The function always returns nil; write errors are silently swallowed because this is advisory stderr output — a write failure should not mask the real ErrAmbiguous that the caller surfaces to the user.
func FormatModel ¶
func FormatModel(w io.Writer, model ModelInfo, format OutputFormat) error
FormatModel writes a single model to w in the specified format.
func FormatModels ¶
func FormatModels(w io.Writer, models []ModelInfo, format OutputFormat) error
FormatModels writes a list of models to w in the specified format.
func IsArchiveSnapshotURL ¶ added in v0.2.10
IsArchiveSnapshotURL reports whether url has the archive.org snapshot shape the curated archive policy requires: the web.archive.org prefix, a 14-digit capture timestamp, then the original URL retained verbatim.
It is the ONE shared format check — the curated nomen-claim fence, the curated suppression-seed fence and the harvested layer's ArchivedURL all match against this single regexp rather than each copying the pattern, so the accepted shape can never drift between them. It is exported because the offline cmd/bestiary-hf bot (a separate package) validates the Wayback Availability API's answer with it before recording an ArchivedURL.
It is a SHAPE check only: it does not fetch the URL and makes no claim that the snapshot exists or resolves.
func IsEnforcedCanonicalFamily ¶ added in v0.2.2
IsEnforcedCanonicalFamily reports whether f is in the CLOSED canonical-winner ENFORCE set (parse/data/family_enforce.json) — a curated list of DISTINCT model families that win over a disagreeing raw_family parent/org mislabel (aion, hermes, mixtral, qwq, …). Exposed for the before/after-diff gate (cmd/bestiary-gen): a lateral family change whose AFTER family is in this set is a SANCTIONED ledger correction (the ID-canonical distinct family beat a parent/org mislabel), not a regression — analogous to the "after ∈ registry" signal but for lateral (non-reduction) corrections. The set is curated data, NOT the categorizer's own logic, so this does not rubber-stamp an arbitrary family rewrite.
func IsKnownFamily ¶ added in v0.2.2
IsKnownFamily reports whether f is a CANONICAL registered family — a value present (case-insensitively) in the generated allFamilies registry (families_gen.go), which is derived directly from the upstream models.dev family field. Synthetic OVER-CAPTURE family strings the ID-path may transiently produce (e.g. "claude-opus", "qwen3-vl-72b", "phi-4-mini") are NOT in that registry. Exposed for the before/after-diff gate, which uses "after ∈ registry ∧ before ∉ registry" as an INDEPENDENT, data-grounded signal that a family change reduced an over-capture to its canonical short base (and so is a genuine fix, not a regression) — the registry is curated upstream data, not the reducer's own logic, so the check does not merely rubber-stamp the implementation.
func JoinEntityMetadata ¶ added in v0.2.5
func JoinEntityMetadata(ents []Entity, meta []EntityMetadata) (attached []Entity, unlinked []MetadataID, standalone []Entity)
JoinEntityMetadata runs the metadata<->entity join over ents with meta and returns three results:
- attached: every provided entity (deep-copied), carrying EVERY metadata row that matched its identity on MetadataAll (sorted ascending by MetadataID) with Metadata set to the derived primary (shortest MetadataID, ties lexicographic ascending). Entities with no matching metadata carry their original Metadata and MetadataAll unchanged.
- unlinked: the MetadataIDs whose decomposed family IS present among the provided entities but whose full tuple matched no entity — disagreements a curator resolves with an alias (the codegen slice emits them as a sorted report).
- standalone: newly synthesized metadata-only entities for metadata whose family is absent entirely (empty Instances, Sources = [models.dev], Metadata attached).
The join is PURE: the caller's ents slice and its elements are never mutated (every returned entity is a fresh deep copy), and every attached *EntityMetadata is a fresh clone of the source row (never aliasing the meta slice).
Re-attach, never re-create: a metadata row whose identity key already matches a provided entity — including a standalone synthesized on an earlier pass and fed back in — is RE-ATTACHED onto that entity rather than duplicated, so repeated joins over the same metadata set are idempotent (no growing standalone set).
Accumulation is CLEAR-THEN-ACCUMULATE: the first row to land on an entity in THIS call clears whatever MetadataAll that entity arrived with (tracked by the touched set) before appending, so re-joining an already-joined set REPLACES the record rather than doubling it. An entity no row lands on is never cleared, so a hand-attached or previously-joined record on an unmatched entity survives.
func ParamSizeFor ¶ added in v0.2.4
ParamSizeFor returns the canonical parameter-size token (e.g. "70b", "3b", "0.5b") for the model identified by id, or the empty string when no param_size is curated for it. Matching is case-insensitive.
The returned value is the lowercased canonical form (validated by ParseParamSize at load time) suitable for EntityRef.ParamSize.
func ParseDataReady ¶
func ParseDataReady() error
ParseDataReady returns the error (if any) from the one-time initialization of the embedded parse data (JSON files + regex compilation). In a correct build the return value is always nil, because the data files are embedded at compile time and the regexes are validated before any release.
This function is primarily useful for startup self-checks and tests. Production code does not need to call it — ParseFamily degrades gracefully when the load fails (see the fail-closed comment inside ParseFamily).
func ParseFamilyDetailed ¶ added in v0.2.0
func ParseFamilyDetailed(raw Family, id ModelID, p Provider) (Family, string, string, []string, *ParseFailure)
ParseFamilyDetailed is the failure-aware companion to ParseFamilyWithVersion. It returns the same three-way decomposition (Family, variant, version) plus an optional *ParseFailure when the parser detects a known incomplete result.
Failure detection covers three modes:
- Version digits trapped between family-prefix and variant: "claude-3-5-haiku-20241022" → the 3-5 version digits are not extracted.
- Suffix overflow: trailing token beyond expected family/variant/version/date. Sub-cases: ReasonKnownSuffixOverflow (token in modifier allowlist) and ReasonUnknownSuffixOverflow (token not in allowlist — extend allowlist).
- YYMM-date-as-version false-positive: a 4-digit numeric segment that looks like a YYMM date (1900–2999 range) but is treated as part of the family/version.
The returned *ParseFailure is an annotation, NOT an error. The function always returns its best-effort family/variant/version values regardless of whether a failure was detected. Callers who need only the parse result can discard the *ParseFailure with _. Callers building an audit log should check failure != nil and accumulate.
Parameters id and p (model ID and provider) are used to populate the failure record fields and are not used in the parse logic itself.
The return order is (family, variant, version, modifier, *ParseFailure). Codegen wiring depends on this exact 5-tuple shape — do NOT reorder.
func ParseParamSize ¶ added in v0.2.4
ParseParamSize canonicalizes a raw parameter-size token into the lowercase form used in EntityRef.ParamSize and ModelInfo.ParamSize (e.g. "70b", "0.5b"). The '#' prefix is NOT part of the returned value; EntityRef.String() adds it.
Canonicalization rules:
- Input is lowercased.
- If the lowercased input is not a recognized param-size token shape (as detected by isParamSizeToken), the function returns ("", error) so the caller knows the input was not a valid size token.
- Empty input returns ("", nil) — no error, no size.
Examples:
ParseParamSize("70B") → ("70b", nil)
ParseParamSize("0.5b") → ("0.5b", nil)
ParseParamSize("8x22B") → ("8x22b", nil)
ParseParamSize("") → ("", nil)
ParseParamSize("4.5") → ("", error) — version token, not a size
func PreferredNomenValue ¶ added in v0.2.7
PreferredNomenValue returns the VALUE of ref's preferred nomen: the canonical key with every seed-suppressed modifier omitted. With no applicable seed entry it is exactly ref.String(), byte for byte — so with an empty seed this function is the identity on every entity in the catalog.
It never mutates ref (the modifier slice is rebuilt, never sliced in place) and it never changes identity: the caller's key is still ref.String().
func SuppressedModifiers ¶ added in v0.2.7
SuppressedModifiers returns the identity-modifier tokens the curated seed declares redundant for ref, sorted. It returns nil when no entry applies — the overwhelmingly common case, and the only case while the seed ships empty.
func VRAMEstimateIsPartial ¶ added in v0.2.4
VRAMEstimateIsPartial reports whether the KV-cache term would be excluded from the VRAM estimate because one or more arch-facts are absent (zero).
Caller contract: when baking a QuantVRAM row, the caller (codegen) sets VRAMEstimatePartial = VRAMEstimateIsPartial(layers, kvHeads, headDim) on the row. VRAMEstimatePartial = true means VRAMBytes is a weights-only lower bound and the KV-cache was NOT included. The contextTokens argument is NOT checked here because a zero context with valid arch-facts is a legitimate caller choice (weights-only result by intent); the partial flag is reserved for the case where arch-facts are structurally absent from the source data.
func ValidateCreatorProviderTable ¶ added in v0.2.10
func ValidateCreatorProviderTable() error
ValidateCreatorProviderTable is the LOUD codegen guard for the curated Creator→[]Provider distribution relation: it loads and validates parse/data/creator_providers.json and returns a non-nil error when the file is missing, malformed, or carries an unknown creator, a duplicate creator, an empty provider list, an unknown provider, or a provider repeated within a row. cmd/bestiary-gen calls it before baking so bad curation fails codegen with an actionable message rather than silently degrading. (The runtime path uses loadCreatorProviderTableSafe, which degrades to an empty relation instead.)
func ValidateCreatorTable ¶ added in v0.2.8
func ValidateCreatorTable() error
ValidateCreatorTable is the LOUD codegen guard for the curated creator dimension: it loads and validates parse/data/creators.json and returns a non-nil error when the file is missing, malformed, or carries an unknown family, a duplicate family, or an empty creator. cmd/bestiary-gen calls it before baking so a bad seed fails codegen with an actionable message rather than silently degrading. (The runtime path uses loadCreatorTableSafe, which degrades to CreatorNone instead.)
func ValidateDataSourceTable ¶ added in v0.2.4
func ValidateDataSourceTable() error
ValidateDataSourceTable loads the curated data-source table and verifies its referential integrity: it returns any load/parse error, and additionally checks that every DatasetIngested.SourceID and every EntitySource.SourceID resolves to a DataSource (URI uniqueness is enforced at parse time in parseDataSourceTable).
Codegen (cmd/bestiary-gen run()) calls this once, alongside ValidateLineageTable and ValidateQuantVRAMTable, and aborts on a non-nil result. Two FK invariants are caught at generation time rather than baking an orphan provenance row:
- the curated datasources.json is internally sound (no duplicate id/uri, every ingest source_id present in the dimension); and
- no entity↔source attestation names a source absent from the dimension. The attestation rows come from the registry COMPILED INTO THIS BINARY (the previously generated staticModels), and their SourceIDs come from the attestation rule (models.dev + each row's curated Source). datasources.json is an INDEPENDENT curated file, so this cross-input check is genuinely falsifiable: a Source added to the model curation without a matching datasources.json row is rejected — on the next codegen run after that Source bakes into staticModels.
func ValidateEntitySourceTable ¶ added in v0.2.4
func ValidateEntitySourceTable() error
ValidateEntitySourceTable verifies that every EntityKey in the entity↔source join relation resolves to a real registry entity, and surfaces any data-source load error first via ValidateDataSourceTable.
It is deliberately NOT wired into codegen. Unlike the lineage key-resolves guard (which cross-checks an INDEPENDENT curated file against the registry), the entity↔source relation is DERIVED from the registry: loadEntityIndex builds both the relation rows and the entity index from the same scan, so every row's EntityKey is a key of that index by construction and the resolver here cannot fail against the production relation — wiring it into codegen would assert a tautology and misleadingly imply the key FK is enforced at generation. The check is kept as a public, unit-tested guard (its seam, validateEntityKeyFKs, is falsified with a constructed orphan) so it is ready the moment entity↔source rows are sourced INDEPENDENTLY of the entity index (e.g. a curated join file or the SQLite store), at which point the key FK stops being tautological. Until then the genuine codegen FK guard is ValidateDataSourceTable, which cross-checks the independent datasources.json.
func ValidateHFNomina ¶ added in v0.2.8
func ValidateHFNomina() error
ValidateHFNomina is the LOUD codegen guard over the harvested HF seed: it surfaces any load/parse error (empty value, non-org/repo value, source_url that is not the live Hub URL for the value, a PRESENT archived_url that is not an archive.org snapshot, empty family, duplicate), AND checks the entity FK — every harvested nomen must resolve to a REAL registry entity (the meaningful integrity guard for the harvested layer, the datasource.go FK-guard precedent). Codegen (cmd/bestiary-gen run()) calls it alongside the other Validate* guards and aborts the bake on a non-nil result, so a malformed, case-mangled, or orphan-resolving harvested seed never bakes into the static catalog. The runtime loader (loadHFNominaSafe) degrades gracefully instead.
func ValidateLineageTable ¶ added in v0.2.3
func ValidateLineageTable() error
ValidateLineageTable loads the curated lineage table and returns any load/parse/validation error (nil when the table is well-formed). Codegen calls this once and aborts on a non-nil result so bad curation — an unknown parent family, a malformed entry — is caught at generation time rather than silently dropping lineage at runtime.
func ValidateNoBetaInIdentity ¶ added in v0.2.7
ValidateNoBetaInIdentity is the LOUD codegen guard for the beta-always-stage rule: beta is a RELEASE STAGE, never part of a model's identity.
The two axes are independent by design — DetectStageFromID scans the ID without stripping, so a row can carry Stage=StageBeta while its entity key says nothing about beta. The failure this guard catches is the COEXISTENCE: a decomposition that also promotes the beta token into the key, so one record asserts beta as both a stage and an identity. That is not merely redundant, it is contradictory — it splits a lab's beta and non-beta spellings of one artifact into two entities that the stage axis simultaneously claims are the same model at different maturities.
Scope is exactly two shapes, because those are the two ways a token reaches a key:
- Variant == "beta" (the token promoted into the variant slot)
- "beta" among the entity's IDENTITY modifiers (the token in the {…} segment)
An ATTRIBUTE-class beta would not reach the key and is not a violation; neither is a family or version that merely contains the substring (only whole-token equality counts, case-folded). The error names the offending entity key and every model ID that landed on it, so a curator can pin the row the way interfaze/interfaze-beta is pinned rather than hunting for it.
Codegen calls this over the assembled entity set and ABORTS the bake; the runtime never calls it. There is deliberately NO allowlist: the last exception (interfaze/beta) was resolved by curation rather than exempted, and an allowlist would let the next one accumulate silently.
func ValidateNomina ¶ added in v0.2.7
ValidateNomina is the LOUD codegen guard, with the v0.2.8 INVERTED semantics: a same-triple (value, scheme, entity_key) disagreement is a conflict ONLY when the records disagree on Status — bestiary's single editorial judgment per name. Two records sharing the triple but carrying DIFFERENT attesters (SourceURL / Source / Authority / Method) are LEGAL: they union into one Nomen's multi-attestation set (the v0.2.8 lift; formerly this was a conflict). This is exactly coalesceNomina's discipline, so the guard delegates the union-and-Status-check to it, then verifies the structural invariants each coalesced Nomen must satisfy:
- at least ONE attestation (a name with no evidence is a defect);
- no BYTE-IDENTICAL duplicate attestation (coalesce dedups, so a survivor is a bug in the union path).
Codegen calls this over MintNomina's output, aborting the bake on conflict; the runtime never does (it degrades via coalesceNominaOrRaw).
func ValidateParamSizePins ¶ added in v0.2.6
func ValidateParamSizePins() error
ValidateParamSizePins checks that every curated pin token in param_size_overrides.json is CANONICAL: a non-empty token must round-trip through ParseParamSize to itself (a suppress-pin "" is allowed and skipped). It returns an actionable error naming every offending id -> token pair so a typo (e.g. "17b-16ee") is caught at CODEGEN, before a non-canonical token can ever flow into #size key material. The runtime loader stays graceful (a bad file degrades to an empty map); this is the codegen-time discipline that fences the pin file.
func ValidateQuantVRAMTable ¶ added in v0.2.4
func ValidateQuantVRAMTable() error
ValidateQuantVRAMTable loads the curated quant-VRAM table and returns any load/parse/validation error (nil when the table is well-formed). Codegen calls this once and aborts on a non-nil result so bad curation — an unknown quant token, zero weights_bytes, a duplicate model_id, a malformed param_size, an unknown source — is caught at generation time rather than silently producing wrong VRAM estimates at runtime.
func ValidateSuppression ¶ added in v0.2.7
ValidateSuppression is the LOUD codegen guard over the seed AGAINST THE CATALOG. It performs the two checks that need the entity set:
- EXISTENCE: every seed entry must name an entity that actually exists, otherwise the entry is dead curation that silently protects nothing.
- COLLISION: a suppressed preferred value must not equal any other entity's preferred value. Two entities sharing one preferred spelling would make the preferred naming ambiguous — precisely the property preferring a naming is meant to supply — so it is a curation error, never resolved by last-write-wins.
Codegen calls it over the built entity set; the runtime never does (it degrades).
func ValidateSuppressionSeed ¶ added in v0.2.7
func ValidateSuppressionSeed() error
ValidateSuppressionSeed is the LOUD codegen guard over the seed FILE: it surfaces the load/parse error the runtime accessor swallows, so a malformed or dead seed entry fails the bake instead of silently degrading to "no suppression".
Types ¶
type AcceptabilityRating ¶
type AcceptabilityRating int
AcceptabilityRating classifies a Designation by its acceptability status, following ISO 1087 terminology principles.
Acceptability is ACTIVE as of the naming-layer epoch: the SchemeCanonical designation (and the NomenSchemeCanonical nomen) carry AcceptabilityPreferred — the canonical decomposed key is the preferred designation of an identity — while raw / HuggingFace / PURL forms stay AcceptabilityAdmitted. AcceptabilityDeprecated is still unused (no designation is deprecated yet); its assignment is deferred to a follow-up curation epoch.
Preferred is not necessarily UNIQUE per entity within the canonical scheme: the redundant-modifier suppression policy (suppression.go) can demote an entity's KEY spelling to Admitted and promote the shorter, modifier-free spelling to Preferred. Both are canonical nomina of the same entity and both resolve to it — the rating records which spelling bestiary recommends, never which spelling is the identity.
const ( // AcceptabilityAdmitted is the default rating. The designation is // recognized and may be used, but is not the preferred form. AcceptabilityAdmitted AcceptabilityRating = iota // AcceptabilityPreferred marks the designation as the recommended form. The // SchemeCanonical designation and the NomenSchemeCanonical nomen carry it: the // canonical decomposed key is an identity's preferred designation. AcceptabilityPreferred // AcceptabilityDeprecated marks the designation as no longer recommended. // Currently no designations are deprecated in this epoch. AcceptabilityDeprecated )
func (AcceptabilityRating) MarshalJSON ¶
func (r AcceptabilityRating) MarshalJSON() ([]byte, error)
MarshalJSON serializes AcceptabilityRating as a JSON string (e.g. "admitted"). This satisfies the bestiary.schema.json $defs/AcceptabilityRating enum contract, which declares the type as a string — not a number.
func (AcceptabilityRating) String ¶
func (r AcceptabilityRating) String() string
String returns a human-readable label for the rating.
func (*AcceptabilityRating) UnmarshalJSON ¶
func (r *AcceptabilityRating) UnmarshalJSON(b []byte) error
UnmarshalJSON deserializes a JSON string into an AcceptabilityRating. Accepted values: "admitted", "preferred", "deprecated" (case-insensitive). Returns an error if the string is not recognized.
type AttestationAuthority ¶ added in v0.2.8
type AttestationAuthority int
AttestationAuthority records WHOSE VOICE an attestation's evidence document is: the namespace owner/creator speaking for itself (Primary) or an aggregator relaying it (Secondary). It is a per-attestation fact — the same name can be attested Primary by its creator and Secondary by an aggregator, so the axis cannot live on the DataSource dimension.
It follows the ELEMENT-enum convention (the NomenScheme / Quantization precedent): every attestation arrives with a value, so AuthorityUnknown sits AT zero as the fail-safe (never a "none" sentinel).
const ( // AuthorityUnknown is the fail-safe bucket (zero value): an attestation whose // voice is not yet recognized. AuthorityUnknown AttestationAuthority = iota // AuthorityPrimary is the namespace owner or creator speaking for itself (the // Hub is authoritative for the huggingface scheme; bestiary is authoritative // for its own canonical scheme). AuthorityPrimary // AuthoritySecondary is an aggregator or relayer reporting the naming (a // catalog's raw-ID spelling, an Ollama tag). AuthoritySecondary )
func (AttestationAuthority) MarshalText ¶ added in v0.2.8
func (a AttestationAuthority) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler (the NomenScheme precedent): the enum serializes as its lowercase token, never its underlying int. It never errors.
func (AttestationAuthority) String ¶ added in v0.2.8
func (a AttestationAuthority) String() string
String renders the AttestationAuthority as its lowercase wire token. An out-of-range value degrades to "unknown" (never a panic).
func (*AttestationAuthority) UnmarshalText ¶ added in v0.2.8
func (a *AttestationAuthority) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, the inverse of MarshalText. An unrecognized token is an actionable error (the NomenScheme precedent), never a silent AuthorityUnknown.
type BenchmarkResult ¶ added in v0.2.5
type BenchmarkResult struct {
// Name is the benchmark name (required upstream, e.g. "MMLU", "GPQA").
Name string
// Version is the benchmark version, when the source distinguishes one.
Version string
// Variant is the benchmark variant / subtask, when the source distinguishes one.
Variant string
// Dataset is the evaluation dataset, when the source names one.
Dataset string
// Harness is the evaluation harness / framework used, when the source names one.
Harness string
// Metric is the reported metric name (e.g. "accuracy", "pass@1").
Metric string
// Score is the numeric score, or 0 when the upstream score is non-numeric
// (in which case the verbatim value is preserved on ScoreRaw).
Score float64
// ScoreRaw is the verbatim upstream score when it is non-numeric (e.g. a
// string), and empty when Score is numeric. Upstream reports scores as either
// a number or a string; capturing the raw form here keeps a string score from
// dropping the row or failing the parse.
ScoreRaw string
// SourceURL is the URL of the original claimant (the lab blog or model card).
// It is named SourceURL rather than Source to avoid colliding with the
// DataSourceID-typed Source fields on ModelInfo and EntityMetadata: a claim
// attribution (who reported the score) and an ingest attestation (which data
// source bestiary read the row from) are different provenance levels and must
// not share a field name.
SourceURL string
// Date is the claim date in YYYY-MM-DD format, when the source gives one.
Date string
}
BenchmarkResult is one benchmark claim as reported by the publishing organization. Its fields are grouped along the assessment-provenance joints — criterion identity, apparatus, assessment value, and claim attribution — and are NEVER concatenated into a single string, so a future canonical benchmark dimension can join on the separated fields.
These scores are attributed claims by the lab that published the model (a blog post or model card), not independent third-party measurements; callers must treat them as such.
type CanonicalFilter ¶
CanonicalFilter selects models by their parsed canonical axes. Empty fields act as wildcards: an empty Family matches any family, an empty Variant matches any variant, an empty Version matches any version, and an empty Date matches any date. This is the parameter type for Store.QueryByCanonical.
type CanonicalScheme ¶
type CanonicalScheme int
CanonicalScheme identifies the string serialization format for a ModelRef. Callers use it to select how a model identity is expressed as a string, e.g. for CLI output, SBOM generation, or HuggingFace Hub lookups.
const ( // SchemeCanonical is the default slash-separated canonical form: // <provider>/<family>/<variant>@<date> // When no variant is present the variant segment is omitted. // Provider-specific representations (e.g. anthropic/claude-opus-4-20250514) // may be emitted where the canonical triple lacks sufficient granularity. SchemeCanonical CanonicalScheme = iota // SchemeHuggingFace produces the HuggingFace Hub form: // <provider>/<raw-id> // This matches the repo-id used by the HuggingFace Hub API. SchemeHuggingFace // SchemePURL produces a Package URL (purl-spec + ECMA-427) form: // pkg:huggingface/<org>/<repo> // // RENDER is restricted to HuggingFace-hosted refs, where the raw model ID already // is the Hub org/repo path; every other provider renders "" rather than a // fabricated foreign key (see ModelRef.formatPURL for the reasoning). PARSE stays // lenient: Resolve accepts the legacy "pkg:huggingface/<provider>/<raw-id>" // spelling this package once emitted (Postel). SchemePURL // SchemeRaw returns the original API model ID verbatim (string(ModelRef.ID)). SchemeRaw // SchemeOCI is the purl-spec `pkg:oci` external-identifier scheme token. It is // APPENDED at the iota tail (after SchemeRaw) so every pre-existing scheme's wire // int is unchanged (wire stability, the quant "reserved at end" discipline). // // OCI identity is CONTENT-ADDRESSED and per-quant: the manifest digest that makes a // `pkg:oci` purl unique lives on QuantVRAM.OCIDigest (entity.go), not on ModelRef. // So this token is recognized for CLI --scheme/--format selection and JSON round-trip, // but ModelRef.Format(SchemeOCI) returns "" BY DESIGN (a bare ref has no single OCI // identity). The render helpers live at quant altitude: formatOCIPurl (oci.go) and // (QuantVRAM).OCIPurl. SchemeOCI )
func ParseScheme ¶
func ParseScheme(s string) (CanonicalScheme, error)
ParseScheme converts a string to a CanonicalScheme. Accepted values: "canonical", "huggingface", "purl", "raw", "oci". Returns an error if the string is not a recognized scheme. Used by CLI flag parsing (--scheme flag in cmd/bestiary).
func (CanonicalScheme) MarshalJSON ¶
func (s CanonicalScheme) MarshalJSON() ([]byte, error)
MarshalJSON serializes CanonicalScheme as a JSON string (e.g. "canonical"). This satisfies the bestiary.schema.json $defs/CanonicalScheme enum contract, which declares the type as a string — not a number.
func (CanonicalScheme) String ¶
func (s CanonicalScheme) String() string
String returns a human-readable name for the scheme. Used in debug output and error messages; not a serialized form.
func (*CanonicalScheme) UnmarshalJSON ¶
func (s *CanonicalScheme) UnmarshalJSON(b []byte) error
UnmarshalJSON deserializes a JSON string into a CanonicalScheme. Accepted values: "canonical", "huggingface", "purl", "raw", "oci" (case-insensitive). Returns an error if the string is not recognized.
type Capability ¶
Capability represents a model capability that may carry additional configuration. For most capabilities, Supported is the only relevant field. For interleaved, Config may hold additional details (e.g., {"field": "reasoning_details"}).
type CapabilityUnion ¶ added in v0.2.3
type CapabilityUnion struct {
Reasoning bool
ToolCall bool
Attachment bool
Temperature bool
StructuredOutput bool
Interleaved bool
OpenWeights bool
}
CapabilityUnion is the aggregate capability view across all instances of an entity: each boolean is the OR over the corresponding per-instance capability (an entity "supports" a capability if ANY instance does). The zero value (all-false) is the identity-safe default for an entity with no instances.
type Catalog ¶ added in v0.2.5
type Catalog struct {
// Models is the providers view (api.json shape).
Models []ModelInfo
// Metadata is the models view (models.json shape).
Metadata []EntityMetadata
}
Catalog is the parsed catalog.json artifact: the two views models.dev publishes from a single upstream deploy. Models is the providers view (the api.json shape) and Metadata is the models view (the models.json shape).
Catalog is a parser return container, not a serialized public output document, so it is intentionally NOT a $def in bestiary.schema.json; the Go type exists only to carry the two parsed views together.
func ParseCatalogJSON ¶ added in v0.2.5
ParseCatalogJSON decodes a catalog.json artifact ({models, providers}) into a Catalog. It is the SAME decode path Client.FetchCatalog uses, and is exactly the composition of ParseAPIJSON over the providers value and ParseModelsJSON over the models value — both views come from a single upstream deploy.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetches model metadata from the models.dev API. Use NewClient to construct a Client with sensible defaults.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient creates a Client with the given options applied on top of defaults. Defaults: 30 s timeout, 2 retries, "https://models.dev/api.json".
func (*Client) FetchCatalog ¶ added in v0.2.5
FetchCatalog retrieves both catalog views in a single request from the models.dev catalog.json artifact (URL derived as a sibling of the base URL). Its retry, body-limit, and error semantics match FetchModels.
func (*Client) FetchModelMetadata ¶ added in v0.2.5
func (c *Client) FetchModelMetadata(ctx context.Context) ([]EntityMetadata, error)
FetchModelMetadata retrieves the provider-agnostic model facts from the models.dev models.json artifact (URL derived as a sibling of the base URL). Its retry, body-limit, and error semantics match FetchModels. Source and LastSynced on each returned EntityMetadata are left zero; the caller assigns them on persist.
func (*Client) FetchModels ¶
FetchModels retrieves all model metadata from the models.dev api.json artifact. It retries on transient failures (non-2xx responses, network errors, or a malformed body) up to c.retries additional times with linear backoff, honouring ctx between attempts.
On final failure it returns *ErrAPIUnavailable so callers can use errors.As to inspect structured fields.
LastSynced on each returned ModelInfo is left empty; the caller must set it when persisting the results.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a functional option for configuring a Client.
func WithBaseURL ¶
func WithBaseURL(url string) ClientOption
WithBaseURL overrides the API endpoint. The default is "https://models.dev/api.json". The models.json and catalog.json artifact URLs are derived from it as siblings, so a test server pointed here via WithBaseURL serves all three artifacts by routing on the request path.
func WithRetries ¶
func WithRetries(n int) ClientOption
WithRetries sets the number of retry attempts after an initial failure. For example, WithRetries(2) means up to 3 total attempts. The default is 2 retries.
func WithTimeout ¶
func WithTimeout(d time.Duration) ClientOption
WithTimeout sets the HTTP request timeout. The default is 30 seconds.
type ContextBound ¶ added in v0.2.10
type ContextBound int
ContextBound names WHICH limit produced a row's max affordable context. It is reported alongside MaxContext because "32,768 tokens" means two different things depending on whether the budget or the model ran out first: the first is improved by buying VRAM, the second is not.
const ( // ContextBoundUnknown means the KV-cache term is not computable for this row // because at least one architecture fact (layers, KV heads, head dim) is absent. // A row in this state reports NO context figure at all — never an unbounded one: // an absent fact is not an infinite budget. ContextBoundUnknown ContextBound = iota // ContextBoundBudget means the VRAM budget ran out before the model's own context // window did. ContextBoundBudget // ContextBoundModel means the model's own context window ran out before the budget // did: the row can afford every token the model accepts. ContextBoundModel )
func (ContextBound) String ¶ added in v0.2.10
func (c ContextBound) String() string
String returns a short lowercase label for the bound. An out-of-range value renders as "contextbound(<n>)" so an unexpected value is never silently displayed as a legitimate one.
type CostTier ¶ added in v0.2.5
type CostTier struct {
// ContextSize is the token threshold at which this tier's overrides apply.
ContextSize int
// TierCost is embedded so its cost fields flatten to the tier level in JSON.
TierCost
}
CostTier is a context-size-conditional price tier: the TierCost overrides apply once the request context reaches ContextSize tokens. Upstream, a tier's type is always "context", so only the token threshold is modeled here (as ContextSize) and the TierCost bundle is embedded so its cost fields flatten to the tier level in JSON.
The fixed context_over_200k override on ModelInfo and this general tiers list BOTH express context-conditional pricing: context_over_200k is upstream's legacy fixed-threshold special case and CostTier is the general mechanism. They are kept separate for wire fidelity — unifying them would invent data upstream does not assert.
type Creator ¶ added in v0.2.8
type Creator string
Creator identifies the lab / organization that TRAINED or created a model's weights — the SPDX "originator". It is DISTINCT from Provider (the SPDX "supplier"/distributor): a model created by one lab is frequently hosted by many providers, and a single provider hosts models from many creators. Meta creates Llama (Provider is often "local", "together", "fireworks", …); Anthropic both creates AND hosts Claude, so its Creator and one of its Providers coincide, but the two axes remain conceptually separate.
Like Provider, Creator is an OPEN string type: there are many labs and the set grows as the huggingface ingest surfaces new originators, so a closed int enum cannot scale. Well-known constants give type safety at call sites while the type stays extensible. CreatorNone (the empty string, the zero value) is the honest value for an unmapped family — bestiary emits nothing rather than a wrong-but-plausible guess.
const ( // Seed labs curated by hand before the lab-prefix derivation existed. Their // rows in creators.json WIN over any lab-derived value (curated-over-derived), // which is why CreatorZhipu keeps the lab's short name "zhipu" even though the // models.dev lab prefix for the same organization spells itself "zhipuai". CreatorMeta Creator = "meta" CreatorOpenAI Creator = "openai" CreatorAnthropic Creator = "anthropic" CreatorGoogle Creator = "google" CreatorMistral Creator = "mistral" CreatorCohere Creator = "cohere" CreatorDeepSeek Creator = "deepseek" CreatorAlibaba Creator = "alibaba" CreatorZhipu Creator = "zhipu" // Tokens introduced by the models.dev LAB-PREFIX derivation: the leading // "<lab>/" segment of a metadata id is the originator the upstream catalog // itself asserts, so a family reached by exactly one lab seeds that lab as its // Creator. Every token here is a lab prefix verbatim — it is NOT re-spelled to // match a Provider slug, because Creator and Provider are independent axes // (CreatorMoonshotAI and ProviderMoonshotAI coincide; CreatorDeepReinforce has // no provider counterpart at all). CreatorDeepReinforce Creator = "deepreinforce" CreatorMeituan Creator = "meituan" CreatorMicrosoft Creator = "microsoft" CreatorMiniMax Creator = "minimax" CreatorMoonshotAI Creator = "moonshotai" CreatorNvidia Creator = "nvidia" CreatorPerplexity Creator = "perplexity" CreatorPoolside Creator = "poolside" CreatorSakana Creator = "sakana" CreatorSarvam Creator = "sarvam" CreatorStepFun Creator = "stepfun" CreatorTencent Creator = "tencent" CreatorThinkingMachines Creator = "thinkingmachines" CreatorXAI Creator = "xai" CreatorXiaomi Creator = "xiaomi" // Tokens introduced by HAND-CURATED rows for families the models.dev metadata // join does not reach (a family with catalog entities but no models.json row // has no lab prefix to derive from). These are the originators of the largest // otherwise-unattributed families; each one is priced at the full five-part // cost documented on Creators. Creator01AI Creator = "01ai" CreatorAI21 Creator = "ai21" CreatorAmazon Creator = "amazon" CreatorBAAI Creator = "baai" CreatorBaichuan Creator = "baichuan" CreatorBaidu Creator = "baidu" CreatorBlackForestLabs Creator = "blackforestlabs" CreatorByteDance Creator = "bytedance" CreatorElevenLabs Creator = "elevenlabs" CreatorIBM Creator = "ibm" CreatorIdeogram Creator = "ideogram" CreatorInclusionAI Creator = "inclusionai" CreatorNousResearch Creator = "nousresearch" CreatorRecraft Creator = "recraft" CreatorReka Creator = "reka" CreatorRunway Creator = "runway" CreatorStabilityAI Creator = "stabilityai" CreatorUpstage Creator = "upstage" CreatorVoyageAI Creator = "voyageai" )
Well-known Creator constants, mirroring the Provider constants in providers_gen.go. Values are the lab's own short machine token, following the same lowercase convention as Provider ("anthropic", "openai", …).
A Creator token and the same lab's Provider token OFTEN coincide when a lab both creates and distributes (e.g. "anthropic"/"anthropic"), but they are NOT guaranteed to: CreatorZhipu ("zhipu") diverges from ProviderZhipuai ("zhipuai") — the lab's short name and its provider-hosting token are independently curated and may drift apart. The two are separate axes and must not be conflated. Nor is every creator a provider: CreatorDeepReinforce, CreatorBlackForestLabs and CreatorUpstage name labs that operate no hosting surface of their own in this catalog at all.
The set has three provenance groups, marked below: the original hand-curated seed labs, the tokens derived from the models.dev metadata LAB PREFIX, and the tokens hand-curated for families the metadata join never reaches. The set is extended further by the huggingface ingest (HF-org-derived creators) in a later slice.
const CreatorNone Creator = ""
CreatorNone is the zero-value Creator: no creator is known for the family. It is the honest "unmapped" sentinel — Family.Creator returns it when the curated seed carries no row for the family, and it renders as the empty string.
func Creators ¶ added in v0.2.8
func Creators() []Creator
Creators returns all well-known Creator values as a defensive copy. Modifying the returned slice does not affect package state.
Adding a NEW creator token costs FIVE authoring parts, all of which must move together or the dimension silently degrades:
- the parse/data/creators.json row (or rows) that reference the token — without one the constant is dead;
- the Creator constant in the block above;
- the knownCreators entry — omit it and Creator.IsKnown reports false for a token the curated table does happily emit, breaking the creators.json↔IsKnown consistency guard;
- the Creators() length pin in the exported tests, re-derived from the emitting run rather than copied forward;
- the creatorExpr case in cmd/bestiary-gen — omit it and codegen silently emits the untyped fallback Creator("token") instead of the constant name.
Mapping an ADDITIONAL family onto a token that already exists costs only part 1.
func (Creator) IsKnown ¶ added in v0.2.8
IsKnown reports whether c is one of the well-known Creator constants. The set is the hand-curated seed above; like Provider.IsKnown it is a recognition check (use it to validate a call-site literal), not a gate on the open type.
func (Creator) MarshalText ¶ added in v0.2.8
MarshalText implements encoding.TextMarshaler. It is permissive: any Creator value (known or unknown) marshals to its token.
func (Creator) Providers ¶ added in v0.2.10
Providers returns the curated hosting surfaces this creator operates or brands for its OWN models — the Creator axis's counterpart to Family.CanonicalProvider — as a defensive copy in CURATION ORDER. Modifying the returned slice does not affect package state.
The order is CURATION order — the lab's PRIMACY order as parse/data/creator_providers.json lists it — and it is DETERMINISTIC but explicitly NOT alphabetical. Determinism comes from the committed JSON: the same file yields the same slice on every call and every build, so callers get a stable, reproducible order without a sort.
The order is NOT sorted on purpose, and re-introducing a sort would be a behaviour change, not a cleanup: creator-first selection uses the slice INDEX as its primacy tie-break (providerPreferenceScore in family.go), so the earliest curated surface wins when a lab operates several. Alphabetising would silently change which surface a model resolves to (Zhipu leads with its own "zhipuai" API ahead of the international "zai" brand; sorting would flip that). Callers that need a stable DISPLAY order — as opposed to this preference order — should sort a copy on their own key, which is what the codegen-emitted coverage and disagreement reports do.
It returns an EMPTY (non-nil) slice for a creator with no first-party surface in this catalog, which is the honest answer for a weights-only lab whose models reach users solely through third-party hosts. The result is deliberately NOT the set of every provider that rehosts the lab's weights: resolution ranks a curated distribution provider ABOVE a rehost, so folding rehosts in would erase the distinction the relation exists to draw.
At runtime a missing or corrupt relation degrades to the empty slice (loadCreatorProviderTableSafe), which makes creator-first selection a no-op and leaves the CanonicalProvider preference in charge; codegen catches such a table loudly via ValidateCreatorProviderTable.
func (*Creator) UnmarshalText ¶ added in v0.2.8
UnmarshalText implements encoding.TextUnmarshaler. It accepts any string value; use IsKnown() to validate against the well-known set.
type CreatorGroup ¶ added in v0.2.10
type CreatorGroup struct {
Creator Creator
// Families are the creator's families, ascending by family token.
Families []FamilyGroup
// EntityCount is the total number of entities beneath this creator. It is a
// derived sum, carried so a renderer need not re-walk the subtree to label a
// collapsed node.
EntityCount int
}
CreatorGroup is one lab and every family it created, the root level of the browsable tree. Creator is CreatorNone for families with no curated creator mapping; that group is emitted LAST (see CreatorGroups) so the attributed labs lead and the unattributed remainder collects at the bottom.
func CreatorGroups ¶ added in v0.2.10
func CreatorGroups() []CreatorGroup
CreatorGroups returns the full Creator > Family > Series > entities tree with the base hoist applied.
The creator set is DERIVED from the corpus (each entity's own Entity.Creator projection), never from a hard-coded list: when the curated creators.json seed grows, this tree grows with it and needs no edit here. Groups are ascending by creator token with ONE deliberate exception — CreatorNone (families with no curated creator) sorts LAST, so the attributed labs lead and the unattributed remainder collects in a single group at the bottom that a renderer can collapse.
The tree PARTITIONS the corpus exactly as SeriesGroups does: every entity in Entities() appears exactly once.
A SERIES, NOT AN ENTITY, CARRIES THE FAMILY HERE. A handful of entities are curated STRAYS: series.json re-homes a family whose own token folds the generation in (gemma4, gemma-4-31b-larkspur) or marks an experimental spelling (gemini-exp) onto the line it actually belongs to, so a Series can hold entities whose own Ref.Family differs from Series.Family. The tree groups by Series.Family and takes its creator from that family, because honouring the re-homing is the entire point of the strays table: gemma4 IS gemma at generation 4, and burying it under an unattributed "gemma4" family would undo the curation in the one view built to display it.
The consequence is deliberate and worth stating plainly: such an entity appears under a creator that its own Entity.Creator projection does not name (Creator is a function of the entity's OWN family, which knows nothing of the stray mapping). That divergence is confined to strays, and a test pins exactly that — any entity whose tree creator differs from its own must be a re-homed stray.
type CreatorLabClass ¶ added in v0.2.10
type CreatorLabClass int
CreatorLabClass classifies WHY a family's lab evidence was not auto-applied. It is a closed int enum: the set of ways the evidence can conflict is fixed by the derivation itself, so callers can switch on it exhaustively.
const ( // CreatorLabClassNone is the zero value: no conflict. It is never carried by a // reported row (a family with no conflict produces no row at all) and exists so // the zero value of the enum is not a meaningful classification. CreatorLabClassNone CreatorLabClass = iota // CreatorLabClassMultiOrg means MORE THAN ONE lab prefix reaches this family, so // the catalog itself disagrees about the originator. This is the genuine // multi-organization case: a lab's weights re-published under another lab's // prefix (an NVIDIA-tuned Llama is still filed under "nvidia/…"). No single lab // can be applied without silently picking a winner. CreatorLabClassMultiOrg // CreatorLabClassSpellingVariant means exactly one lab reaches the family, it // differs from the curated creator, and one token is a PREFIX of the other — the // same organization spelled two ways ("zhipu" curated vs the "zhipuai" lab // prefix). Applying it would churn the token without changing the fact. CreatorLabClassSpellingVariant // CreatorLabClassDivergent means exactly one lab reaches the family, it differs // from the curated creator, and the two tokens are NOT prefix-related — the // catalog names a materially different organization than the curation does. This // is the class that warrants a human look: one of the two is wrong. CreatorLabClassDivergent // CreatorLabClassWithheld means the family is on the curated withhold list in // creators.json. The derivation may be perfectly unambiguous; it is held back // deliberately, for the reason the withhold row carries. CreatorLabClassWithheld )
func (CreatorLabClass) MarshalText ¶ added in v0.2.10
func (c CreatorLabClass) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler so the class encodes as its token rather than as an opaque integer in the committed codegen report.
func (CreatorLabClass) String ¶ added in v0.2.10
func (c CreatorLabClass) String() string
String returns the machine token for the class, which is also its JSON encoding.
func (*CreatorLabClass) UnmarshalText ¶ added in v0.2.10
func (c *CreatorLabClass) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextUnmarshaler, making the committed report ROUND-TRIPPABLE. Marshalling without the reverse direction would emit an artifact that the emitting program itself cannot read back — the tests that verify the report's content, and any future consumer of it, would each have to re-implement the token table.
It is STRICT: an unrecognized token is an actionable error rather than a silent CreatorLabClassNone, because this decodes a codegen-emitted artifact whose vocabulary is fixed. A tolerant decode here would turn a renamed class into a report that parses cleanly and means something different.
type CreatorLabDisagreement ¶ added in v0.2.10
type CreatorLabDisagreement struct {
// Family is the family the join's own decomposition maps the rows to.
Family Family `json:"family"`
// CuratedCreator is what parse/data/creators.json already says for this family,
// or CreatorNone when the family carries no curated row.
CuratedCreator Creator `json:"curated_creator"`
// Labs are the distinct models.dev lab prefixes reaching this family, sorted
// ascending. Always at least one entry.
Labs []string `json:"labs"`
// Count is the number of metadata rows behind this family across all its labs —
// the weight of the evidence, so a one-row curiosity is not mistaken for a
// systematic disagreement.
Count int `json:"count"`
// Class is why the evidence was not applied.
Class CreatorLabClass `json:"class"`
// Reason is the human-readable explanation. For a withheld family it is the
// curated withhold reason verbatim; otherwise it is derived from the class.
Reason string `json:"reason"`
}
CreatorLabDisagreement is one family whose models.dev lab evidence was NOT auto-applied to the Family→Creator dimension, together with everything a curator needs to resolve it without re-deriving anything: the labs the catalog offers, how many metadata rows back them, what (if anything) the curated table already says, and which conflict class it falls in.
func CreatorLabDisagreementsFromBaked ¶ added in v0.2.10
func CreatorLabDisagreementsFromBaked() []CreatorLabDisagreement
CreatorLabDisagreementsFromBaked runs DeriveCreatorLabDisagreements over the compiled-in models.dev metadata. It is the accessor the runtime and the tests share with codegen, so nothing needs a second copy of the sweep.
func DeriveCreatorLabDisagreements ¶ added in v0.2.10
func DeriveCreatorLabDisagreements(meta []EntityMetadata) []CreatorLabDisagreement
DeriveCreatorLabDisagreements sweeps the supplied models.dev entity metadata and returns every family whose lab evidence was NOT auto-applied to the Family→Creator dimension, sorted ascending by family so the emission is byte-stable.
A family produces NO row when the evidence is unambiguous and already agrees with curation — exactly one lab reaches it and either there is no curated row or the curated row names that same lab. Everything else is reported:
- more than one lab reaches the family (CreatorLabClassMultiOrg);
- one lab, but it disagrees with the curated row, either as a spelling of the same organization (CreatorLabClassSpellingVariant) or as a materially different one (CreatorLabClassDivergent);
- the family is on the curated withhold list (CreatorLabClassWithheld), which takes precedence over the other classes so a deliberate deferral is never re-reported as an accident.
It reads no wall clock and iterates no map in output position, so two runs over the same metadata produce byte-identical results.
type DataSource ¶ added in v0.2.4
type DataSource struct {
ID DataSourceID
URI string
CanonicalName string
}
DataSource is the BCNF dimension row for a single originating data source. Its primary key is ID; URI is a second candidate key (each source has a distinct fetch endpoint), so ValidateDataSourceTable enforces URI uniqueness too.
- ID is the stable DataSourceID (e.g. DataSourceModelsDev).
- URI is the canonical fetch endpoint (e.g. https://models.dev/api.json).
- CanonicalName is the human-facing label for display.
func DataSourceByID ¶ added in v0.2.4
func DataSourceByID(id DataSourceID) (DataSource, bool)
DataSourceByID returns the DataSource dimension row for id and whether it exists. It is the FK-join entry point used to resolve a SourceID (on a DatasetIngested or EntitySource) to its uri/canonical-name.
func KnownDataSources ¶ added in v0.2.4
func KnownDataSources() []DataSource
KnownDataSources returns the curated data-source dimension in curated file order. The result is a fresh slice (callers cannot mutate the cached table). On a load failure it returns nil (graceful degrade), never panicking.
type DataSourceID ¶ added in v0.2.4
type DataSourceID string
DataSourceID is the stable identifier for a data source that provides model records to the bestiary registry. The zero value (DataSourceNone, empty string) means "no source recorded" and is the correct default for any row that has not been assigned a source.
This file is the home of the data-source provenance module: the DataSourceID type and well-known source constants; the BCNF provenance types (DataSource dimension, DatasetIngested fact, EntitySource join row); the curated loader for parse/data/datasources.json with its runtime degrade seam; the public lookups (KnownDataSources, DataSourceByID, DatasetIngestedFor, DatasetIngestHistoryFor, EntitySources); and the codegen FK guards (ValidateDataSourceTable, ValidateEntitySourceTable). The entity↔source join relation itself is built by the registry aggregate in registry.go (loadEntityIndex / buildEntitySourceRelation); EntitySources here reads that relation's per-entity projection.
const ( // DataSourceNone is the zero value: no source recorded for this row. DataSourceNone DataSourceID = "" // DataSourceModelsDev identifies the models.dev API as the originating // data source. DataSourceModelsDev DataSourceID = "models.dev" // DataSourceOllama identifies the Ollama registry as the originating // data source. DataSourceOllama DataSourceID = "ollama" // DataSourceHuggingFace identifies the HuggingFace Hub as the originating // data source. It is the ingest a harvested HF org/repo naming was read from: // the offline cmd/bestiary-hf bot fetches the Hub API and emits the harvested // seed (parse/data/huggingface_nomina.json). An entity carrying an HF nomen // DUAL-attests {models.dev, huggingface} — the ollama precedent (see the // attestation rule below). The Hub is the PRIMARY authority for the huggingface // naming scheme (a repo path is the lab's own published home for its weights). DataSourceHuggingFace DataSourceID = "huggingface" // DataSourceBestiary identifies bestiary ITSELF as the originating source of a // claim. It is the self-referential row of the data-source dimension: the honest // Source for anything bestiary AUTHORS rather than reads from an upstream — above // all the canonical nomina, whose keys are minted by this package's own parse + // key-rendering pipeline (IngestMethodSelfMinted, AuthorityPrimary). // // It is DISTINCT from DataSourceCurated: curated is the ingest a THIRD-PARTY claim // was READ FROM (a committed claim file transcribing someone else's naming), while // bestiary is the AUTHOR of a claim that has no third party at all. Recording a // self-minted key as models.dev would attribute a bestiary-authored naming to an // upstream that never asserted it. DataSourceBestiary DataSourceID = "bestiary" // DataSourceCurated identifies bestiary's own curated claim files (e.g. // parse/data/nomen_claims.json) as the ingest a naming was read from. It is the // honest Source for a curated third-party naming CLAIM: bestiary never read the // claim from models.dev or Ollama — it read it from its own committed curation. // This is DISTINCT from a Nomen's SourceURL, which attributes WHO asserts the // naming (e.g. the xAI model page); Source records WHICH ingest we read it from. DataSourceCurated DataSourceID = "curated" )
func EntitySources ¶ added in v0.2.4
func EntitySources(entityKey string) []DataSourceID
EntitySources returns the sorted, de-duplicated DataSourceIDs that attest the entity identified by entityKey (an EntityRef.String() value), or nil when none do. It is the join-table lookup behind Entity.Sources: the projection is read from the registry-built entity↔source relation and is always sorted ascending by DataSourceID for deterministic output.
func SourceFor ¶ added in v0.2.4
func SourceFor(id ModelID) DataSourceID
SourceFor returns the DataSourceID for the model identified by id, or DataSourceNone (the empty string) when the model is not in the curated table. Matching is case-insensitive. For curated Ollama data the value is DataSourceOllama.
type DatasetIngested ¶ added in v0.2.4
type DatasetIngested struct {
SourceID DataSourceID
IngestedAt string
ParserSchema int
}
DatasetIngested records one ingest of a data source. The URI is deliberately ABSENT: it is a transitive dependency (URI depends on SourceID via DataSource), so it is reached by joining to DataSource via SourceID rather than duplicated here — this is the BCNF normalization that removes the transitive dependency.
A source may have MANY DatasetIngested rows: the ingest log is append-only, so a source accumulates one row per distinct ingest instant. The identity of a row is the composite (SourceID, IngestedAt); the CURRENT ingest for a source is the row with the maximum IngestedAt (DatasetIngestedFor), and the full ordered history is DatasetIngestHistoryFor.
- SourceID is the DataSourceID that was ingested (FK to DataSource).
- IngestedAt is a COMMITTED snapshot timestamp from datasources.json. It is never computed at load or codegen time — pinning it in the data file is what keeps generated output byte-deterministic across runs.
- ParserSchema is the curated-data schema version this ingest was parsed under.
func DatasetIngestHistoryFor ¶ added in v0.2.5
func DatasetIngestHistoryFor(id DataSourceID) []DatasetIngested
DatasetIngestHistoryFor returns the full ingest history for the source id, sorted ascending by IngestedAt (oldest first), or nil when the source has no ingest rows. The result is a fresh slice (callers cannot mutate the cached table). On a load failure it returns nil (graceful degrade), never panicking. It is the curated-seed counterpart of Store.QueryIngestHistory.
func DatasetIngestedFor ¶ added in v0.2.4
func DatasetIngestedFor(id DataSourceID) (DatasetIngested, bool)
DatasetIngestedFor returns the CURRENT DatasetIngested for the source id — the row with the maximum IngestedAt — and whether any ingest exists. The returned value carries NO uri; resolve the uri via DataSourceByID(id) (the BCNF join) when it is needed. Use DatasetIngestHistoryFor for the full ordered history.
type DerivationKind ¶ added in v0.2.3
type DerivationKind int
DerivationKind classifies HOW a model was derived from one or more parent models — the edge label on a lineage relationship (see LineageEdge). It is a closed enum: the set of derivation techniques is small and well-understood, so (unlike Host/Provider) a strongly-typed int enum is the right fit.
The zero value is DerivationNone (no derivation / a base model).
const ( // DerivationNone is the zero value: no derivation relationship (a base model). DerivationNone DerivationKind = iota // DerivationFinetune: parameters further trained on additional data // (e.g. dracarys finetuned from llama). DerivationFinetune // DerivationMerge: weights combined from two or more parent models. A merge // edge set carries >= 2 parents. DerivationMerge // DerivationDistillation: a smaller/student model trained to mimic a larger // teacher model. DerivationDistillation // DerivationQuantized: a lower-precision copy of a parent model. DerivationQuantized // DerivationAdapter: a parameter-efficient adapter (e.g. LoRA) applied over // a base model. DerivationAdapter )
func (DerivationKind) MarshalText ¶ added in v0.2.3
func (k DerivationKind) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler, emitting the canonical wire name (so DerivationKind serializes as a JSON string, not an integer). An out-of-range value is a programming error and yields an actionable error.
func (DerivationKind) String ¶ added in v0.2.3
func (k DerivationKind) String() string
String returns the lowercase wire name of the derivation kind. An out-of-range value renders as "derivationkind(<n>)" so logs never silently drop an unexpected value.
func (*DerivationKind) UnmarshalText ¶ added in v0.2.3
func (k *DerivationKind) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, parsing a canonical wire name back into a DerivationKind. Parsing is case-sensitive against the wire names produced by MarshalText, guaranteeing a lossless round-trip. An unrecognized token yields an actionable error listing the valid values.
type Designation ¶
type Designation struct {
// Value is the serialized model identifier under Scheme.
Value string
// Scheme is the serialization scheme used to produce Value.
Scheme CanonicalScheme
// Provider is the hosting provider associated with this designation.
// For cross-scheme designations (e.g. SchemeRaw) the Provider is the
// original model's hosting provider.
Provider Provider
// Rating classifies acceptability. All epoch-generated designations are
// AcceptabilityAdmitted; promotion is deferred.
Rating AcceptabilityRating
}
Designation pairs a model identity string with its serialization scheme, hosting provider, and acceptability rating.
A single ModelRef may have multiple Designations: a canonical form, a raw API ID form, and optionally provider-specific alias forms. Each carries an AcceptabilityRating: the canonical form is AcceptabilityPreferred, the others are AcceptabilityAdmitted (see ModelRef.Designations).
type Entity ¶ added in v0.2.3
type Entity struct {
Ref EntityRef
Instances []ProviderInstance
Lineage []LineageEdge
Providers []Provider
Hosts []Host
// Regions is the sorted (ascending Region value), de-duplicated aggregate of the
// per-instance Region across every instance of this entity — the Providers/Hosts
// aggregate pattern. An entity served in multiple jurisdictions (e.g. a Bedrock
// claude offered us/eu/au/jp/global) surfaces all its regions here. It is nil only
// on a hand-constructed Entity that never went through the registry aggregate; a
// registry entity with no region prefix on any instance carries [RegionNone].
Regions []Region
PriceInputRange [2]*float64
PriceOutputRange [2]*float64
ContextRange [2]int
MaxOutputRange [2]int
Capabilities CapabilityUnion
// Sources is a DERIVED, sorted (ascending DataSourceID), de-duplicated read
// projection of the entity↔source join relation. It is NOT a source of truth —
// it is a convenience view over the EntitySource join table. For any entity
// returned by the registry it is always populated (every registry entity attests
// at least the models.dev origin); it is nil only on a hand-constructed Entity
// value that never went through the registry aggregate.
Sources []DataSourceID
// Metadata is the PRIMARY provider-agnostic metadata row for this entity — a
// DERIVED convenience projection of MetadataAll, not an independent slot. It is
// a pointer because metadata is genuinely optional: nil when no EntityMetadata
// was joined to this identity. When present it is owned by the Entity value and
// is deep-copied on read alongside the other entity fields.
//
// The primary is the row with the SHORTEST MetadataID, ties broken lexicographic
// ascending. Shortest-id is a naming rule, not a payload rule: a lab's canonical
// id is its shortest one ("openai/gpt-5.5" over "openai/gpt-5.5-instant"), so the
// primary is stable under re-ingest and independent of how many benchmark claims
// or links a row happens to carry. Choosing by payload size would let a row's
// claim count silently re-designate the entity's canonical naming, and inheriting
// the incoming join order would make the choice depend on upstream iteration.
Metadata *EntityMetadata
// MetadataAll is EVERY provider-agnostic metadata row that joined to this
// entity's identity, sorted ascending by MetadataID. Distinct lab ids routinely
// decompose to one entity key (a dated alias and its floating alias; a base model
// and a serving tier that is not a distinct artifact), and each such row carries
// its OWN benchmark claims attributable to its OWN MetadataID.
//
// Metadata (the primary) is derived from this slice; MetadataAll is the complete
// record. Benchmark claims from different rows are NEVER fused into one table:
// a claim is attributable to the MetadataID under which the lab reported it, and
// merging two rows' tables would fabricate an assessment record no lab published.
// nil (never empty-non-nil) when no metadata joined to this identity, so the
// nil-means-unjoined convention holds on both fields together.
MetadataAll []EntityMetadata
// Creator is the lab / organization that TRAINED this entity's models (the SPDX
// originator), DISTINCT from the Providers that host it (the SPDX suppliers). It
// is a DERIVED JOIN PROJECTION — the Entity.Sources / Entity.Regions precedent —
// computed in loadEntityIndex from Ref.Family via the curated creators.json seed
// (Family.Creator), NOT a stored column (Family → Creator is a function, so a
// per-entity column would be a transitive dependency / BCNF violation). All
// instances of an entity share its Family, so one value covers the whole entity.
// CreatorNone (empty string) when the family has no curated mapping; it stays out
// of EntityRef (never re-keys the entity). It is nil-free (a value type), so a
// hand-constructed Entity that never went through the registry simply carries
// CreatorNone until projected.
Creator Creator
}
Entity is a model identity (Ref) together with every provider/host instance that serves it and the aggregate views derived from those instances. It is the unit returned by Entities() / EntityByTuple().
Range fields summarize the instances:
- PriceInputRange / PriceOutputRange: [min,max] over the NON-nil instance costs only; when every instance cost is nil the range is {nil,nil} (no nil-deref, no spurious zero). Indices: [0]=min, [1]=max.
- ContextRange / MaxOutputRange: [min,max] over instance context/max-output.
func AttachEntityMetadata ¶ added in v0.2.5
func AttachEntityMetadata(ents []Entity, meta []EntityMetadata) []Entity
AttachEntityMetadata runs the same join over the provided entities and metadata set and returns the attached entities followed by any newly synthesized standalone entities. It is pure (no store access; inputs never mutated) and re-attaches existing standalones instead of duplicating them, so a second call with the same metadata set yields the same result with no growing standalone tail.
The unlinked disagreements are intentionally not returned here — this is the CLI overlay entry point, where an unmatched-but-family-known metadata id is simply not surfaced. Callers that need the unlinked report (codegen) call JoinEntityMetadata.
func Entities ¶ added in v0.2.3
func Entities() []Entity
Entities returns every model entity in the static registry, each with its instances and aggregate views populated. The slice is ordered deterministically by first-seen entity key.
The result is a DEFENSIVE DEEP COPY: every returned Entity (and all of its slices and price pointers) is independent of the memoized registry index and of every other returned Entity. Mutating a returned value can never corrupt the registry or alias another entity.
func EntitiesOf ¶ added in v0.2.7
EntitiesOf returns the entities that belong to the given Release, ordered ascending by canonical entity key (an EXPLICIT sort, so the sequence is identical on every run — the sized siblings of one release, e.g. llama/maverick@4#17b-128e and its {instruct} sibling, always come back in the same order).
A Release with no entities yields nil. Each returned Entity is a DEFENSIVE DEEP COPY, exactly as with Entities() — mutating a result can never corrupt the registry or alias another entity.
func EntityByKey ¶ added in v0.2.7
EntityByKey looks up a single entity by its canonical entity-key STRING — the value carried by every generated Entity__* constant and returned by EntityKeys() (grammar: family[/variant][@version][#size]{identity-mods}). It is the string-keyed sibling of EntityByTuple: it decomposes the key with the internal parser (parseEntityKey, the exact inverse of EntityRef.String()) and delegates, so the enumerate-then-lookup idiom works end-to-end again:
for _, key := range EntityKeys() {
e, ok := EntityByKey(key) // ok is always true for a constant's value
...
}
The bool reports whether a matching entity exists; a malformed or unknown key returns (Entity{}, false) with NO error — matching EntityByTuple's contract (a key is data, so an absent match is a normal negative, not an exceptional condition). The returned Entity is a defensive deep copy (see Entities).
IMPORTANT: an entity key is NOT a raw ModelID. Do not pass an entity key to LookupModel / LookupModelByProvider / Resolve — those accept provider-ID grammar (raw catalog IDs), a different grammar entirely. Use EntityByKey or EntityByTuple for entity-key lookups; use LookupModel(id) / LookupModelByProvider(provider, id) for instance-level (provider-ID) lookups.
func EntityByTuple ¶ added in v0.2.3
func EntityByTuple(family Family, variant, version, paramSize string, identityModifiers ...string) (Entity, bool)
EntityByTuple looks up a single entity by its identity tuple: family, variant, version, paramSize, and any identity-class modifiers. The bool reports whether a matching entity exists. Lookup is by EntityRef.String() equality, so the modifier arguments are order-independent.
paramSize is the canonical parameter-size token (e.g. "70b", "8b"), or "" when size is unknown. A non-empty paramSize produces a #-segment in the lookup key, distinguishing sized entities (e.g. "llama@3.3#70b{instruct}") from entities with no curated size ("llama@3.3{instruct}").
The supplied modifiers are passed through EntityModifiers(_, family), the same identity-class projection used to build the index keys: attribute-class tokens are dropped and the remainder canonicalized, so a caller need not pre-filter. The returned Entity is a defensive deep copy (see Entities).
func (Entity) Ancestors ¶ added in v0.2.3
Ancestors returns the transitive set of parent EntityRefs reachable from this entity's lineage, via a cycle-safe depth-first traversal of the curated derivation DAG. The first hop comes from the entity's own Lineage edges (as populated at codegen); deeper hops follow the curated forward index. When the entity carries no edges directly, the curated index keyed by its Ref seeds the traversal — exact (sized) key first, then the size-stripped key so a size-agnostic curated edge is inherited by every sized sibling (see forwardSeed). A cycle never loops.
func (Entity) Descendants ¶ added in v0.2.3
Descendants returns the transitive set of child EntityRefs derived (directly or indirectly) from this entity, via a cycle-safe depth-first traversal of the curated derivation DAG's reverse edges. The root lookup is exact (sized) key first, then the size-stripped key so a size-agnostic parent edge yields descendants for every sized sibling (see reverseRootKey).
func (Entity) Nomina ¶ added in v0.2.7
Nomina returns the nomina for THIS entity: its Canonical (Preferred) nomen, one ProviderID (Admitted) nomen per distinct instance ID spelling, and any curated alias claim (nomen_claims.json) that resolves to this entity's key. The slice is a sorted, derived projection (deterministic order via lessNomen). It is safe to mutate — every element is a value and the slice is freshly built.
func (Entity) PreferredName ¶ added in v0.2.7
PreferredName returns this entity's preferred naming — the canonical key with any seed-suppressed redundant modifier omitted. It is what human render sites print. The entity's KEY is unchanged and is still Ref.String(); the key spelling remains recorded as an admitted nomen (see Nomina).
type EntityMetadata ¶ added in v0.2.5
type EntityMetadata struct {
// MetadataID is the stable models.dev metadata key (e.g. "zhipuai/glm-4.6").
MetadataID MetadataID
// Name is the display name.
Name string
// Description is the model description.
Description string
// License is the license identifier or name.
License string
// Links are the model's reference links; upstream weights[] rows fold in with
// Type == LinkWeights. nil when the source lists none.
Links []ModelLink
// Benchmarks are the lab-reported benchmark claims. nil when the source lists none.
Benchmarks []BenchmarkResult
// Source is the ingest attestation — the data source this metadata was read
// from (DataSourceModelsDev). It is DataSourceNone on a value that has not
// been assigned a source.
Source DataSourceID
// LastSynced is an RFC3339 timestamp; empty on baked rows until a sync occurs.
LastSynced string
// RawFamily is the upstream models.json `family` value verbatim (e.g. "gemini",
// "nemotron") — the SAME raw-family signal the catalog enrichment pipeline feeds
// to ParseFamilyDetailed. It is internal provenance used ONLY to key the
// metadata<->entity join's family-PRESENCE gate off the same canonicalization the
// catalog side uses, so an over-captured compound family (e.g. "gemini-omni" from
// the id-only decomposition) is not mistaken for an absent family and wrongly
// synthesized as a standalone. It is NOT part of the public JSON contract
// (json:"-") — the entity KEY is still the mechanical decomposition — but it IS
// persisted by the store (entity_metadata.raw_family) and round-trips through
// UpsertEntityMetadata / QueryEntityMetadata, so a synced/cached row keeps the same
// signal the baked rows carry. It is empty ("") only for a value that never had one:
// a legacy pre-column cache row until it is re-synced, or a hand-constructed
// EntityMetadata; the presence gate falls back to the mechanical family in that case.
RawFamily Family `json:"-"`
}
EntityMetadata holds the provider-agnostic model facts models.dev publishes on its models.json side: description, license, reference links, and lab-reported benchmark claims, keyed by the stable MetadataID.
It carries NO status field: status is not present in models.json — it is an api.json / instance-level fact and lives on ModelInfo only. A single EntityMetadata attaches to at most one Entity (Entity.Metadata); the join is computed at load time by the metadata↔entity adapter.
func MergeEntityMetadata ¶ added in v0.2.5
func MergeEntityMetadata(static, cached []EntityMetadata) []EntityMetadata
MergeEntityMetadata merges baked (static) and cached entity-metadata lists, deduplicating by MetadataID. When both sources carry the same MetadataID the row with the more recent LastSynced timestamp wins; since LastSynced is an RFC3339 string, lexicographic comparison correctly orders recency and a baked row (empty LastSynced) always loses to any synced row.
The result has UNION semantics (the MergeModels precedent): a MetadataID present in only one source is always retained — in particular a BAKED-ONLY row (never re-synced) SURVIVES a sync of a disjoint set. Output is sorted ascending by MetadataID for deterministic ordering.
func ParseModelsJSON ¶ added in v0.2.5
func ParseModelsJSON(data []byte) ([]EntityMetadata, error)
ParseModelsJSON decodes a models.json artifact (provider-agnostic model facts, keyed by canonical <lab>/<model> id) into the public EntityMetadata slice. It is the SAME decode path Client.FetchModelMetadata uses. A malformed benchmark score (a JSON string) is captured per row on ScoreRaw and never fails the parse; no row is dropped. Source and LastSynced are left zero — the caller assigns ingest provenance.
type EntityRef ¶ added in v0.2.3
type EntityRef struct {
Family Family
Variant string
Version string
ParamSize string // canonical parameter-size token, e.g. "70b"; empty when unknown
Modifier []string // identity-class modifiers only, canonical order
}
EntityRef is the canonical IDENTITY of a model entity — the tuple that determines whether two provider/host instances are "the same model". It is the comparable map key for entity grouping (via EntityRef.String) and doubles as the parent reference in a lineage edge (see LineageEdge).
Identity is (Family, Variant, Version, ParamSize) PLUS the identity-class modifiers in Modifier. Crucially:
- Version is the IDENTITY version (e.g. "4.5"), NOT a release date. EntityRef deliberately has NO Date field: a date is a per-release attribute, not part of identity. Do not conflate EntityRef's "@version" with formatCanonical's "@date".
- ParamSize is the canonical parameter-size token (e.g. "70b", "8b"). It is part of entity identity because "llama@3.3#70b{instruct}" and "llama@3.3#8b{instruct}" are distinct models. Empty when size is unknown.
- Modifier holds ONLY identity-class modifiers (see EntityModifiers / ClassifyModifier). Attribute-class modifiers and per-instance attributes (host, price, quant, …) are NEVER part of EntityRef and NEVER appear in the key string.
Because Modifier is a slice, an EntityRef value is not itself comparable and cannot be used directly as a map key; use EntityRef.String() as the key.
func NormalizeEntityVersion ¶ added in v0.2.7
NormalizeEntityVersion applies the MERGE-only N->N.0 version fold to a single entity ref, given the set of ALL raw (pre-fold) entity keys. When ref carries a bare-integer version N AND an entity with the IDENTICAL (family, variant, param-size, modifiers) but version exactly "N.0" exists in rawKeys, it returns the ref with Version bumped to "N.0" (so it lands squarely on that entity) and true; otherwise it returns ref unchanged and false. It is a pure MERGE — a family that spells only a bare N with no N.0 sibling (llama@4) is never touched, and no new/renamed key is ever created.
Exported so cmd/bestiary-gen's buildEntitySet folds byte-identically to the runtime registry: one rule, one implementation, so the generated Entity__ constants can never drift from the entities Entities() actually exposes.
func (EntityRef) IRI ¶ added in v0.2.7
IRI returns an IRI (RFC 3987) naming this ENTITY inside the caller-supplied base namespace: base + the percent-encoded entity key.
The entity key (EntityRef.String(), e.g. "llama/scout@4#17b-16e{instruct}") is the identity; this method only renders it as a dereferenceable name. Every structural delimiter the key grammar produces EXCEPT '/' — '@', '#', '{', '}' — is percent-encoded, so it can never be misread as IRI structure. '#' matters most: left raw it would start a URI FRAGMENT, silently truncating the identifier at the parameter-size segment ("…/llama#17b" would name the entity "llama" with a fragment). The '/' is kept LITERAL by design (RQ1 amendment, see escapeIRISegment) so the key renders as a multi-segment path that the cmd/bestiary-web /entity/<key> routes dereference under the same grammar.
base is a parameter by design (see mintIRI) and is used verbatim: no separator is inserted and no trailing slash is required, so a hash namespace ("https://example.org/ns#") works as well as a slash one. An empty base returns "".
EntityRef{Family: "llama", Variant: "scout", Version: "4", ParamSize: "17b-16e",
Modifier: []string{"instruct"}}.IRI("https://w3id.org/bestiary/entity/")
→ "https://w3id.org/bestiary/entity/llama/scout%404%2317b-16e%7Binstruct%7D"
func (EntityRef) String ¶ added in v0.2.3
String returns the canonical comparable key for this entity:
family[/variant][@version][#paramsize]{identity-mods}
Rules:
- "/variant" is appended only when Variant is non-empty.
- "@version" is appended only when Version is non-empty (this is the IDENTITY version, never a date).
- "#paramsize" is appended only when ParamSize is non-empty. It is placed AFTER @version and BEFORE {identity-mods}. The '#' sentinel was chosen because it does not collide with any existing segment character. When ParamSize is empty, the segment is OMITTED ENTIRELY so every existing key remains byte-identical to its pre-paramsize value.
- "{identity-mods}" is appended only when at least one identity modifier is present; the tokens are de-duplicated and rendered in canonical order (CanonicalizeModifiers), comma-separated. The braces are OMITTED entirely when there are no identity modifiers.
- The "[attributes]" segment is NEVER part of this key (attributes do not affect identity).
Two EntityRefs whose Modifier slices are permutations of the same identity-mod set produce the IDENTICAL key.
type EntitySource ¶ added in v0.2.4
type EntitySource struct {
EntityKey string
SourceID DataSourceID
}
EntitySource is one row of the BCNF join table relating an entity to a data source that attests it. The primary key is the composite (EntityKey, SourceID); an entity attested by N sources has N rows. EntityKey is an EntityRef.String() value; SourceID is a FK to DataSource.
Attestation rule (the join's existence condition, applied by the registry aggregate in registry.go's loadEntityIndex): every static row attests DataSourceModelsDev — a row whose Source carrier is empty (DataSourceNone) means the models.dev origin is implicit; a row whose Source names a further, distinct source (e.g. ollama) is a models.dev row ENRICHED with that source's data, so it DUAL-attests BOTH DataSourceModelsDev AND that source. Thus a pure models.dev entity has one row {models.dev} and an ollama-enriched entity has two rows {models.dev, ollama}. The same rule is stated at registry.go's aggregate comment and the parse/data/datasources.json _comment.
type ErrAPIUnavailable ¶
ErrAPIUnavailable is returned when the models.dev API cannot be reached after one or more attempts. Cause holds the underlying network or HTTP error.
Use errors.As to extract structured fields; use Unwrap to inspect the root cause via errors.Is.
func (*ErrAPIUnavailable) Error ¶
func (e *ErrAPIUnavailable) Error() string
Error implements the error interface. Format: "bestiary: API unavailable after <n> attempt(s) at <url>: <cause>"
func (*ErrAPIUnavailable) Unwrap ¶
func (e *ErrAPIUnavailable) Unwrap() error
Unwrap returns the underlying cause so that errors.Is and errors.As can traverse the error chain.
type ErrAmbiguous ¶
type ErrAmbiguous struct {
// Input is the raw string passed to Resolve.
Input string
// Scheme is the CanonicalScheme that was active during resolution.
Scheme CanonicalScheme
// Candidates lists all matching ModelRefs, grouped by distinct Canonical.
Candidates []ModelRef
// PURLMissedNamespace is set when the PURL namespace (provider segment) had
// zero matches and a loose-match fallback was performed. The value is the
// namespace string that missed (e.g. "totally-unknown-ns").
// Empty when no PURL namespace miss occurred.
PURLMissedNamespace string
// RehostProviders is the deduplicated list of providers (in stable first-seen
// order) that host at least one of the matching models but are NOT the
// canonical/originating provider for the family. Populated at both ErrAmbiguous
// construction sites in resolve.go (multi-group case and PURL loose-fallback
// case). Empty when no rehost providers exist in the match set.
RehostProviders []Provider
}
ErrAmbiguous is returned by Resolve when the input string matches models with two or more distinct Canonical identities (e.g., "claude" matches claude/opus, claude/sonnet, and claude/haiku simultaneously).
It is distinct from cross-provider hosting: if multiple providers host the same Canonical, Resolve returns []ModelRef with err == nil.
What: the raw input string that triggered the ambiguity. Scheme: the CanonicalScheme used during resolution. Candidates: the list of ModelRefs that matched, one per distinct Canonical. PURLMissedNamespace: when non-empty, identifies the PURL namespace (provider) that had zero matches, triggering a loose-match fallback. (Fix #1)
Use errors.As to extract structured fields. The Error() message names all 6 actionable-error elements per [C-actionable-errors]:
- What went wrong (ambiguous input),
- Why it happened (multiple distinct canonicals matched),
- Where it failed (Resolve),
- When it failed (during model lookup / resolution step),
- What it means for the caller (the query cannot be resolved unambiguously),
- How to fix it (refine input or use --format=raw).
func (*ErrAmbiguous) Error ¶
func (e *ErrAmbiguous) Error() string
Error implements the error interface with an actionable message. All 6 elements from the [C-actionable-errors] constraint are present: What, Why, Where, When, What it means for the caller, and How to fix.
type ErrNotFound ¶
type ErrNotFound struct {
// What describes the resource kind that was not found (e.g., "model").
What string
// Key is the identifier that was searched for (e.g., model ID).
Key string
}
ErrNotFound is returned when a requested resource cannot be located in the local store or remote API.
What identifies the resource kind (e.g., "model"), and Key is the lookup value that was not found. Use errors.As to extract structured fields.
ErrNotFound has no Unwrap method by design: it is a sentinel-style error with no wrapped cause. Use errors.As to match.
func (*ErrNotFound) Error ¶
func (e *ErrNotFound) Error() string
Error implements the error interface. Format: "bestiary: <what> not found: <key>"
type Family ¶
type Family string
Family identifies the model family from the models.dev API. It is a named string type for type safety, following the same pattern as Provider.
const ( FamilyHy Family = "Hy" FamilyAgi Family = "agi" FamilyAllenai Family = "allenai" FamilyAlpha Family = "alpha" FamilyAuto Family = "auto" FamilyBaichuan Family = "baichuan" FamilyBge Family = "bge" FamilyBigPickle Family = "big-pickle" FamilyCanopylabs Family = "canopylabs" FamilyChutesai Family = "chutesai" FamilyClaude Family = "claude" FamilyClaudeFable Family = "claude-fable" FamilyClaudeHaiku Family = "claude-haiku" FamilyClaudeMythos Family = "claude-mythos" FamilyClaudeOpus Family = "claude-opus" FamilyClaudeSonnet Family = "claude-sonnet" FamilyCodestral Family = "codestral" FamilyCodestralEmbed Family = "codestral-embed" FamilyCogito Family = "cogito" FamilyCohereEmbed Family = "cohere-embed" FamilyCommand Family = "command" FamilyCommandA Family = "command-a" FamilyCommandR Family = "command-r" FamilyDallE Family = "dall-e" FamilyDeepSeek Family = "deepseek" FamilyDeepSeekFlash Family = "deepseek-flash" FamilyDeepSeekThinking Family = "deepseek-thinking" FamilyDevstral Family = "devstral" FamilyElevenlabs Family = "elevenlabs" FamilyErnie Family = "ernie" FamilyFlux Family = "flux" FamilyFugu Family = "fugu" FamilyGemini Family = "gemini" FamilyGeminiFlash Family = "gemini-flash" FamilyGeminiFlashLite Family = "gemini-flash-lite" FamilyGeminiPro Family = "gemini-pro" FamilyGemma Family = "gemma" FamilyGLM Family = "glm" FamilyGLMAir Family = "glm-air" FamilyGLMFlash Family = "glm-flash" FamilyGLMFree Family = "glm-free" FamilyGLMZ Family = "glm-z" FamilyGlmv Family = "glmv" FamilyGPT Family = "gpt" FamilyGPTCodex Family = "gpt-codex" FamilyGPTCodexMini Family = "gpt-codex-mini" FamilyGPTCodexSpark Family = "gpt-codex-spark" FamilyGPTImage Family = "gpt-image" FamilyGPTLuna Family = "gpt-luna" FamilyGPTMini Family = "gpt-mini" FamilyGPTNano Family = "gpt-nano" FamilyGPTOss Family = "gpt-oss" FamilyGPTPro Family = "gpt-pro" FamilyGPTSol Family = "gpt-sol" FamilyGPTTerra Family = "gpt-terra" FamilyGranite Family = "granite" FamilyGrok Family = "grok" FamilyGrokBuild Family = "grok-build" FamilyGroq Family = "groq" FamilyHermes Family = "hermes" FamilyHunyuan Family = "hunyuan" FamilyHy3Free Family = "hy3-free" FamilyIdeogram Family = "ideogram" FamilyImagen Family = "imagen" FamilyJamba Family = "jamba" FamilyKatCoder Family = "kat-coder" FamilyKimi Family = "kimi" FamilyKimiFree Family = "kimi-free" FamilyKimiK2 Family = "kimi-k2" FamilyKimiK3 Family = "kimi-k3" FamilyKimiThinking Family = "kimi-thinking" FamilyLaguna Family = "laguna" FamilyLagunaS Family = "laguna-s" FamilyLing Family = "ling" FamilyLingFlashFree Family = "ling-flash-free" FamilyLiquid Family = "liquid" FamilyLlama Family = "llama" FamilyLongcat Family = "longcat" FamilyLucid Family = "lucid" FamilyLyria Family = "lyria" FamilyMagistral Family = "magistral" FamilyMagistralMedium Family = "magistral-medium" FamilyMagistralSmall Family = "magistral-small" FamilyMai Family = "mai" FamilyMercury Family = "mercury" FamilyMimo Family = "mimo" FamilyMimoFlashFree Family = "mimo-flash-free" FamilyMimoOmniFree Family = "mimo-omni-free" FamilyMimoProFree Family = "mimo-pro-free" FamilyMimoV2Omni Family = "mimo-v2-omni" FamilyMimoV2Pro Family = "mimo-v2-pro" FamilyMimoV25 Family = "mimo-v2.5" FamilyMimoV25Free Family = "mimo-v2.5-free" FamilyMimoV25Pro Family = "mimo-v2.5-pro" FamilyMiniMax Family = "minimax" FamilyMiniMaxFree Family = "minimax-free" FamilyMiniMaxM25 Family = "minimax-m2.5" FamilyMiniMaxM27 Family = "minimax-m2.7" FamilyMiniMaxM3 Family = "minimax-m3" FamilyMiniMaxM3Free Family = "minimax-m3-free" FamilyMinistral Family = "ministral" FamilyMistral Family = "mistral" FamilyMistralEmbed Family = "mistral-embed" FamilyMistralLarge Family = "mistral-large" FamilyMistralMedium Family = "mistral-medium" FamilyMistralNemo Family = "mistral-nemo" FamilyMistralSmall Family = "mistral-small" FamilyMixtral Family = "mixtral" FamilyMmPoly Family = "mm-poly" FamilyModelRouter Family = "model-router" FamilyMorph Family = "morph" FamilyMuse Family = "muse" FamilyMuseFree Family = "muse-free" FamilyNanoBanana Family = "nano-banana" FamilyNemotron Family = "nemotron" FamilyNemotronFree Family = "nemotron-free" FamilyNorth Family = "north" FamilyNorthFree Family = "north-free" FamilyNousresearch Family = "nousresearch" FamilyNova Family = "nova" FamilyNovaLite Family = "nova-lite" FamilyNovaMicro Family = "nova-micro" FamilyNovaPro Family = "nova-pro" FamilyO Family = "o" FamilyOMini Family = "o-mini" FamilyOPro Family = "o-pro" FamilyOrnith Family = "ornith" FamilyOsmosis Family = "osmosis" FamilyPalmyra Family = "palmyra" FamilyPhi Family = "phi" FamilyPixtral Family = "pixtral" FamilyQvq Family = "qvq" FamilyQwen Family = "qwen" FamilyQwenFree Family = "qwen-free" FamilyQwen35 Family = "qwen3.5" FamilyQwen36 Family = "qwen3.6" FamilyQwen37Max Family = "qwen3.7-max" FamilyQwen37Plus Family = "qwen3.7-plus" FamilyQwen38Max Family = "qwen3.8-max" FamilyQwerky Family = "qwerky" FamilyRay Family = "ray" FamilyRecraft Family = "recraft" FamilyReka Family = "reka" FamilyRing Family = "ring" FamilyRing1TFree Family = "ring-1t-free" FamilyRnj Family = "rnj" FamilyRunway Family = "runway" FamilySakanaNamazu Family = "sakana-namazu" FamilySarvam Family = "sarvam" FamilySeed Family = "seed" FamilySolar Family = "solar" FamilySolarMini Family = "solar-mini" FamilySolarPro Family = "solar-pro" FamilySonar Family = "sonar" FamilySonarDeepResearch Family = "sonar-deep-research" FamilySonarPro Family = "sonar-pro" FamilySonarReasoning Family = "sonar-reasoning" FamilySora Family = "sora" FamilyStableDiffusion Family = "stable-diffusion" FamilyStep Family = "step" FamilyTako Family = "tako" FamilyTextEmbedding Family = "text-embedding" FamilyTitanEmbed Family = "titan-embed" FamilyTopazlabs Family = "topazlabs" FamilyTrinity Family = "trinity" FamilyUnsloth Family = "unsloth" FamilyV0 Family = "v0" FamilyVenice Family = "venice" FamilyVeo Family = "veo" FamilyVoxtral Family = "voxtral" FamilyVoyage Family = "voyage" FamilyWhisper Family = "whisper" FamilyYi Family = "yi" )
FamilyMythologic and FamilyHuginn are the two parent base families of the MythoMax-L2-13B merge. MythoMax is a weight merge of MythoLogic-L2 and Huginn, so the merge edge carries these as STANDALONE parent families (not as llama-variants): the parents are distinct artifacts in their own right, and a merge by definition combines >= 2 separate parents. Neither is emitted by the API as a base family value, so both are registered here so lineage parent-validation recognizes them.
FamilyC4AI and FamilyQwQ (with the lowercase "hy" registered as a literal below) are the families that the catalog decomposition DOES route real entities to but that the models.dev API never emits as a bare family value, so they are absent from the generated allFamilies set. Each one is the decomposed head of a lab-scoped id line — Cohere's c4ai-command-r, Tencent's hy-*, Alibaba's QwQ — and each is reached by exactly one models.dev lab prefix, so each has a well-determined Creator. They are registered here because the curated Family→Creator table's FK gate requires Family.IsKnown: without registration they would have to be dropped from the creator dimension entirely, leaving their catalog entities unattributed for a reason that is about the family SET rather than about the originator.
FamilyOrnith (DeepReinforce's ornith-*) belonged to this group until the 2026-08-28 catalog refresh, when upstream began publishing the bare "ornith" family. It is now EMITTED by codegen (families_gen.go); the curated declaration is retired here because keeping both is a redeclaration and does not compile.
func Families ¶
func Families() []Family
Families returns all known Family values as a defensive copy.
func InferFamilyFromID ¶
InferFamilyFromID is the empty-family fallback for models whose API family field is empty (~25% of models). It uses the model ID as a heuristic signal.
Algorithm:
- Split id on "-".
- Consume trailing tokens that are purely version-like (all digits, or match a version pattern) — these are noise, not signal.
- Take the first remaining token as the inferred family.
- Return "" when no alphabetic-leading token is found.
The provider parameter is reserved for future provider-specific heuristics and is not currently used.
func InferFamilyFromIDWithVariant ¶ added in v0.2.0
InferFamilyFromIDWithVariant is the extended empty-family fallback for models whose API family field is empty (~25% of models). Unlike InferFamilyFromID, it extracts (Family, Variant, Version) by:
- Attempting the Δ2′ modifier-strip path: tentatively strip a trailing modifier to expose a hidden date, then decompose and apply two commit guards.
- Existing flow: strip trailing date, feed ID to ParseFamilyWithVersion, then fall back to first-token-only if no decomposition found.
This ensures (Family, Variant, Version) is consistent across providers regardless of whether raw_family is empty or populated.
Examples:
InferFamilyFromIDWithVariant("claude-opus-4-5-20251101", "nano-gpt") → ("claude", "opus", "4.5")
InferFamilyFromIDWithVariant("claude-opus-4-6", "some-provider") → ("claude", "opus", "4.6")
InferFamilyFromIDWithVariant("gpt-4o", "openai") → ("gpt", "", "4o")
InferFamilyFromIDWithVariant("claude-opus-4-1-20250805-thinking", "302ai") → ("claude", "opus", "4.1")
The provider parameter is reserved for future provider-specific heuristics and is not currently used.
this is a thin wrapper that applies the letter-prefix series split to the inner inference result, so the empty-raw primitive is SELF-CONSISTENT with the canonical ParseFamilyDetailed path (kimi-k2 → (kimi,k,2), minimax-m1 → (minimax,m,1), and the compound-family recovery kimi-k2-0905 → kimi).
func ParseFamily ¶
ParseFamily takes a raw API family value and returns (Family, variant).
Resolution order (first match wins):
- family_overrides table — explicit (raw → Family, variant) mappings.
- Versioned-variant patterns — v/k/m/no-prefix and hyphen-separated versions. For hyphen-version matches, the non-numeric prefix is itself resolved via overrides.
- Suffix-stripping table — strip the longest matching suffix to identify variant.
- Fallback — return (raw, "") unchanged.
ParseFamily is deterministic: the same input always produces the same output. Empty raw returns ("", "").
func ParseFamilyWithVersion ¶ added in v0.2.0
ParseFamilyWithVersion takes a raw API family value and returns (Family, variant, version) — a three-way decomposition that separates the semantic model version (e.g. "4.5") from the variant (e.g. "opus").
This is an additive companion to ParseFamily. For inputs that ParseFamily already handles correctly (overrides, v/k/m/no-prefix patterns, suffix stripping), the family and variant return values are identical to ParseFamily. The new third return value extracts the numeric version component when the raw family string embeds one via the hyphen-version pattern or a dot-version tail (e.g. "gemini-2.5-flash").
Resolution order (first match wins):
- family_overrides table — no version for override entries.
- hyphen-version pattern — converts hyphenated digits to dot notation: "claude-opus-4-5" → (claude, opus, 4.5); "llama-3-1" → (llama, "", 3.1).
- Other versioned patterns (v/k/m/no-prefix) — version stays in variant, version="".
- Suffix stripping + dot-version detection: "gemini-2.5-flash" → suffix strip yields base="gemini-2.5"; detect "-N.M" tail → (gemini, flash, 2.5).
- Dot-version fallback: "gemini-2.5" → (gemini, "", 2.5).
- Pure fallback — same as ParseFamily, version="".
ParseFamilyWithVersion is deterministic. Empty raw returns ("", "", "").
func (Family) CanonicalProvider ¶ added in v0.2.0
CanonicalProvider returns the originating/canonical provider for this Family.
When the family is a well-known model family with a clear original publisher, the canonical provider is returned. When the family has no canonical mapping (community models, multi-org models, or unmapped families), the empty Provider is returned. Resolve falls back to ErrAmbiguous in that case.
The mapping is a static switch populated at source time. Unknown families use the empty string sentinel rather than a wrong-but-plausible guess.
TODO: review and fill in additional canonical-provider mappings beyond the initial well-known set.
func (Family) Creator ¶ added in v0.2.8
Creator resolves a Family to the lab / organization that creates that family's models (the SPDX originator), via the curated seed parse/data/creators.json. It is DATA-DRIVEN (never an in-code switch): the same seed feeds codegen's baked ModelInfo.Creator emission, the registry's Entity.Creator projection, and the store's creators dimension, so all three agree by construction.
It returns CreatorNone for a family with no curated mapping (community models, multi-org models, or a family the seed has not yet covered) — an honest empty, never a wrong-but-plausible guess. At runtime a missing/corrupt seed degrades gracefully to CreatorNone (loadCreatorTableSafe); codegen catches such a seed loudly via ValidateCreatorTable.
Creator is a SEPARATE axis from Family.CanonicalProvider (which answers a Provider-typed resolution-preference question). Both coexist; neither replaces the other.
func (Family) IsKnown ¶
IsKnown reports whether f is a recognized Family. The known set is generated from the models.dev API at codegen time (allFamilies, families_gen.go) plus the hand-curated curatedBaseFamilies supplement (base families the API omits but that lineage / canonical references depend on, e.g. the MythoMax merge parents "mythologic" / "huginn").
func (Family) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It is permissive: any Family value (known or unknown) can be marshaled.
func (*Family) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It is permissive: any byte slice is accepted; use IsKnown() to validate.
type FamilyGroup ¶ added in v0.2.10
type FamilyGroup struct {
Family Family
Series []SeriesGroup
EntityCount int
}
FamilyGroup is one family and every Series (versioned line) within it, ascending by generation.
type FitBudget ¶ added in v0.2.10
type FitBudget struct {
// TotalBytes is the reader's total VRAM in bytes.
TotalBytes int64
// HeadroomBytes is the slack the reader wants left unspent, in bytes.
HeadroomBytes int64
}
FitBudget is a reader's hardware VRAM budget together with the headroom they want left unspent. Both are PRESENTATION-LAYER view state: they are never persisted, never baked into a QuantVRAM row, and never reach VRAMBytes. VRAMFormulaVersion is unaffected by anything in this file.
Headroom exists because the shipped formula deliberately carries NO runtime-overhead term (see vram.go: the 1 GiB constant was removed at v0.2.4 because an invented constant is not a fact). A fit verdict computed from a lower bound would answer "yes" for models that run out of memory in practice, so the slack is exposed as a number the reader owns and can see, rather than smuggled into the stored datum.
type FitFilter ¶ added in v0.2.10
type FitFilter struct {
// Budget is the hardware budget and its headroom.
Budget FitBudget
// MinContext is a floor on MaxContext in tokens; 0 imposes no constraint. A
// positive value excludes BOTH the not-computable rows (ContextBoundUnknown) and
// the exhausted ones: a reader who asked for at least N tokens has not been served
// by a row that cannot promise one.
MinContext int
}
FitFilter is the reader's query: a budget plus an optional floor on usable context.
type FitResult ¶ added in v0.2.10
type FitResult struct {
// Rows is the ranked, filtered candidate set.
Rows []FitRow
// EntitiesConsidered is the number of entities the query ran over.
EntitiesConsidered int
// EntitiesMeasured is the number of considered entities carrying at least one
// QuantVRAM row on at least one instance.
EntitiesMeasured int
// EntitiesDerived is the number of considered entities that produced at least one
// DERIVED row: no measured row anywhere, at least one instance, and an attested
// TotalParams.
EntitiesDerived int
// EntitiesExcluded is the number of considered entities that carry a parameter-size
// token but whose TotalParams is ParamShapeNull, so no honest total exists to
// derive from. These are the mixture-of-experts shapes upstream publishes without a
// total: the NxM tokens (whose product parse.go deliberately refuses to compute)
// and the Nb-Ke tokens (which carry only an active count).
EntitiesExcluded int
}
FitResult is the ranked rows plus the four coverage denominators.
The denominators exist so the page can STATE its own coverage instead of implying completeness it does not have. The published sentence is rendered from these fields at request time; it never carries a literal count, because a literal goes stale the first time the corpus moves.
func Fit ¶ added in v0.2.10
Fit ranks the whole static registry against a budget. It is the thin convenience wrapper; FitOver is the testable seam.
func FitOver ¶ added in v0.2.10
FitOver ranks the entities it is GIVEN against a budget. It is pure: it reads only its arguments, mutates nothing (not the entities, not any QuantVRAM row), and returns the same result for the same input.
Per entity:
- An entity with at least one QuantVRAM row anywhere is MEASURED: every one of its quant rows becomes a candidate, with WeightsBytes the ingested file size exactly.
- Otherwise the entity may be DERIVED: it needs at least one instance (a derived figure hanging off an entity no provider serves would describe nothing a reader could run) and an attested TotalParams on its own size token. Each instance then yields one candidate per quantization with a non-zero BitsPerWeight.
- A sized entity whose TotalParams is ParamShapeNull is EXCLUDED, not zeroed: the sentinel says upstream published no total, and deriving from ActiveParams instead understates residency by more than an order of magnitude.
A candidate is kept only when its weights fit the available budget and it satisfies MinContext.
type FitRow ¶ added in v0.2.10
type FitRow struct {
// Ref is the entity this row belongs to.
Ref EntityRef
// Provider is the provider instance the row was computed from. A derived row
// attaches per instance exactly as a measured row does, because a basis is a
// per-row fact: the same artifact on the same entity is measured on some instances
// and unmeasured on others.
Provider Provider
// Quant is the quantization this row is priced at.
Quant Quantization
// QuantRaw is the verbatim upstream quant token for a MEASURED row, preserving the
// original casing. It is empty on a DERIVED row: nothing upstream spelled that
// token, and inventing a spelling would fabricate provenance.
QuantRaw string
// WeightsBytes is the weights footprint this row was ranked on. Read it together
// with WeightsBasis: it is an ingested file size or an estimate, never ambiguously
// either.
WeightsBytes int64
// WeightsBasis names where WeightsBytes came from.
WeightsBasis WeightsBasis
// KVBytesPerToken is the per-token KV-cache cost, 0 when any architecture fact is
// absent. 0 is the sole cause of ContextBoundUnknown.
KVBytesPerToken int64
// ModelContext is the model's own context window on this instance, in tokens; 0
// when the instance publishes none. It is the second term of the MaxContext
// minimum and is carried so a reader can see WHY a model-bound row stopped where
// it did without a second lookup.
ModelContext int
// MaxContext is the largest context (tokens) the row can afford. It is 0 when
// Bound is ContextBoundUnknown (not computable) AND when a computable KV budget is
// exhausted; the two cases are distinguished by Bound, never by the number.
MaxContext int
// Bound names which limit produced MaxContext.
Bound ContextBound
// Partial is true when the KV-cache term was omitted, so the VRAM figure is a
// weights-only lower bound. It mirrors QuantVRAM.VRAMEstimatePartial on a measured
// row and is ALWAYS true on a derived row.
Partial bool
}
FitRow is one (entity, provider, quantization) candidate that fits a budget, together with the largest context it can afford and which limit produced that context.
A row exists ONLY when its weights fit: WeightsBytes <= FitBudget.Available(). The context figure is secondary — a model whose weights do not fit cannot be rescued by shortening the prompt.
func (FitRow) NoContextBudget ¶ added in v0.2.10
NoContextBudget reports whether the row has a computable KV term whose budget is exhausted: the weights fit, but not one token of context does. This is a materially different answer from ContextBoundUnknown ("we cannot say") and neither is a fit.
type Harness ¶
type Harness string
Harness identifies the coding tool or AI-assisted development environment that is driving the model interaction.
const ( HarnessClaudeCode Harness = "claude-code" // HarnessGeminiCLI is archived: retained for history, never removed. // Gemini CLI was replaced by the Antigravity products. The value stays known so // that sessions which already carry it remain valid. HarnessGeminiCLI Harness = "gemini-cli" HarnessCodex Harness = "codex" HarnessOpenCode Harness = "opencode" HarnessCursor Harness = "cursor" // HarnessAntigravity is archived. It named the Antigravity products as one // harness before the command-line agent and the desktop application got their // own values. It stays known so that anything which already carries it remains // valid. // // Deprecated: use HarnessAntigravityCLI or HarnessAntigravityIDE. Removal is // planned; the conditions and the window are tracked in // https://github.com/peasant-labs/schema/issues/232. HarnessAntigravity Harness = "antigravity" HarnessStrike Harness = "strike" HarnessPi Harness = "pi" HarnessGrokBuild Harness = "grok-build" HarnessDevinDesktop Harness = "devin-desktop" HarnessCline Harness = "cline" HarnessKiro Harness = "kiro" HarnessKiroCLI Harness = "kiro-cli" HarnessKiroCrew Harness = "kiro-crew" // HarnessAntigravityCLI is the Antigravity command-line agent (agy). HarnessAntigravityCLI Harness = "antigravity-cli" // HarnessAntigravityIDE is the Antigravity desktop application. HarnessAntigravityIDE Harness = "antigravity-ide" )
func ArchivedHarnesses ¶ added in v0.4.0
func ArchivedHarnesses() []Harness
ArchivedHarnesses returns the known Harness values that are archived: kept so that sessions and records which already carry them stay valid, with no current product behind the value. Every archived value is known. The set does not say whether a value will be removed: HarnessGeminiCLI is never removed, and HarnessAntigravity is planned for removal; each constant's documentation says which. The returned slice is a copy.
func Harnesses ¶
func Harnesses() []Harness
Harnesses returns all known Harness values. The returned slice is a defensive copy — modifying it does not affect the package state.
func NewHarness ¶ added in v0.2.11
NewHarness validates a wire value and returns its canonical Harness.
func (Harness) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Harness) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It accepts any string value; use IsKnown() to validate.
type Host ¶ added in v0.2.3
type Host string
Host identifies the serving host / backend infrastructure that actually runs a model instance, as distinct from the Provider (the organization that offers or sells access to it). The same logical model+provider may be served from different backends (e.g. an OpenAI model served via Azure), and the same host may back many providers. Host is therefore a per-instance ATTRIBUTE: it never participates in entity identity (see EntityRef) and is rendered in the "[attributes]" segment of a canonical string, never in the "{identity-mods}" key segment.
Host is a string type (not a closed int enum) for the same reason Provider is: the set of serving backends is open and grows over time. Well-known hosts have named constants for type-safe call sites; unrecognized hosts are still representable verbatim. ModelInfo.Host is populated by DetectHost, which matches a model ID against the curated host-prefix table (parse/data/hosts.json); an unrecognized or absent prefix yields HostNone.
const ( // HostNone is the zero value: the serving host is unknown or unspecified. // A genuine "no distinct host" record (e.g. a provider serving its own // model directly) is also represented as HostNone. HostNone Host = "" // HostAzure is Microsoft Azure (e.g. Azure OpenAI / Azure AI Foundry). HostAzure Host = "azure" // HostAWS is Amazon Web Services (e.g. Bedrock / SageMaker). HostAWS Host = "aws" // HostGCP is Google Cloud Platform (e.g. Vertex AI). HostGCP Host = "gcp" // HostCloudflare is Cloudflare (e.g. Workers AI). HostCloudflare Host = "cloudflare" )
type IDPrefixClass ¶ added in v0.2.10
type IDPrefixClass uint8
IDPrefixClass classifies the LEADING token of a model ID by what that token NAMES. It exists to answer one question with a typed value rather than a per-vendor exception list: is this token a fact the record already carries on another axis, or is it the only place that fact appears?
The distinction is the whole safety property. A leading token may be dropped from the decomposition input ONLY when a DIFFERENT carrier already holds the same fact, because then the identity tuple loses nothing:
- IDPrefixSelfProvider — the token is the serving provider's own slug. The Provider field carries it, so repeating it in the id says nothing new.
- IDPrefixCreator — the token names the lab that TRAINED the model, and the family the remainder decomposes to declares that same lab on the Creator axis. The Creator axis carries it.
- IDPrefixNone — nothing else carries the token, so removing it would DELETE information. This is the answer for a backend-host label (a token naming a provider that is NOT the serving one), for a product-surface namespace, and for the ordinary case of an id that simply begins with its family.
Two carriers already had their own machinery before this classifier existed and keep it: a Bedrock cross-region routing prefix is carried by the Region axis (bedrockProfile / DetectRegion) and a curated backend-host prefix is carried by the Host axis (DetectHost). Those are the same rule applied earlier, not exceptions to it.
const ( // IDPrefixNone is the honest default: no other axis holds this token, so the // decomposition input is left exactly as the upstream catalog spelled it. IDPrefixNone IDPrefixClass = iota // IDPrefixSelfProvider — the leading token equals the serving provider's slug. IDPrefixSelfProvider // IDPrefixCreator — the leading token names the creating lab that the // remainder's family already declares on the Creator axis. IDPrefixCreator )
func (IDPrefixClass) String ¶ added in v0.2.10
func (c IDPrefixClass) String() string
String renders the class for diagnostics and test failure messages.
type IngestMethod ¶ added in v0.2.8
type IngestMethod int
IngestMethod records HOW a naming record entered the system: from a committed curated seed (Curated), bot-fetched from an external registry (Harvested), or bestiary-authored (SelfMinted). It is a per-attestation fact symmetric with Authority — models.dev is simultaneously the Source of self-minted canonical nomina AND of harvested provider-id nomina, so the axis cannot live on the DataSource dimension.
Element-enum convention: IngestMethodUnknown sits AT zero as the fail-safe.
const ( // IngestMethodUnknown is the fail-safe bucket (zero value). IngestMethodUnknown IngestMethod = iota // IngestMethodCurated is a naming from a committed curated seed (nomen_claims.json). IngestMethodCurated // IngestMethodHarvested is a naming bot-fetched from an external registry // (models.dev / HuggingFace / Ollama). IngestMethodHarvested // IngestMethodSelfMinted is a bestiary-authored naming (the canonical key, a // purl derivation). IngestMethodSelfMinted )
func (IngestMethod) MarshalText ¶ added in v0.2.8
func (m IngestMethod) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler (the NomenScheme precedent).
func (IngestMethod) String ¶ added in v0.2.8
func (m IngestMethod) String() string
String renders the IngestMethod as its lowercase wire token. An out-of-range value degrades to "unknown" (never a panic).
func (*IngestMethod) UnmarshalText ¶ added in v0.2.8
func (m *IngestMethod) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, the inverse of MarshalText. An unrecognized token is an actionable error, never a silent IngestMethodUnknown.
type InputFormat ¶ added in v0.2.0
type InputFormat string
InputFormat specifies the input scheme for parsing a model identity string in the bestiary show command.
The default is InputFormatPeasant (bestiary canonical form). Other formats must be explicitly selected via --format on the CLI.
const ( // InputFormatPeasant is the bestiary canonical form: // [<provider>/]<family>[/<variant>[/<version>]][@<date>] // This is the default input format. InputFormatPeasant InputFormat = "peasant" // InputFormatHuggingFace is the HuggingFace Hub form: // <provider>/<raw-model-id> InputFormatHuggingFace InputFormat = "huggingface" // InputFormatPURL is the Package URL (PURL) form. This is an INPUT format, and // input stays lenient (Postel): both the registry-accurate // "pkg:huggingface/<org>/<repo>" spelling and the legacy // "pkg:huggingface/<provider>/<raw-model-id>" spelling this package once emitted // are accepted. The corresponding OUTPUT render (SchemePURL) is narrower — it is // minted only for HuggingFace-hosted refs (see canonical.go SchemePURL). InputFormatPURL InputFormat = "purl" // InputFormatRaw is the raw API model ID (exact match): // <raw-model-id> InputFormatRaw InputFormat = "raw" // InputFormatOCI is the purl-spec `pkg:oci` external-identifier form. It maps to // SchemeOCI. OCI identity is per-quant-digest (QuantVRAM.OCIDigest), so a bare // ModelRef has no OCI render — the format is recognized for scheme selection and // JSON round-trip symmetry, but its ModelRef render is "" by design. InputFormatOCI InputFormat = "oci" )
func ParseInputFormat ¶ added in v0.2.0
func ParseInputFormat(s string) (InputFormat, error)
ParseInputFormat converts a --format flag string to an InputFormat. Accepted values: "peasant", "huggingface", "hf", "purl", "raw", "oci" (case-insensitive). Returns an error if the string is not a recognized input format. Used by CLI flag parsing (--format flag in cmd/bestiary show).
type LineageEdge ¶ added in v0.2.3
type LineageEdge struct {
Parent EntityRef
Kind DerivationKind
}
LineageEdge is one directed derivation relationship: this model was derived from Parent via technique Kind. A model with multiple parents (e.g. a MERGE) carries multiple LineageEdges; Parent is a full EntityRef so a parent can be resolved to its own entity (and its own ancestors) for DAG traversal.
func LineageFor ¶ added in v0.2.3
func LineageFor(id ModelID) []LineageEdge
LineageFor returns the curated parent derivation edges for the model identified by id, or nil when no lineage is curated for it. It is the population entry point used by codegen to bake ModelInfo.Lineage, and a convenience over LineageRecordFor when the provenance flags are not needed.
type LineageRecord ¶ added in v0.2.3
type LineageRecord struct {
Child EntityRef
Edges []LineageEdge
Real bool
}
LineageRecord is the curated lineage of a single model: the set of parent derivation edges plus the provenance flags that describe how the record was sourced. It is returned by LineageRecordFor.
- Child is the child model's identity as a node in the derivation DAG (used by Ancestors / Descendants traversal).
- Edges holds one LineageEdge per parent. A MERGE carries >= 2 edges.
- Real reports whether the child model exists in the models.dev catalog (an attested record). When false the entry is a SYNTHETIC / catalog-absent fixture: the child itself is not in the catalog (only its parents are), and the edge is curated-only. The flag exists so consumers never mistake a synthetic fixture for an attested catalog lineage.
func LineageRecordFor ¶ added in v0.2.3
func LineageRecordFor(id ModelID) (LineageRecord, bool)
LineageRecordFor returns the curated LineageRecord for the model identified by id, and whether one exists. Matching is by the curated child key (the lowercase model ID or its post-'/' segment), so it resolves both bare and namespaced ID forms — and SYNTHETIC / catalog-absent children too (their Real field is false).
type LinkType ¶ added in v0.2.5
type LinkType int
LinkType classifies a model reference link (the type tag on a models.json links[] row, and the synthetic tag for a folded-in weights[] row). It is a closed int enum.
The zero value is LinkOther: on this ELEMENT type the upstream type tag is always present (every link arrives with a type), so absence is impossible and a zero value can only mean "the upstream tag was unrecognized". The fail-safe bucket therefore sits at the zero value, and the raw token is carried on ModelLink.TypeRaw. This Other-at-zero convention deliberately differs from ModelStatus's None-at-zero convention; see the file-level comment.
const ( // LinkOther is the zero value and fail-safe: an unrecognized link type. The // raw token is carried on ModelLink.TypeRaw. LinkOther LinkType = iota // LinkAnnouncement: a launch or announcement post. LinkAnnouncement // LinkBlog: a blog article. LinkBlog // LinkDocs: product or API documentation. LinkDocs // LinkLicense: the model's license text. LinkLicense // LinkModelCard: a model card (e.g. on a model hub). LinkModelCard // LinkPaper: a research paper or technical report. LinkPaper // LinkWeights: a downloadable-weights reference (a folded-in weights[] row). LinkWeights )
func (LinkType) IsKnown ¶ added in v0.2.5
IsKnown reports whether t is a named constant in this package. LinkOther is considered known (a named member of the enum); only out-of-range integers return false.
func (LinkType) MarshalText ¶ added in v0.2.5
MarshalText implements encoding.TextMarshaler, emitting the canonical wire name (so LinkType serializes as a JSON string, not an integer). An out-of-range value is a programming error and yields an actionable error.
func (LinkType) String ¶ added in v0.2.5
String returns the canonical lowercase wire name of the link type. An out-of-range value renders as "linktype(<n>)" so logs never silently drop an unexpected value.
func (*LinkType) UnmarshalText ¶ added in v0.2.5
UnmarshalText implements encoding.TextUnmarshaler, parsing a canonical wire name back into a LinkType. Parsing is case-insensitive. An unrecognized token yields an actionable error.
type MetadataID ¶ added in v0.2.5
type MetadataID string
MetadataID is the lab-scoped models.dev metadata key for a model's provider-agnostic facts (e.g. "zhipuai/glm-4.6"). It is the stable upstream key for an EntityMetadata row and is immune to entity re-keying, so the store and the join adapter key metadata by it rather than by an EntityRef.String().
type Modalities ¶
Modalities groups the input and output modalities supported by a model.
type Modality ¶
type Modality int
Modality represents a type of input or output an AI model can process.
func (Modality) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (Modality) String ¶
String returns the human-readable name of the modality. For out-of-range values it returns "Modality(<n>)" rather than panicking.
func (*Modality) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type ModelID ¶
type ModelID string
ModelID is the canonical identifier for an AI model (e.g., "claude-3-5-sonnet-20241022").
type ModelInfo ¶
type ModelInfo struct {
ID ModelID
Provider Provider
DisplayName string
RawFamily Family // raw API family field verbatim (e.g. "claude-opus")
// Family is the canonical family identifier extracted from RawFamily
// (or inferred from ID when RawFamily is empty). Populated at codegen time.
Family Family
// Variant is the variant suffix extracted from RawFamily (e.g. "opus",
// "pro", "flash-lite"). Empty when the model has no variant. Populated at codegen time.
Variant string
// Version is the model version extracted from the model ID
// (primary source, e.g. "claude-opus-4-5-20251101" → "4.5") or, when the
// family string itself carries a version component, from the family string
// (fallback, e.g. "gemini-2.5-flash" → "2.5"). Empty when no separable
// version is found. Populated at codegen time.
Version string
// Date is the release date extracted from the model ID or ReleaseDate
// field, in YYYY-MM-DD format. Empty when no date is found. Populated at codegen time.
Date string
// Modifier is the LIST of known trailing tokens extracted from the model ID
// that carry semantic meaning beyond family/variant/version/date (e.g.
// ["thinking"], ["vision", "instruct"]). nil when no known modifier is found.
// The list is stored in deterministic CANONICAL ORDER (see CanonicalizeModifiers
// in modifier.go): capability > speed > format/stage, with an alphabetical
// fallback. Populated by the parse pipeline at codegen time.
// widened string → []string for lossless
// multi-modifier capture (kimi-k2-thinking-turbo → [thinking, turbo]).
//
// Release-stage tokens (preview/latest/original) REMAIN in this list as data —
// the extraction still captures them — but they are excluded from entity keys
// and from the canonical {mods}/[attrs] rendering: the Stage field carries that
// axis (see ReleaseStage in stage.go), and EntityModifiers/attributeModifiers
// route them out before classification.
Modifier []string
// ParamSize is the canonical parameter-size token for this model instance
// (e.g. "70b", "8b", "0.5b"). Empty when the size is unknown or not applicable.
// Populated at codegen time from curated data; participates in entity identity
// via the #size segment of EntityRef.String().
ParamSize string
// TotalParams, ActiveParams, PerExpertParams, and ExpertCount are the flat
// parameter-shape facts decomposed from ParamSize (see ParamShape and
// ParseParamShape). They are DERIVED presentation facts, never entity-key
// material — the identity carrier is ParamSize (the raw #size token). Each is an
// in-domain NULLable integer under the ParamShapeNull sentinel contract:
// ParamShapeNull (-1) means "not populated by the parser or curation" (the shape
// does not carry that fact, or the size is unknown), a positive value is an
// attested count, and a genuine 0 is reachable ONLY for ExpertCount (a dense
// shape attests zero experts). All four are ParamShapeNull when ParamSize is
// empty. They are grouped along parameter-shape joints, never collapsed: an NxM
// MoE token ("8x22b") records ExpertCount and PerExpertParams but leaves
// TotalParams and ActiveParams NULL (the product is deliberately not computed),
// while an active-MoE token ("30b-a3b") records TotalParams and ActiveParams and
// leaves PerExpertParams/ExpertCount NULL.
// TotalParams is the total parameter count (e.g. 30_000_000_000 for "30b");
// ParamShapeNull (-1) when the shape carries no total (NxM, count-suffixed) or
// the size is unknown.
TotalParams int64
// ActiveParams is the active (per-forward-pass) parameter count of a MoE model
// (e.g. 3_000_000_000 for "30b-a3b", 17_000_000_000 for "17b-16e").
// ParamShapeNull (-1) for a dense model or when the size is unknown.
ActiveParams int64
// PerExpertParams is the per-expert parameter count of an NxM MoE token (e.g.
// 22_000_000_000 for "8x22b"). ParamShapeNull (-1) unless the shape is NxM.
PerExpertParams int64
// ExpertCount is the number of experts of a MoE model (8 for "8x22b", 16 for
// "17b-16e"). A genuine 0 for a dense model (it attests zero experts);
// ParamShapeNull (-1) for a MoE shape that carries no count (active-MoE
// "30b-a3b") or when the size is unknown.
ExpertCount int
ContextWindow int
MaxOutput int
Reasoning bool
ToolCall bool
Attachment bool
Temperature bool
StructuredOutput bool
Interleaved Capability
OpenWeights bool
CostInputPerMTok *float64
CostOutputPerMTok *float64
CostReasoningPerMTok *float64
CostCacheReadPerMTok *float64
CostCacheWritePerMTok *float64
ReleaseDate string
Knowledge string
Modalities Modalities
// Host is the serving host / backend infrastructure that runs this model
// instance, distinct from Provider. It is a per-instance ATTRIBUTE and never
// participates in entity identity. HostNone (zero value) when unknown or when
// the provider serves the model directly. Populated by the host-split slice.
Host Host
// Region is the serving JURISDICTION of this instance: the AWS Bedrock
// cross-region inference-profile region encoded in the model-ID prefix (us./eu./
// au./jp./global.). Like Host it is a per-instance ATTRIBUTE and never
// participates in entity identity. RegionNone (zero value) when the ID carries no
// region prefix; it renders "unspecified". Populated by enrichModelInfo via
// DetectRegion (a pure function of the ID); see region.go.
Region Region
// RegionRaw carries the verbatim region token, populated only when Region is the
// fail-safe RegionOther (a recognized-but-unmapped region token); empty for every
// named member and for RegionNone (the Quantization/QuantRaw carrier precedent).
RegionRaw string
// Lineage is the set of derivation edges from this model to its parent
// model(s) (finetune, merge, distillation, …). nil when the model is a base
// model or no curated lineage is known. Populated at codegen time from the
// curated lineage table by the lineage slice.
Lineage []LineageEdge
// QuantVRAM is the per-quantization weight and VRAM footprint for this model
// instance. nil when no quantization data is available. Populated at codegen
// time from curated data; live-sync rows carry nil (curated VRAM is not
// available from the live API).
QuantVRAM []QuantVRAM
// Source is the ORIGINATING ingest source that attests this model row. Every
// bestiary row originates from the models.dev pipeline, so the effective default
// is DataSourceModelsDev: the compiled-in registry fills an empty carrier in at
// the load layer (registry.go init) and the store read path resolves a
// not-persisted carrier the same way (store.go scanModelInfo), so a caller never
// sees an empty Source for a real row. A row ENRICHED by a further source carries
// that source instead (e.g. an ollama-curated row carries DataSourceOllama); the
// raw generated literal is still "" (DataSourceNone) for pure models.dev rows —
// the fill-in is a runtime normalization, not a re-bake of the generated data.
Source DataSourceID
// Creator is the lab / organization that TRAINED this model (the SPDX
// originator), DERIVED from Family via the curated creators.json seed
// (Family.Creator). It is DISTINCT from Provider (the SPDX supplier). This is a
// DERIVED JOIN PROJECTION, not an independent stored fact: Family → Creator is a
// function (BCNF), so the value is baked at codegen from the family via the seed
// (loud-at-codegen) rather than hand-entered per row, keeping the compiled
// registry and the persisted store creators dimension in agreement by
// construction. CreatorNone (zero value, empty string) when the family has no
// curated mapping. Never entity-key material.
Creator Creator
// Description is the upstream model description. Empty when none is provided.
Description string
// Status is the upstream release status for this instance (StatusNone when
// none is declared, which means generally available / stable). Status is an
// instance-level fact — it is present on the api.json side only and never on
// EntityMetadata.
Status ModelStatus
// StatusRaw carries the verbatim upstream status token, populated only when
// Status is StatusOther (an unrecognized token); empty otherwise.
StatusRaw string
// Stage is the release stage DERIVED from this model's ID (preview / beta /
// latest / original), distinct in provenance from Status: Status is the
// upstream-DECLARED lifecycle from the api.json side, while Stage is read out
// of the ID token stream by DetectStageFromID at the same enrichment joints as
// ParamSize. StageNone (the zero value) when the ID carries no recognized stage
// marker. Stage is a per-instance attribute and never participates in entity
// identity (a "-beta"/"-latest" marker does not split the entity). Populated by
// enrichModelInfo (pure function of the ID); see stage.go.
Stage ReleaseStage
// StageRaw carries the verbatim stage token, populated only when Stage is
// StageOther — the RESERVED bucket for a future non-ID stage feeder. The
// ID-detection path never yields StageOther, so StageRaw is empty for every
// ID-derived stage this epoch (mirroring StatusRaw's Other-only convention).
StageRaw string
// ReasoningOptions are the reasoning-control options this model exposes
// (toggle / effort / budget-tokens). nil when the model exposes none.
ReasoningOptions []ReasoningOption
// CostInputAudioPerMTok is the audio-input cost in USD per million tokens, or
// nil when unknown.
CostInputAudioPerMTok *float64
// CostOutputAudioPerMTok is the audio-output cost in USD per million tokens,
// or nil when unknown.
CostOutputAudioPerMTok *float64
// CostContextOver200k is the fixed context-over-200k-tokens pricing override,
// or nil when the model declares none. It is upstream's legacy fixed-threshold
// special case, kept distinct from CostTiers for wire fidelity.
CostContextOver200k *TierCost
// CostTiers are the general context-size-conditional price tiers. nil when the
// model declares none.
CostTiers []CostTier
LastSynced string // RFC3339
}
ModelInfo holds metadata for a single AI model as returned by the models.dev API.
Canonical fields (Family, Variant, Version, Date) are populated at codegen time by the bestiary-gen tool invoking bestiary.ParseFamily, bestiary.ExtractDate, and bestiary.InferFamilyFromID. They are zero-value for models loaded from the SQLite cache (pre-normalization epoch) until a sync is performed.
RawFamily is the raw API family value verbatim (e.g. "claude-opus", "gemini-flash"). Family is the canonical/normalized family (e.g. "claude", "gemini").
func LookupModel ¶
LookupModel searches the static registry for a model by its ID. It returns the model and true if found, or the zero value and false otherwise.
func LookupModelByProvider ¶
LookupModelByProvider searches the static registry for a model matching both the given provider and name (model ID string). It returns the model and true if found, or the zero value and false otherwise.
func MergeModels ¶
MergeModels merges static and cached model lists. Deduplicates by (ModelID, Provider) pair. When both sources have the same (ID, Provider), the entry with the more recent LastSynced timestamp wins. Models with the same ID but different providers are kept as distinct entries. Since LastSynced uses RFC3339 UTC format, lexicographic string comparison correctly determines recency.
func Models ¶
func Models() []ModelInfo
Models returns all available models. It delegates to StaticModels and returns a defensive copy so callers cannot mutate the registry. This is the preferred API for external callers; StaticModels is an implementation detail.
See EntityKeys() (in entities_constants_gen.go) for the canonical Entity__* entity-key constant slice, and ProvidersOf to enumerate an entity's serving providers.
func ModelsByFamily ¶
ModelsByFamily returns all static models with the given raw API family string. The family parameter matches the RawFamily field (verbatim API value, e.g. "claude-opus", "gemini-flash").
func ModelsByProvider ¶
ModelsByProvider returns all static models from the given provider.
func ParseAPIJSON ¶ added in v0.2.5
ParseAPIJSON decodes an api.json artifact (a models.dev provider map) into the public ModelInfo slice. It is the SAME decode path Client.FetchModels uses, so codegen and tests can parse a committed api.json snapshot offline with identical results. Model order follows API map iteration and is not sorted; callers that need determinism sort the result themselves.
func StaticModels ¶
func StaticModels() []ModelInfo
StaticModels returns a defensive copy of the compiled-in model data. Modifying the returned slice does not affect the registry.
func (ModelInfo) Ref ¶
Ref returns a ModelRef for this ModelInfo. Every field is populated: ID from the API model ID, RawFamily from the raw API family field, and Family, Variant, Version, ParamSize, Date, Modifier, Host from the codegen-baked normalization. ParamSize carries the canonical parameter-size token so identity-level consumers (e.g. Resolve's ambiguity grouping) can keep distinct sizes of one family apart.
type ModelLink ¶ added in v0.2.5
type ModelLink struct {
// Label is the human-facing link text.
Label string
// URL is the link target.
URL string
// Type is the classified link type.
Type LinkType
// TypeRaw carries the verbatim upstream type token, populated only when Type
// is LinkOther (an unrecognized tag); empty otherwise.
TypeRaw string
}
ModelLink is one reference link for a model: a labeled URL with a classified type. Upstream weights[] rows fold in here with Type == LinkWeights.
type ModelRef ¶
type ModelRef struct {
ID ModelID // Original API model ID (e.g. "claude-opus-4-20250514")
Provider Provider // Hosting provider
RawFamily Family // API family field verbatim (e.g., "claude-opus")
Family Family // Canonical family (e.g., "claude"); empty if not yet normalized
Variant string // Canonical variant (e.g., "opus"); empty if no variant
Version string // Model version extracted from family (e.g., "4.5", "2.5"); empty if none
ParamSize string // Canonical parameter-size token (e.g. "70b", "8b"); empty when unknown. Part of identity.
Date string // Release date in YYYY-MM-DD format; empty if none
Modifier []string // Known trailing tokens in canonical order (e.g., ["vision","instruct"]); nil if none
Host Host // Serving host/backend (per-instance attribute, never part of identity); HostNone if unknown
// Region is the serving jurisdiction / AWS Bedrock region (per-instance attribute,
// never part of identity; RegionNone if unspecified). RegionRaw is the fail-safe
// carrier for RegionOther. Both are json:"-" for now: the field exists (the parse
// half), but exposing Region on the public JSON contract is a schema change deferred
// to the schema-0.5.0 bump — until then it is excluded from serialization so it
// causes no schema drift, exactly as it is excluded from all key rendering.
Region Region `json:"-"`
RegionRaw string `json:"-"`
}
ModelRef represents the canonical identity of a model.
The tuple (ID, Provider, RawFamily, Family, Variant, Version, ParamSize, Date, Modifier) is the stable anchor for cross-provider queries, canonical formatting, and the normalization pipeline. ID is the original API model identifier (e.g. "claude-opus-4-20250514"). Family, Variant, Version, ParamSize, and Modifier are populated at codegen time by the normalization pipeline in cmd/bestiary-gen.
ParamSize is part of the canonical entity identity (mirroring EntityRef): a 70B and an 8B of one family are distinct models, so the size participates in identity-level bucketing (e.g. Resolve's ambiguity grouping). It is empty when the model's size is unknown. Host is a per-instance attribute and is NEVER part of identity.
func Resolve ¶
func Resolve(input string, opts ...ResolveOption) ([]ModelRef, error)
Resolve returns the set of ModelRefs that match the given input string.
Disambiguation rule ¶
Cross-provider hosting: if all matches share the same Canonical triple (Family, Variant, Date) — meaning the same conceptual model is hosted by multiple providers — Resolve returns a non-nil []ModelRef with err == nil. The caller can iterate by Provider.
Multiple distinct canonicals: if the input matches models that resolve to two or more distinct Canonical triples (e.g., "claude" matches claude/opus, claude/sonnet, and claude/haiku), Resolve returns nil, *ErrAmbiguous with the candidate list. The caller should refine the input or use WithScheme(SchemeRaw) with an exact API model ID.
Zero matches: returns nil, *ErrNotFound.
Scheme auto-detection ¶
- "pkg:huggingface/<provider>/<id>" → SchemePURL: strip prefix, apply provider filter
- "<family>/<variant>[@date]" or multi-segment form with "@" or versioned token → SchemeCanonical
- "<provider>/<id>" (two slash segments, no "pkg:" prefix, no canonical signals) → SchemeHuggingFace: strip provider prefix, match raw ID
- Otherwise → SchemeRaw: exact model ID match
Bare-family fallback: when SchemeRaw produces zero matches and the input contains no slashes or special characters, Resolve retries with SchemeCanonical family-only matching. If multiple distinct canonical triples match, *ErrAmbiguous is returned. If a single group matches, refs are returned. This surfaces *ErrAmbiguous for inputs like "claude" instead of ErrNotFound.
Variant-aware bare-family fallback: when the Family-exact retry also yields zero matches and the bare input is a hyphenated "<family>-<variant>" shorthand whose leading token is a registered Family and trailing token names a Variant within it (e.g. "claude-opus"), Resolve matches that variant group and returns *ErrAmbiguous with the variant's candidates. See matchBareFamilyVariant for the conservative matching rule.
Use WithScheme to override auto-detection.
func (ModelRef) Designations ¶
func (r ModelRef) Designations() []Designation
Designations returns all string designations for this ModelRef.
Acceptability is now ACTIVATED (this is the epoch that promotes it): the SchemeCanonical designation carries AcceptabilityPreferred — the canonical decomposed key IS the preferred designation of the identity — while the raw ID, HuggingFace, and PURL forms stay AcceptabilityAdmitted (recognized, usable, not preferred). This is the READ-PROJECTION half of the naming layer: a Designation is the ref-level rendering of the same fact a Nomen records at the entity level, so the SchemeCanonical designation's Preferred rating agrees by construction with the NomenSchemeCanonical nomen's AcceptabilityPreferred status (the Designations↔Nomen consistency fence: shared schemes agree on rating).
Redundant-modifier suppression (suppression.go) is deliberately OUT of this projection's reach. Suppression is an ENTITY-level naming policy: it chooses which spelling of an entity KEY is preferred. A Designation renders a ModelRef — a per-instance form that carries date and attribute-class modifiers an entity key never has — so applying an entity-key policy here would silently rewrite a different grammar. The two stay consistent on the axis they share (the RATING: canonical is Preferred in both), and a seeded entity's preferred entity-key VALUE is read from Entity.PreferredName / PreferredNomenValue, never from here.
The returned slice contains:
- A SchemeRaw designation using the original API model ID (Admitted).
- A SchemeCanonical designation, the canonical slash-separated form (Preferred).
- A SchemeHuggingFace designation (Admitted).
- A SchemePURL designation (Admitted) — ONLY for a HuggingFace-hosted ref.
The purl entry is DROPPED entirely (not emitted with an empty value) for every other provider, because Format(SchemePURL) is restricted to the refs whose registry home is known (see formatPURL). A designation is an assertion that a thing IS called something; an empty-valued one would assert a name that does not exist. So a non-HF ref yields three designations, an HF ref four.
func (ModelRef) Format ¶
func (r ModelRef) Format(s CanonicalScheme) string
Format serializes the ModelRef according to the given CanonicalScheme.
- SchemeCanonical: "<provider>/<family>/<variant>@<date>" — the variant segment is included only when non-empty; the "@<date>" suffix is included only when date is non-empty. Falls back to "<provider>/<raw-id>" when both Family and Variant are empty (e.g., provider-specific representation).
- SchemeHuggingFace: "<provider>/<raw-id>" (HuggingFace Hub form).
- SchemePURL: "pkg:huggingface/<raw-id>" — RESTRICTED to Provider == ProviderHuggingFace; every other provider renders "" (see formatPURL).
- SchemeRaw: string(r.ID) — the original API model identifier verbatim.
- SchemeOCI: "" BY DESIGN. A `pkg:oci` purl is content-addressed by a manifest digest that lives on QuantVRAM.OCIDigest (per-quant), so a bare ModelRef — which carries no digest — has no single OCI identity to render. The OCI render lives at quant altitude ((QuantVRAM).OCIPurl / formatOCIPurl), mirroring how formatPURL drops the purl for a ref whose registry home is unknown.
func (ModelRef) IRI ¶ added in v0.2.7
IRI returns an IRI (RFC 3987) naming this per-provider REF inside the caller-supplied base namespace: base + the percent-encoded canonical rendering (Format(SchemeCanonical), e.g. "anthropic/claude/opus@2025-05-14").
It is the instance-level twin of EntityRef.IRI and differs only in WHAT is named: a ModelRef IRI names one provider's serving of a model (it carries the provider segment, the release date and the "[attributes]" segment), while an EntityRef IRI names the provider-agnostic entity. A consumer building a graph normally wants the entity IRI as the subject and the ref IRIs as its per-provider instances.
The same escaping and base rules apply (see escapeIRISegment / mintIRI); an empty base returns "".
type ModelStatus ¶ added in v0.2.5
type ModelStatus int
ModelStatus classifies the release status an upstream provider declares for a model instance (from the api.json status field). It is a closed int enum (like DerivationKind and Quantization) because the set of statuses is small and well-understood.
The zero value is StatusNone: on this SCALAR field absence is meaningful — a model with no declared status is generally available / stable — so None sits at zero and StatusOther is the fail-safe bucket for an unknown-but-present token (the raw token is carried on ModelInfo.StatusRaw). This None-at-zero convention deliberately differs from the Other-at-zero convention on the element enums LinkType and ReasoningOptionKind; see the file-level comment.
Wire names are lowercase ASCII strings; MarshalText / UnmarshalText implement encoding.TextMarshaler / encoding.TextUnmarshaler so a ModelStatus serializes as a JSON/YAML string rather than an integer.
const ( // StatusNone is the zero value: no status declared (generally available / stable). StatusNone ModelStatus = iota // StatusAlpha: an early, unstable preview. StatusAlpha // StatusBeta: a later preview, more stable than alpha but not yet GA. StatusBeta // StatusDeprecated: scheduled for or already past end-of-life. StatusDeprecated // StatusOther is the fail-safe for a status token present in the upstream // data but not covered by the named constants above. The raw token is carried // on ModelInfo.StatusRaw. detectModelStatus maps an unrecognized token here; // ParseModelStatus never does (it returns an actionable error instead). StatusOther )
func ParseModelStatus ¶ added in v0.2.5
func ParseModelStatus(s string) (ModelStatus, error)
ParseModelStatus parses a ModelStatus from a string using a case-insensitive exact match against the canonical wire names. It is the CLI path (e.g. list --status): the empty string returns StatusNone with no error, a recognized name returns its constant, and any other non-empty string returns an actionable error that names what was received and lists the valid values. Unlike detectModelStatus, ParseModelStatus never silently maps an unrecognized token to StatusOther, and it rejects the internal "other" sentinel (it is not a user-selectable status).
func (ModelStatus) IsKnown ¶ added in v0.2.5
func (s ModelStatus) IsKnown() bool
IsKnown reports whether s is a named constant in this package (i.e. not an out-of-range integer). StatusOther is considered known — it is a named member of the enum; only truly out-of-range integers return false.
func (ModelStatus) MarshalText ¶ added in v0.2.5
func (s ModelStatus) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler, emitting the canonical wire name (so ModelStatus serializes as a JSON string, not an integer). An out-of-range value is a programming error and yields an actionable error.
func (ModelStatus) String ¶ added in v0.2.5
func (s ModelStatus) String() string
String returns the canonical lowercase wire name of the status. An out-of-range value renders as "modelstatus(<n>)" so logs never silently drop an unexpected value.
func (*ModelStatus) UnmarshalText ¶ added in v0.2.5
func (s *ModelStatus) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, parsing a canonical wire name back into a ModelStatus. Parsing is case-insensitive so mixed-case upstream tokens round-trip. An unrecognized token yields an actionable error.
type ModifierClass ¶ added in v0.2.3
type ModifierClass int
ModifierClass partitions a trailing model-ID modifier token (e.g. "instruct", "thinking", "turbo") into one of two roles relative to model IDENTITY:
- ModifierClassIdentity: the modifier distinguishes a genuinely different model artifact (different weights/behavior), so it is PART of the entity key. Example: "instruct" — meta/llama@3.1{instruct} is a distinct entity from meta/llama@3.1. Identity modifiers render in the "{...}" segment.
- ModifierClassAttribute: the modifier describes a per-instance presentation or runtime knob that does NOT change model identity, so it is EXCLUDED from the entity key. Example: "thinking" — claude/opus@4.5[thinking] is the same entity as claude/opus@4.5. Attribute modifiers render in the "[...]" segment.
The zero value is ModifierClassIdentity: an unknown/uncurated token defaults to Identity (fail-safe — never silently collapse two artifacts into one entity).
const ( // ModifierClassIdentity marks a modifier that is part of the entity key. // This is the zero value and the default for unknown tokens. ModifierClassIdentity ModifierClass = iota // ModifierClassAttribute marks a modifier that is excluded from the entity // key (a per-instance presentation/runtime attribute). ModifierClassAttribute )
func ClassifyModifier ¶ added in v0.2.3
func ClassifyModifier(token string, fam Family) ModifierClass
ClassifyModifier returns the ModifierClass of a single modifier token for the given family. The classification is family-aware because the same token can be identity-bearing for one family and a mere attribute for another (e.g. "turbo": identity for gpt-4-turbo, attribute for a speed-tier alias elsewhere).
Resolution order (per-family override BEATS the global table):
- family_overrides[fam][token] in modifier_class.json, if present;
- global[token] in modifier_class.json, if present;
- otherwise ModifierClassIdentity (the fail-safe default).
CONTRACT: unknown/uncurated tokens MUST classify as ModifierClassIdentity (the fail-safe default) and ClassifyModifier MUST NOT panic for any input — rendering and entity keying depend on this graceful-degrade guarantee. If the embedded table fails to load, classification degrades to the unknown->Identity default for every token (never a panic).
func (ModifierClass) String ¶ added in v0.2.3
func (c ModifierClass) String() string
String returns the lowercase name of the modifier class.
type Nomen ¶ added in v0.2.7
type Nomen struct {
// Value is the naming string (a raw model ID, a canonical key, an alias spelling).
Value string
// Scheme classifies the KIND of naming (provenance classifier, not a render codec).
Scheme NomenScheme
// Status is the ISO-1087 acceptability rating. Canonical nomina are Preferred;
// provider-ID and alias nomina are Admitted. It is ONE editorial judgment per
// name — a same-triple Status disagreement is a LOUD codegen conflict.
Status AcceptabilityRating
// ResolvesTo is the entity this naming denotes. One spelling may resolve to
// several entities (homonymy); NomenLookup returns all matches.
ResolvesTo EntityRef
// Attestations is the evidence set (>=1): each element is an independent
// assertion of this naming. coalesceNomina unions same-triple attestations from
// distinct sources; the slice is kept deterministically sorted (lessAttestation).
Attestations []NomenAttestation
}
Nomen is one recorded NAMING of an entity: a value string classified by scheme, carrying its acceptability status, the entity it resolves to, and — the v0.2.8 multi-attestation lift — a set of independent attestations (the evidence set). A name HAS-MANY attestations: provenance is no longer FUSED into the name row, so two sources asserting the same name append two attestations rather than conflicting. Status remains bestiary's single editorial judgment, exactly once per name.
An Entity HAS-MANY Nomina; the canonical key IS the entity's Preferred nomen (scheme NomenSchemeCanonical). Designation (designation.go) is the READ PROJECTION of the same underlying facts — a Nomen recorded at the entity level, a Designation rendered at the ref level.
func MintNomina ¶ added in v0.2.7
MintNomina mints the FULL nomen set over the given entities plus every curated alias claim: the union of each entity's mintEntityNomina and the claim table. It is the shared production entry point for codegen (census pins), sync (store persistence), and NomenLookup's index. The result is deterministically sorted (INV3: the explicit sort makes the output order independent of entity/instance iteration order even though nothing is emitted to a *_gen.go). A claim whose ResolvesTo names an entity absent from the input is STILL included (a curated alias is authoritative curation, not gated on catalog presence) — the same keep-never-drop discipline the lineage synthetic-fixture flag uses.
func MintNominaFromModels ¶ added in v0.2.7
MintNominaFromModels mints the full nomen set directly from a flat []ModelInfo — the SHARED DECODE JOINT for the sync path, which holds freshly-fetched models but has not built the registry index. It groups models into entities by the SAME identity-class EntityRef key the registry aggregate uses (EntityModifiers projection), mints one Canonical (Preferred) nomen per entity key and one ProviderID (Admitted) nomen per distinct instance ID spelling within that entity, then folds in the curated alias claims. The result is deterministically sorted (INV3). It agrees row-for-row with MintNomina(Entities()) over the same models, so codegen/sync/cache stay in lockstep: they mint through equivalent joints.
func NomenLookup ¶ added in v0.2.7
NomenLookup returns EVERY nomen whose Value equals value, and whether at least one exists. It returns ALL matches — a single spelling may resolve to several distinct entities (homonymy: the ErrAmbiguous reality), so a scalar "the nomen" would be a lie. The HOMONYMY POSITIVE FENCE rests on this: N persisted rows for one spelling yield N results here. The comparison is exact (case-sensitive) on the raw value.
type NomenAttestation ¶ added in v0.2.8
type NomenAttestation struct {
// SourceURL is WHO asserts this naming (claim attribution). "" for self-minted.
SourceURL string
// ArchivedURL is an archive.org snapshot OF SourceURL, in the
// IsArchiveSnapshotURL shape. It is a best-effort durability aid for the
// HARVESTED layer, whose SourceURL is a LIVE page that can rot: the offline
// cmd/bestiary-hf bot asks the Wayback Availability API for the closest
// snapshot and records it here. It is ADDITIVE — SourceURL stays primary and
// unchanged — and is "" whenever no snapshot is recorded (no lookup was made,
// the API reported none, or the lookup failed). An empty value is an honest
// "unknown", never an error. A CURATED claim leaves it "": that layer's fence
// already requires SourceURL itself to be the snapshot, so it needs no second
// field.
ArchivedURL string
// Source is WHICH ingest we read this naming from (a DataSourceID FK).
Source DataSourceID
// Authority is whose VOICE the evidence document is (per-attestation).
Authority AttestationAuthority
// Method is HOW this record entered the system (per-attestation).
Method IngestMethod
// IngestedAt is a committed snapshot RFC3339 timestamp; "" honest when unknown.
IngestedAt string
}
NomenAttestation is one independent piece of evidence for a Nomen (the Wikidata per-claim-reference model). Each attestation stands on its own; two sources asserting the same name append two attestations, never overwrite. A Nomen HAS-MANY attestations — the v0.2.8 multi-attestation lift of the former fused SourceURL+Source columns.
The two provenance fields must NEVER be conflated (the BenchmarkResult SourceURL-vs-Source discipline):
- SourceURL is WHO ASSERTS the naming (claim attribution) — e.g. the xAI model page that declares "grok-beta" as an alias. Empty for bestiary-self-minted nomina (provider-ID spellings and canonical keys assert themselves).
- Source is WHICH INGEST we read the naming from (a DataSourceID FK) — the catalog/pipeline through which the naming reached bestiary.
Curated-claims archive policy: a SourceURL carried by a claim in parse/data/nomen_claims.json is an archive.org snapshot URL captured when the claim was created, never the live claimant page (see nomen_claims.go). The policy binds the CURATED claims layer only.
The two URL fields answer different questions and are never interchangeable: SourceURL is the citation of record; ArchivedURL is a best-effort durability aid FOR that citation. The curated layer needs only SourceURL because its SourceURL already IS the snapshot; the harvested layer cites a LIVE observation, so its snapshot — when one exists — rides alongside on ArchivedURL.
type NomenScheme ¶ added in v0.2.7
type NomenScheme int
NomenScheme classifies a Nomen by the KIND of naming it records — a provenance classifier, NOT a rendering codec.
It is deliberately distinct from canonical.go's CanonicalScheme: CanonicalScheme is a RENDER CODEC (given a ModelRef, produce a string in some serialization), while NomenScheme is a RECORDED-FACT CLASSIFIER (given an observed naming, say what kind of naming it is — a provider's raw ID spelling, the canonical key itself, a third-party-asserted alias, …). The two never collide because their constants are type-prefixed (NomenScheme*) and live on different types.
It follows the ELEMENT-enum convention (the Quantization / ReasoningOptionKind precedent): every nomen is minted with a KNOWN scheme, so absence is uninhabitable — the zero value NomenSchemeOther is the fail-safe bucket, sitting AT zero, never a "none" sentinel.
const ( // NomenSchemeOther is the fail-safe bucket (zero value): a recorded naming whose // kind is not one of the known schemes. No mint path produces it today; it exists // so a future feeder never has to drop an unclassifiable naming. NomenSchemeOther NomenScheme = iota // NomenSchemeCanonical is the entity key itself — the canonical decomposed // identity (EntityRef.String()). It is the PREFERRED designation of an entity. NomenSchemeCanonical // NomenSchemeProviderID is a provider's verbatim model-ID spelling (the raw // catalog ID). It is an ADMITTED designation: recognized and usable, not preferred. NomenSchemeProviderID // NomenSchemeHuggingFace is a HuggingFace Hub org/repo naming (reserved for the // external-identifier slice; seeded via curated claims). NomenSchemeHuggingFace // NomenSchemePURL is a Package-URL naming (reserved for the external-identifier // slice). NomenSchemePURL // NomenSchemeAlias is a third-party-asserted alias — a naming a lab or vendor // declares for a model (e.g. xAI publishing "grok-beta" as an alias). It carries // claim attribution (a NomenAttestation whose SourceURL is who asserted it) and // is ADMITTED. NomenSchemeAlias // NomenSchemeOCI is a `pkg:oci` purl naming minted per digest-bearing Ollama quant // row (the content-addressed manifest digest is what makes each OCI purl unique). // APPENDED to the iota tail (wire stability). It is ADMITTED and carries an Ollama // Harvested/Secondary attestation. A digest rotates on any re-publish // (requantization / template fixes), not only a new release, and the old-digest // OCI nomen PERSISTS — names are never erased. NomenSchemeOCI )
func (NomenScheme) MarshalText ¶ added in v0.2.7
func (s NomenScheme) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler so a NomenScheme serializes as its lowercase token in JSON/YAML (the ModelStatus precedent), not as its underlying int. It never errors — String covers every value.
func (NomenScheme) String ¶ added in v0.2.7
func (s NomenScheme) String() string
String renders the NomenScheme as its canonical lowercase wire token. An out-of-range value degrades to "other" (never a panic).
func (*NomenScheme) UnmarshalText ¶ added in v0.2.7
func (s *NomenScheme) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, the inverse of MarshalText: it maps a lowercase wire token back to its NomenScheme. An unrecognized token is an actionable error (the ModelStatus precedent), never a silent NomenSchemeOther.
type OutputFormat ¶
type OutputFormat string
OutputFormat specifies how models are rendered for display.
const ( FormatJSON OutputFormat = "json" FormatYAML OutputFormat = "yaml" FormatTable OutputFormat = "table" )
type ParamShape ¶ added in v0.2.6
type ParamShape struct {
TotalParams int64
ActiveParams int64
PerExpertParams int64
ExpertCount int
}
ParamShape is the pure decomposition of a canonical parameter-size token into flat parameter-count facts. It is produced by ParseParamShape and carries the same four values that ModelInfo exposes inline (TotalParams / ActiveParams / PerExpertParams / ExpertCount).
Each field is a NULLable integer under the ParamShapeNull (-1) sentinel contract: a field the shape does not carry is ParamShapeNull, never a masquerading 0. The fields are grouped along parameter-shape joints and are NEVER concatenated or cross-computed. In particular an NxM MoE token ("8x22b") sets ExpertCount and PerExpertParams but leaves TotalParams and ActiveParams NULL — the total is deliberately NOT N*M, because upstream does not publish it and inventing it would misstate the footprint. An active-MoE token ("30b-a3b") sets TotalParams and ActiveParams and leaves PerExpertParams/ExpertCount NULL; a count-suffixed MoE token ("17b-16e") sets ActiveParams and ExpertCount and leaves TotalParams and PerExpertParams NULL; a dense token ("30b", "560m", "10.7b") sets TotalParams, leaves ActiveParams and PerExpertParams NULL, and sets ExpertCount to a genuine 0 (a dense model attests zero experts). The empty token leaves ALL FOUR NULL.
Counts are exact int64 parameter counts (e.g. 30_000_000_000 for "30b"), computed with string-digit decimal arithmetic so a decimal token such as "10.7b" yields exactly 10_700_000_000 (never a float64 rounding of 10.7e9).
func ParseParamShape ¶ added in v0.2.6
func ParseParamShape(sizeToken string) (ParamShape, error)
ParseParamShape decomposes a canonical parameter-size token into its flat parameter-count facts. It is a PURE, suffix-keyed decomposition: the token's shape (dense / NxM / active-MoE / count-suffixed-MoE) selects which fields are populated, and no field is ever cross-computed from another.
The counts are EXACT int64 values derived with string-digit decimal arithmetic (never a float64 multiply), so a decimal token is exact to the parameter: "10.7b" -> TotalParams 10_700_000_000 and "0.6b" -> TotalParams 600_000_000.
An NxM MoE token records ExpertCount and PerExpertParams but leaves TotalParams and ActiveParams at ParamShapeNull (-1) — the product is deliberately NOT computed (upstream does not publish a total for these and N*M would misstate the footprint). A count-suffixed token ("17b-16e") records ActiveParams and ExpertCount and leaves TotalParams/PerExpertParams NULL. See the ParamShapeNull sentinel contract.
Every field the matched shape does NOT carry is set to ParamShapeNull (-1), the in-domain NULL sentinel — never a masquerading 0. The sole genuine 0 is a dense token's ExpertCount (a dense model attests exactly zero experts). The empty token yields the ALL-NULL shape with no error (an unsized model). A non-empty token that is not a recognized size shape returns an actionable error AND the all-NULL shape (nothing was populated), the same rejection surface as ParseParamSize.
ParseParamShape("") -> {Total:-1, Active:-1, PerExpert:-1, Experts:-1}
ParseParamShape("8b") -> {Total: 8e9, Active:-1, PerExpert:-1, Experts: 0} // dense: Experts genuine 0
ParseParamShape("30b-a3b") -> {Total:30e9, Active: 3e9, PerExpert:-1, Experts:-1}
ParseParamShape("8x22b") -> {Total: -1, Active: -1, PerExpert:22e9, Experts: 8} // Total NEVER N*M
ParseParamShape("17b-16e") -> {Total: -1, Active:17e9, PerExpert:-1, Experts:16}
type ParseAttempt ¶ added in v0.2.0
type ParseAttempt struct {
Family Family `json:"family"`
Variant string `json:"variant"`
Version string `json:"version"`
Date string `json:"date"`
}
ParseAttempt records the partial result produced when parse heuristics could not fully decompose a raw family string. Fields mirror ModelInfo canonical fields (Family, Variant, Version, Date) to aid comparison.
type ParseFailure ¶ added in v0.2.0
type ParseFailure struct {
RawID ModelID `json:"raw_id"`
Provider Provider `json:"provider"`
RawFamily Family `json:"raw_family"`
AttemptedParse ParseAttempt `json:"attempted_parse"`
Reason ParseFailureReason `json:"reason"`
}
ParseFailure records a single parsing failure detected during family-string decomposition. It is produced by ParseFamilyDetailed when the parser's best-effort result is known to be incomplete or ambiguous.
JSON field names match the locked per-record format:
{
"raw_id": "claude-3-5-haiku-20241022",
"provider": "anthropic",
"raw_family": "claude-haiku",
"attempted_parse": {"family":"claude","variant":"haiku","version":"","date":"2024-10-22"},
"reason": "version digits between family-prefix and variant not extracted"
}
type ParseFailureReason ¶ added in v0.2.2
type ParseFailureReason string
ParseFailureReason is a typed string identifying the class of parse failure. Using a named type rather than bare string prevents accidental mixing of reason strings and enables exhaustive case analysis.
const ( // ReasonVersionDigitsNotExtracted is used when version digits appear between // the family prefix and the variant (e.g. "claude-3-5-haiku-20241022" where // the "3-5" version component is not extracted by the parse heuristics). ReasonVersionDigitsNotExtracted ParseFailureReason = "version digits between family-prefix and variant not extracted" // ReasonKnownSuffixOverflow is used when the trailing segment of the model ID // matches a known modifier token (thinking, vision, latest, code, preview, think). // The modifier is semantically meaningful but not yet extracted as a first-class // field. Extend the modifier allowlist in parse/data/modifiers.json when new // tokens are discovered. ReasonKnownSuffixOverflow ParseFailureReason = "suffix overflow: trailing token is a known modifier" // ReasonUnknownSuffixOverflow is used when the trailing segment of the model ID // does not match any known modifier token. This is an audit-log hint that the // modifier allowlist in parse/data/modifiers.json should be extended. ReasonUnknownSuffixOverflow ParseFailureReason = "suffix overflow: trailing token is an unknown modifier (extend allowlist)" // ReasonYYMMDateAsVersion is used for Mistral-style 4-digit numerals (e.g. 2401, // 2403) where the parser cannot reliably distinguish a YYMM date from a version. ReasonYYMMDateAsVersion ParseFailureReason = "YYMM-date-as-version false-positive" // ReasonResidualUnaccountedTokens is used when version extraction succeeds but // leaves one or more tokens in the model ID unaccounted for (e.g. nova-2-lite-v1 // yields version="2" but token "v1" is not explained by family/variant/version/date). // This is an honest-audit signal: the version is populated but there is residual // information the parser did not fully account for. ReasonResidualUnaccountedTokens ParseFailureReason = "residual unaccounted tokens after extraction" )
Reason constants for the known failure modes (use these constants verbatim to ensure consistent reason phrasing across all callers).
type ParseFailuresEnvelope ¶ added in v0.2.0
type ParseFailuresEnvelope struct {
SchemaVersion int `json:"schema_version"`
GeneratedAt time.Time `json:"generated_at"`
FailureCount int `json:"failure_count"`
Failures []ParseFailure `json:"failures"`
}
ParseFailuresEnvelope is the top-level JSON structure written by bestiary-gen to .bestiary-gen-cache/parse_failures.json after each codegen run. The file is overwritten on every run (full audit, not append).
type Provider ¶
type Provider string
Provider identifies the organization that hosts or publishes an AI model.
const ( Provider302AI Provider = "302ai" ProviderAbacus Provider = "abacus" ProviderAbliterationAI Provider = "abliteration-ai" ProviderAgentRouter Provider = "agentrouter" ProviderAgnes Provider = "agnes" ProviderAIRouter Provider = "ai-router" ProviderAiand Provider = "aiand" ProviderAIHubMix Provider = "aihubmix" ProviderAixy Provider = "aixy" ProviderAkiIO Provider = "aki-io" ProviderAlibaba Provider = "alibaba" ProviderAlibabaCN Provider = "alibaba-cn" ProviderAlibabaCodingPlan Provider = "alibaba-coding-plan" ProviderAlibabaCodingPlanCN Provider = "alibaba-coding-plan-cn" ProviderAlibabaTokenPlan Provider = "alibaba-token-plan" ProviderAlibabaTokenPlanCN Provider = "alibaba-token-plan-cn" ProviderAmazonBedrock Provider = "amazon-bedrock" ProviderAmbient Provider = "ambient" ProviderAMD Provider = "amd" ProviderAnthropic Provider = "anthropic" ProviderAnyAPI Provider = "anyapi" ProviderArcee Provider = "arcee" ProviderAtomicChat Provider = "atomic-chat" ProviderAuriko Provider = "auriko" ProviderAzure Provider = "azure" ProviderAzureCognitiveServices Provider = "azure-cognitive-services" ProviderBailing Provider = "bailing" ProviderBaseten Provider = "baseten" ProviderBerget Provider = "berget" ProviderBlueclaw Provider = "blueclaw" ProviderCerebras Provider = "cerebras" ProviderChutes Provider = "chutes" ProviderClarifai Provider = "clarifai" ProviderClaudinio Provider = "claudinio" ProviderClinePass Provider = "cline-pass" ProviderCloudFerroSherlock Provider = "cloudferro-sherlock" ProviderCloudflareAIGateway Provider = "cloudflare-ai-gateway" ProviderCloudflareWorkersAI Provider = "cloudflare-workers-ai" ProviderCohere Provider = "cohere" ProviderCoralBricks Provider = "coralbricks" ProviderCortecs Provider = "cortecs" ProviderCrof Provider = "crof" ProviderCrossModel Provider = "crossmodel" ProviderCrusoe Provider = "crusoe" ProviderDaoXE Provider = "daoxe" ProviderDatabricks Provider = "databricks" ProviderDeepInfra Provider = "deepinfra" ProviderDeepSeek Provider = "deepseek" ProviderDigitalOcean Provider = "digitalocean" ProviderDInference Provider = "dinference" ProviderDrun Provider = "drun" ProviderEBCloud Provider = "ebcloud" ProviderEcho Provider = "echo" ProviderEdenai Provider = "edenai" ProviderEmpirioLabs Provider = "empiriolabs" ProviderEvroc Provider = "evroc" ProviderFastRouter Provider = "fastrouter" ProviderFireworksAI Provider = "fireworks-ai" ProviderFreeModel Provider = "freemodel" ProviderFriendli Provider = "friendli" ProviderFrogBot Provider = "frogbot" ProviderGitHubCopilot Provider = "github-copilot" ProviderGitLab Provider = "gitlab" ProviderGMICloud Provider = "gmicloud" ProviderGoogle Provider = "google" ProviderGoogleVertex Provider = "google-vertex" ProviderGoogleVertexAnthropic Provider = "google-vertex-anthropic" ProviderGreenPT Provider = "greenpt" ProviderGroq Provider = "groq" ProviderHelicone Provider = "helicone" ProviderHetzner Provider = "hetzner" ProviderHpcAI Provider = "hpc-ai" ProviderHuggingFace Provider = "huggingface" ProviderHyper Provider = "hyper" ProvideriFlowCN Provider = "iflowcn" ProviderImpossibl Provider = "impossibl" ProviderInception Provider = "inception" ProviderInceptron Provider = "inceptron" ProviderInference Provider = "inference" ProviderInferX Provider = "inferx" ProviderInfomaniak Provider = "infomaniak" ProviderIONet Provider = "io-net" ProviderIteraCompute Provider = "iteracompute" ProviderJalapeno Provider = "jalapeno" ProviderJiekou Provider = "jiekou" ProviderKenari Provider = "kenari" ProviderKilo Provider = "kilo" ProviderKimiForCoding Provider = "kimi-for-coding" ProviderKosmik Provider = "kosmik" ProviderKUAECloudCodingPlan Provider = "kuae-cloud-coding-plan" ProviderLilac Provider = "lilac" ProviderLlama Provider = "llama" ProviderLlmGateway Provider = "llmgateway" ProviderLlmGatewayProviders Provider = "llmgateway-providers" ProviderLlmtech Provider = "llmtech" ProviderLLMTR Provider = "llmtr" ProviderLMStudio Provider = "lmstudio" ProviderLongCat Provider = "longcat" ProviderLucidQuery Provider = "lucidquery" ProviderLynkr Provider = "lynkr" ProviderMeganova Provider = "meganova" ProviderMergeGateway Provider = "merge-gateway" ProviderMeta Provider = "meta" ProviderMiniMax Provider = "minimax" ProviderMiniMaxCN Provider = "minimax-cn" ProviderMiniMaxCNCodingPlan Provider = "minimax-cn-coding-plan" ProviderMiniMaxCodingPlan Provider = "minimax-coding-plan" ProviderMistral Provider = "mistral" ProviderMixlayer Provider = "mixlayer" ProviderMoark Provider = "moark" ProviderModal Provider = "modal" ProviderModelOracleAI Provider = "model-oracle-ai" ProviderModelis Provider = "modelis" ProviderModelScope Provider = "modelscope" ProviderMoonshotAI Provider = "moonshotai" ProviderMoonshotAICN Provider = "moonshotai-cn" ProviderMorph Provider = "morph" ProviderNanoGPT Provider = "nano-gpt" ProviderNearAI Provider = "nearai" ProviderNebius Provider = "nebius" ProviderNeon Provider = "neon" ProviderNeoSmith Provider = "neosmith" ProviderNeuralwatt Provider = "neuralwatt" ProviderNova Provider = "nova" ProviderNovitaAI Provider = "novita-ai" ProviderNvidia Provider = "nvidia" ProviderOfox Provider = "ofox" ProviderOllamaCloud Provider = "ollama-cloud" ProviderOpenAI Provider = "openai" ProviderOpenCode Provider = "opencode" ProviderOpenCodeGo Provider = "opencode-go" ProviderOpenRouter Provider = "openrouter" ProviderOpper Provider = "opper" ProviderOrcaRouter Provider = "orcarouter" ProviderOVHcloud Provider = "ovhcloud" ProviderPendra Provider = "pendra" ProviderPerplexity Provider = "perplexity" ProviderPerplexityAgent Provider = "perplexity-agent" ProviderPioneer Provider = "pioneer" ProviderPoe Provider = "poe" ProviderPoolside Provider = "poolside" ProviderPrivatemodeAI Provider = "privatemode-ai" ProviderQiHangAI Provider = "qihang-ai" ProviderQiniuAI Provider = "qiniu-ai" ProviderQVAC Provider = "qvac" ProviderRegoloAI Provider = "regolo-ai" ProviderRequesty Provider = "requesty" ProviderRoutingRun Provider = "routing-run" ProviderRunInfra Provider = "runinfra" ProviderSakana Provider = "sakana" ProviderSaladCloud Provider = "salad-cloud" ProviderSAPAICore Provider = "sap-ai-core" ProviderSarvam Provider = "sarvam" ProviderScaleway Provider = "scaleway" ProviderSCNetTokenPlan Provider = "scnet-token-plan" ProviderScxAI Provider = "scx-ai" ProviderSiliconFlow Provider = "siliconflow" ProviderSiliconFlowCN Provider = "siliconflow-cn" ProviderSnowflakeCortex Provider = "snowflake-cortex" ProviderSTACKIT Provider = "stackit" ProviderStandardcompute Provider = "standardcompute" ProviderStepFun Provider = "stepfun" ProviderStepFunAI Provider = "stepfun-ai" ProviderStepFunAIStepPlan Provider = "stepfun-ai-step-plan" ProviderStepFunStepPlan Provider = "stepfun-step-plan" ProviderSubconscious Provider = "subconscious" ProviderSubmodel Provider = "submodel" ProviderSynthetic Provider = "synthetic" ProviderTencentCodingPlan Provider = "tencent-coding-plan" ProviderTencentTokenPlan Provider = "tencent-token-plan" ProviderTencentTokenHub Provider = "tencent-tokenhub" ProviderTensorX Provider = "tensorx" ProviderTheGridAI Provider = "the-grid-ai" ProviderThinkingmachines Provider = "thinkingmachines" ProviderTinfoil Provider = "tinfoil" ProviderTogetherAI Provider = "togetherai" ProviderTokenGo Provider = "tokengo" ProviderTrustedRouter Provider = "trustedrouter" ProviderUmansAI Provider = "umans-ai" ProviderUmansAICodingPlan Provider = "umans-ai-coding-plan" ProviderUnoRouter Provider = "unorouter" ProviderUpstage Provider = "upstage" ProviderV0 Provider = "v0" ProviderVenice Provider = "venice" ProviderVercel Provider = "vercel" ProviderVivgrid Provider = "vivgrid" ProviderVolcengine Provider = "volcengine" ProviderVultr Provider = "vultr" ProviderWaferAI Provider = "wafer.ai" ProviderWandb Provider = "wandb" ProviderWatsonx Provider = "watsonx" ProviderxAI Provider = "xai" ProviderXiaomi Provider = "xiaomi" ProviderXiaomiTokenPlanAMS Provider = "xiaomi-token-plan-ams" ProviderXiaomiTokenPlanCN Provider = "xiaomi-token-plan-cn" ProviderXiaomiTokenPlanSGP Provider = "xiaomi-token-plan-sgp" ProviderXpersona Provider = "xpersona" ProviderZai Provider = "zai" ProviderZaiCodingPlan Provider = "zai-coding-plan" ProviderZeldoc Provider = "zeldoc" ProviderZenifra Provider = "zenifra" ProviderZenMux Provider = "zenmux" ProviderZhipuai Provider = "zhipuai" ProviderZhipuaiCodingPlan Provider = "zhipuai-coding-plan" )
const ProviderLocal Provider = "local"
ProviderLocal is a bestiary-specific provider for locally-hosted models. It is not derived from the models.dev API and is always included in knownProviders (generated in providers_gen.go, appended last).
func Providers ¶
func Providers() []Provider
Providers returns all known Provider values as a defensive copy. The returned slice includes all API-derived providers plus ProviderLocal. Modifying the returned slice does not affect the package state.
func ProvidersForFamily ¶
ProvidersForFamily returns the set of providers that host models with the given raw API family string (e.g., "claude-opus", "gemini-flash"). The family parameter matches the RawFamily field (verbatim API value). The returned slice contains no duplicates. If no models match, a nil slice is returned.
func ProvidersOf ¶ added in v0.2.7
ProvidersOf returns the distinct providers that serve the entity identified by ref, sorted ascending by provider string. It is the API-level replacement for the provider-flavored Model__ constants removed in the entity-constants hard cut: rather than one constant per (entity, provider) pair, an entity has a single Entity__ constant and its serving providers are queried here.
The lookup keys off ref.String() (the canonical entity key), so the ref need only carry the identity tuple; the returned slice is a fresh copy the caller may mutate. An entity absent from the static registry yields nil (no error — a ref for an unknown entity simply has no providers), so a caller distinguishes "unknown entity" from "known entity, no providers" by the entity's presence elsewhere, not by this result.
func ProvidersOfModel ¶ added in v0.2.7
ProvidersOfModel returns the distinct providers that serve the entity the given model ID belongs to, sorted ascending. It is the instance-level convenience over ProvidersOf: it resolves the model to its entity identity (the same identity-class projection the registry index uses) and delegates. An ID absent from the static registry yields nil.
Note a single raw ID can be served by several providers under one entity; this returns ALL of that entity's providers, not only the first-matched instance's.
func (Provider) IsKnown ¶
IsKnown reports whether p is a recognized Provider. The known set is generated from the models.dev API at codegen time and includes ProviderLocal as the final entry.
func (Provider) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Provider) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It accepts any string value; use IsKnown() to validate.
type ProviderInstance ¶ added in v0.2.3
type ProviderInstance struct {
ID ModelID
Provider Provider
Host Host
// Region is the serving jurisdiction of this instance (AWS Bedrock cross-region
// inference profile), projected from ModelInfo.Region at registry roll-up. Like
// Host it is a per-instance attribute, never part of identity; RegionNone when
// the ID carries no region prefix (renders "unspecified"). RegionRaw carries the
// verbatim token only for the fail-safe RegionOther.
Region Region
RegionRaw string
CostInputPerMTok *float64 // nil when unknown
CostOutputPerMTok *float64 // nil when unknown
ContextWindow int
MaxOutput int
// QuantVRAM is the per-quantization weight and VRAM footprint for this
// instance. nil when no quantization data is available for this row.
QuantVRAM []QuantVRAM
// Source is the data source that provided this row. DataSourceNone (zero
// value, empty string) when no source is recorded.
Source DataSourceID
}
ProviderInstance is a single concrete offering of an entity: one (provider, host) serving of the model, with its instance-specific pricing and limits. Many ProviderInstances roll up into one Entity. The fields here are exactly the per-instance ATTRIBUTES — they vary across instances of the same entity and so are excluded from EntityRef.
type QuantVRAM ¶ added in v0.2.4
type QuantVRAM struct {
// Quant is the parsed quantization type.
Quant Quantization
// QuantRaw is the verbatim quant token from the source data, preserving the
// original casing exactly as it appeared (e.g. "Q4_K_M" from an Ollama
// file_type field, or "q4_k_m" as written in a curated JSON file). It is
// populated for every row — not only when Quant is QuantizationOther —
// so callers can use it for lossless display or round-trip fidelity without
// a separate round-trip through Quant.String().
QuantRaw string
// WeightsBytes is the ingested GGUF file size in bytes — the ground-truth
// weights footprint for this quantization variant. It is ALWAYS a measurement
// and is NEVER derived from bits-per-weight arithmetic; nothing writes a
// computed estimate here.
//
// A separately-typed DERIVED projection does exist for entities that carry an
// attested total parameter count but no ingested file size: see WeightsBasis and
// DerivedWeightsBytes in fit.go. That projection is computed at display time,
// carries BasisDerived, is qualified as a weights-only lower bound, and is never
// written into this field or into VRAMBytes. This paragraph is the amendment
// that keeps the sentence above true: the invariant is about what is STORED, not
// about what may ever be computed from a parameter count.
WeightsBytes int64
// VRAMBytes is weights + KV-cache at VRAMContextTokens; equals WeightsBytes
// when VRAMEstimatePartial is true.
VRAMBytes int64
// VRAMContextTokens is the context window (tokens) used to compute VRAMBytes.
VRAMContextTokens int
// Layers is the number of transformer layers; 0 when unknown.
Layers int
// KVHeads is the number of KV-attention heads (GQA-aware); 0 when unknown.
KVHeads int
// HeadDim is the embedding width per attention head (elements per head); 0 when unknown.
HeadDim int
// VRAMEstimatePartial is true when the KV-cache term was omitted from
// VRAMBytes because at least one of Layers, KVHeads, or HeadDim is zero.
// Callers must check this flag before treating VRAMBytes as a full estimate.
VRAMEstimatePartial bool
// OCIDigest is the "sha256:<hex>" content-addressed manifest digest of this
// quantization's Ollama-registry artifact — the value that makes a `pkg:oci`
// purl (OCIPurl) uniquely identify the artifact. "" when absent (the digest is a
// FETCH-OWNED field, captured by the offline cmd/bestiary-ollama refresh; it is
// empty for every curated row until the next deliberate refresh harvests it).
OCIDigest string
}
QuantVRAM captures the per-quantization weight and VRAM footprint for a single quantization variant of a model.
Field semantics:
- Quant is the parsed quantization constant; QuantRaw is the verbatim token from the source data, always populated for every row (preserves original casing, e.g. "Q4_K_M" from Ollama's file_type field).
- WeightsBytes is the ground-truth ingested GGUF file size in bytes. It is the primary measurement and is always sourced from the downloaded file, not derived from bits-per-weight.
- VRAMBytes is the estimated total VRAM requirement: WeightsBytes plus the KV-cache at VRAMContextTokens (the model's maximum context window). When arch-facts are absent (Layers/KVHeads/HeadDim all zero), VRAMBytes equals WeightsBytes and VRAMEstimatePartial is set true.
- VRAMContextTokens is the context-window size (tokens) used to compute the KV-cache term. It is the model-max context, not a user-chosen value.
- Layers, KVHeads, HeadDim are the architectural parameters used for the KV-cache computation. HeadDim is the embedding width per attention head (elements per head). Zero when the source did not supply them.
- VRAMEstimatePartial is true when the KV-cache term was excluded from VRAMBytes because one or more of Layers/KVHeads/HeadDim is zero. A true value means VRAMBytes is a weights-only lower bound, never a silent under-estimate.
Zero values mean unknown: int64 0 = unknown bytes, int 0 = unknown count. nil QuantVRAM slice on a ProviderInstance or ModelInfo means no quant data is available for that row.
func QuantVRAMFor ¶ added in v0.2.4
QuantVRAMFor returns the curated per-quantization weight-and-arch rows for the model identified by id, or nil when no curated rows exist for it. Matching is case-insensitive against the model_id keys in parse/data/quant_vram.json.
The returned rows have Quant/QuantRaw/WeightsBytes/Layers/KVHeads/HeadDim populated from the file. VRAMBytes, VRAMContextTokens, and VRAMEstimatePartial are always zero — they are computed and baked by the codegen caller (cmd/bestiary-gen) using EstimateVRAMBytes at the model's max context window. Callers must not treat a zero VRAMBytes as meaning "no VRAM data"; it means "not yet computed by codegen". Use WeightsBytes as the weights footprint.
On file or parse failure the function degrades gracefully: it returns nil without panicking. ValidateQuantVRAMTable returns the load error so codegen can abort on bad curation.
func (QuantVRAM) EstimateVRAM ¶ added in v0.2.4
EstimateVRAM recomputes the total VRAM estimate from the arch-facts stored in the QuantVRAM row at a caller-supplied context length.
This is a pure recompute: it calls EstimateVRAMBytes(q.WeightsBytes, contextTokens, q.Layers, q.KVHeads, q.HeadDim) with no additional state. It does NOT read or modify q.VRAMBytes, q.VRAMContextTokens, or q.VRAMEstimatePartial — those fields capture the baked-at-model-max snapshot; this method is for runtime recomputation at a different context length.
func (QuantVRAM) OCIPurl ¶ added in v0.2.8
OCIPurl renders this quantization's purl-spec `pkg:oci` package URL, passing the row's own OCIDigest as the content-addressed version. It returns "" when OCIDigest is empty — an OCI purl is never minted without a digest (the digest is what makes it identify an artifact). name is the repository name (the last fragment is lowercased per spec); tag and registry become the optional repository_url/tag qualifiers when non-empty. See formatOCIPurl (oci.go) for the full render contract.
type Quantization ¶ added in v0.2.4
type Quantization int
Quantization identifies the numeric format / compression scheme applied to a model's weights. It is a closed int enum (like DerivationKind) because the set of formats served by Ollama + the reserved HF-ecosystem formats is small and well-understood. An open-ended passthrough is provided via QuantizationOther (+ a raw string carried on the instance) so that unknown tokens in ingested data are never silently dropped.
The zero value is QuantizationNone (format not specified / unknown).
Wire names are lowercase ASCII strings matching the llama.cpp / Ollama file_type field values (e.g. "q4_k_m", "f16"). MarshalText / UnmarshalText implement encoding.TextMarshaler / encoding.TextUnmarshaler for JSON and YAML round-trips.
const ( // QuantizationNone is the zero value: no quantization format specified. QuantizationNone Quantization = iota // QuantF16: 16-bit IEEE float (half precision). QuantF16 // QuantBF16: 16-bit bfloat (brain float). QuantBF16 // QuantF32: 32-bit IEEE float (single precision). QuantF32 // QuantQ4_0: legacy 4-bit block quant, scheme 0. QuantQ4_0 // QuantQ4_1: legacy 4-bit block quant, scheme 1. QuantQ4_1 // QuantQ5_0: legacy 5-bit block quant, scheme 0. QuantQ5_0 // QuantQ5_1: legacy 5-bit block quant, scheme 1. QuantQ5_1 // QuantQ8_0: legacy 8-bit block quant, scheme 0. QuantQ8_0 // QuantQ2_K: 2-bit k-quant. QuantQ2_K // QuantQ2_K_S: 2-bit k-quant, small super-block. QuantQ2_K_S // QuantQ3_K_S: 3-bit k-quant, small super-block. QuantQ3_K_S // QuantQ3_K_M: 3-bit k-quant, medium super-block. QuantQ3_K_M // QuantQ3_K_L: 3-bit k-quant, large super-block. QuantQ3_K_L // QuantQ4_K_S: 4-bit k-quant, small super-block. QuantQ4_K_S // QuantQ4_K_M: 4-bit k-quant, medium super-block (most popular). QuantQ4_K_M // QuantQ5_K_S: 5-bit k-quant, small super-block. QuantQ5_K_S // QuantQ5_K_M: 5-bit k-quant, medium super-block. QuantQ5_K_M // QuantQ6_K: 6-bit k-quant. QuantQ6_K // QuantIQ1_S: 1-bit i-quant, small. QuantIQ1_S // QuantIQ1_M: 1-bit i-quant, medium. QuantIQ1_M // QuantIQ2_XXS: 2-bit i-quant, extra-extra-small. QuantIQ2_XXS // QuantIQ2_XS: 2-bit i-quant, extra-small. QuantIQ2_XS // QuantIQ2_S: 2-bit i-quant, small. QuantIQ2_S // QuantIQ2_M: 2-bit i-quant, medium. QuantIQ2_M // QuantIQ3_XXS: 3-bit i-quant, extra-extra-small. QuantIQ3_XXS // QuantIQ3_XS: 3-bit i-quant, extra-small. QuantIQ3_XS // QuantIQ3_S: 3-bit i-quant, small. QuantIQ3_S // QuantIQ3_M: 3-bit i-quant, medium. QuantIQ3_M // QuantIQ4_XS: 4-bit i-quant, extra-small. QuantIQ4_XS // QuantIQ4_NL: 4-bit i-quant, non-linear (nearest-lookup). QuantIQ4_NL // QuantAWQ: Activation-aware Weight Quantization (HF/vLLM, 4-bit). QuantAWQ // QuantGPTQ: GPTQ post-training quantization (HF/AutoGPTQ, 3/4/8-bit). QuantGPTQ // QuantInt8: bitsandbytes 8-bit integer (HF transformers). QuantInt8 // QuantInt4: bitsandbytes 4-bit integer (HF transformers). QuantInt4 // QuantizationOther is the lossless escape for any token that is present // in ingested data but not yet covered by the named constants above. The // caller stores the raw string on the enclosing struct (e.g. QuantVRAM.QuantRaw). // ParseQuantization never silently maps an unrecognised token to this value; // DetectQuantization uses it for unrecognised tags found in model IDs. QuantizationOther )
func ParseQuantization ¶ added in v0.2.4
func ParseQuantization(s string) (Quantization, error)
ParseQuantization parses a Quantization from a string using a case-insensitive exact match against the canonical wire names. It is intended for CLI flag parsing and configuration input.
- "" returns (QuantizationNone, nil) — the empty string is treated as "not specified" without error.
- A recognised name (e.g. "Q4_K_M", "f16") returns the corresponding constant and nil.
- Any other non-empty string returns (QuantizationNone, error) with an actionable message that lists what was received and valid examples. Unlike DetectQuantization, ParseQuantization NEVER silently maps an unrecognised token to QuantizationOther.
func (Quantization) BitsPerWeight ¶ added in v0.2.4
func (q Quantization) BitsPerWeight() float64
BitsPerWeight returns the authoritative bits-per-weight for this quantization as documented in the llama.cpp quantize README (tools/quantize/README.md). Returns 0 for QuantizationNone, QuantizationOther, and the reserved HF-ecosystem constants (QuantAWQ, QuantGPTQ, QuantInt8, QuantInt4) whose effective bpw is configuration-dependent and not yet ingested.
This value never feeds a BAKED figure: QuantVRAM.WeightsBytes and VRAMBytes are always ingested measurements. It DOES feed the display-time derived weights projection (DerivedWeightsBytes in fit.go), which is why the zero return is load-bearing rather than merely informational: all six zero-valued members are refused a derived figure outright, because a zero-byte estimate would read as fitting any budget. The amendment is stated here rather than left implicit, since this doc comment previously described the value as a sanity check alone.
func (Quantization) IsKnown ¶ added in v0.2.4
func (q Quantization) IsKnown() bool
IsKnown reports whether q is a named constant in this package (i.e. not an out-of-range integer). QuantizationOther is considered known (it is a named member of the enum); only truly out-of-range integers return false.
func (Quantization) MarshalText ¶ added in v0.2.4
func (q Quantization) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler, emitting the canonical lowercase wire name so Quantization serializes as a JSON/YAML string rather than an integer. An out-of-range value is a programming error and returns an actionable error.
func (Quantization) String ¶ added in v0.2.4
func (q Quantization) String() string
String returns the canonical lowercase wire name of the quantization (e.g. "q4_k_m", "f16"). An out-of-range value renders as "quantization(<n>)" so that log messages never silently drop unexpected values.
func (*Quantization) UnmarshalText ¶ added in v0.2.4
func (q *Quantization) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, parsing a canonical lowercase wire name back into a Quantization. Parsing is case-insensitive so that Ollama's mixed-case file_type values (e.g. "Q4_K_M", "F16") round-trip correctly. Aliases such as "fp16" are NOT accepted; ingest layers must normalise fp16→f16 before unmarshalling (see TestDetectQuantization_FP16Alias). An unrecognised token yields an actionable error listing valid examples.
type ReasoningOption ¶ added in v0.2.5
type ReasoningOption struct {
// Kind discriminates which of the payload fields below are meaningful.
Kind ReasoningOptionKind
// KindRaw carries the verbatim upstream kind token, populated only when Kind
// is ReasoningOptionOther (an unrecognized tag); empty otherwise.
KindRaw string
// Values holds the discrete choices for a ReasoningEffort option; nil otherwise.
Values []string
// MinTokens is the lower budget bound for a ReasoningBudgetTokens option; 0 otherwise.
MinTokens int
// MaxTokens is the upper budget bound for a ReasoningBudgetTokens option; 0 otherwise.
MaxTokens int
}
ReasoningOption is one reasoning-control option a model exposes, as a strongly-typed discriminated union keyed by Kind. Only the fields relevant to Kind carry data: ReasoningEffort populates Values; ReasoningBudgetTokens populates MinTokens / MaxTokens; ReasoningToggle carries neither.
type ReasoningOptionKind ¶ added in v0.2.5
type ReasoningOptionKind int
ReasoningOptionKind discriminates the kind of a reasoning-control option an upstream model exposes. It is a closed int enum.
The zero value is ReasoningOptionOther: on this ELEMENT type the upstream discriminating tag is always present, so a zero value can only mean "the tag was unrecognized". The fail-safe bucket therefore sits at the zero value (the raw token is carried on ReasoningOption.KindRaw), the Other-at-zero convention shared with LinkType and deliberately distinct from ModelStatus; see the file-level comment.
const ( // ReasoningOptionOther is the zero value and fail-safe: an unrecognized // reasoning-option kind. The raw token is carried on ReasoningOption.KindRaw. ReasoningOptionOther ReasoningOptionKind = iota // ReasoningToggle: a plain on/off reasoning switch. ReasoningToggle // ReasoningEffort: a discrete effort selector; the choices are on Values. ReasoningEffort // ReasoningBudgetTokens: a token-budget control; the bounds are on // MinTokens / MaxTokens. ReasoningBudgetTokens )
func (ReasoningOptionKind) IsKnown ¶ added in v0.2.5
func (k ReasoningOptionKind) IsKnown() bool
IsKnown reports whether k is a named constant in this package. ReasoningOptionOther is considered known; only out-of-range integers return false.
func (ReasoningOptionKind) MarshalText ¶ added in v0.2.5
func (k ReasoningOptionKind) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler, emitting the canonical wire name (so ReasoningOptionKind serializes as a JSON string, not an integer). An out-of-range value is a programming error and yields an actionable error.
func (ReasoningOptionKind) String ¶ added in v0.2.5
func (k ReasoningOptionKind) String() string
String returns the canonical lowercase wire name of the kind. An out-of-range value renders as "reasoningoptionkind(<n>)" so logs never silently drop an unexpected value.
func (*ReasoningOptionKind) UnmarshalText ¶ added in v0.2.5
func (k *ReasoningOptionKind) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, parsing a canonical wire name back into a ReasoningOptionKind. Parsing is case-insensitive. An unrecognized token yields an actionable error.
type Region ¶ added in v0.2.7
type Region int
Region is the serving JURISDICTION of a model instance: the AWS Bedrock cross-region inference-profile region encoded in a dotted "<region>.<vendor>." model-ID prefix (us.*, eu.*, au.*, jp.*, global.*). The axis exists for international data-protection relevance — Australia's Privacy Act and Japan's APPI are DISTINCT jurisdictions, so au and jp are distinct members (never folded into a single Asia-Pacific bucket).
Like Host, a Region is a per-instance ATTRIBUTE and is NEVER part of entity identity — it is excluded from EntityRef and from all key rendering, because the same artifact served in two regions is one entity, not two. It is a CLOSED int enum (the Quantization / DerivationKind precedent) with a RegionRaw carrier for the fail-safe RegionOther bucket: a recognized-but-unmapped region token is never dropped, it rides along on RegionRaw (the Quantization/QuantRaw precedent).
ISO grounding: the member String() values follow ISO 3166-1 alpha-2 where applicable — "us", "au", "jp" are country codes and "eu" is the ISO exceptionally-reserved code for the European Union; "apac" and "global" are provider-defined scopes OUTSIDE ISO. A future ISO-alpha-2 Bedrock prefix earns its own member; anything unrecognized falls to RegionOther + RegionRaw. RegionNone is the zero value (no prefix) and renders "unspecified" (not "") for external-reader clarity.
const ( // RegionNone is the zero value: the model ID carries no Bedrock region prefix. // It renders as "unspecified" so an external reader is never shown a blank. RegionNone Region = iota // RegionUS is the AWS "us" cross-region inference profile (ISO 3166-1 alpha-2 US). RegionUS // RegionEU is the AWS "eu" cross-region inference profile (ISO exceptionally-reserved EU). RegionEU // RegionAPAC is the AWS "apac" cross-region scope (provider-defined, outside ISO). // RESERVED: Bedrock documents an "apac." profile prefix, but there are zero attested // instances in the current catalog — au and jp are their OWN members, never mapped here. RegionAPAC // RegionGlobal is the AWS "global" cross-region scope (provider-defined, outside ISO). RegionGlobal // RegionAU is the AWS "au" cross-region inference profile (ISO 3166-1 alpha-2 AU, // Australia — a distinct data-protection jurisdiction, the Privacy Act). RegionAU // RegionJP is the AWS "jp" cross-region inference profile (ISO 3166-1 alpha-2 JP, // Japan — a distinct data-protection jurisdiction, the APPI). RegionJP // RegionOther is the fail-safe bucket: a Bedrock region token that is recognized // as a region but not mapped to a named member. The raw token rides on RegionRaw // so it is never lost. RegionOther )
func DetectRegion ¶ added in v0.2.7
DetectRegion inspects a model ID for an AWS Bedrock cross-region inference-profile "<region>.<vendor>." prefix and returns the Region plus the raw region token. The raw is non-empty ONLY for the fail-safe RegionOther (a gated-but-unnamed region token, carried so it is never dropped); for a named member and for RegionNone the raw is "". An ID with no Bedrock prefix returns (RegionNone, "").
It mirrors DetectHost's DETECTION pattern (the Region is decided from the ID prefix alone, a per-instance attribute), but its second return is the RegionRaw carrier rather than a stripped ID: the region+profile-suffix strip that makes the (Family,Variant,Version) tuple region-independent is owned by stripBedrockProfile (via stripVendorNamespace), so a caller building an instance record populates (Region, RegionRaw) here and gets the plain model id from the decomposition path.
func ParseRegion ¶ added in v0.2.7
ParseRegion is the inverse of String for the named members: it maps a canonical token back to its Region. "unspecified" and "" both round-trip to RegionNone (the two spellings of absence). An unknown non-empty token is an actionable error rather than a silent RegionOther (the ParseQuantization precedent: the CLI/parse path must guide the caller, never swallow a typo). RegionOther is reached only through DetectRegion's carrier path, never minted from a bare token here.
func (Region) MarshalText ¶ added in v0.2.7
MarshalText implements encoding.TextMarshaler so a Region serializes as its canonical lowercase token in JSON/YAML (the ModelStatus precedent), NOT as its underlying int. RegionNone emits "unspecified" and RegionOther emits "other"; every other member emits its ISO/scope token. It never errors: String covers every value including out-of-range (degrades to "unspecified").
func (Region) String ¶ added in v0.2.7
String renders the Region as a stable lowercase token. RegionNone renders "unspecified" (a user ruling for external-reader clarity — never the empty string); the concrete regions render their canonical ISO/scope token; RegionOther renders "other" (the discriminating raw token lives on RegionRaw, not here).
func (*Region) UnmarshalText ¶ added in v0.2.7
UnmarshalText implements encoding.TextUnmarshaler, the inverse of MarshalText. It accepts every String() token — including "other" (→ RegionOther) and the two spellings of absence ("unspecified"/"" → RegionNone) — so a marshaled Region round-trips totally through JSON. This is DELIBERATELY more permissive than the CLI-facing ParseRegion (which rejects "other" to force an actionable typo error): deserialization must accept anything the serializer can emit, while the parse path guides a human toward the closed set.
type Release ¶ added in v0.2.7
Release is a named member of a Series: llama-4's scout and maverick, gemini-3.0's flash and pro. It is COMPUTED from the entity's Variant — never stored, never part of any key.
Name is EMPTY for the bare line (an entity with no variant, e.g. deepseek@3.2). The empty Release is a real Release — the un-named member of the line — not a missing one, so it is returned by ReleasesOf alongside the named members.
func ReleaseOf ¶ added in v0.2.7
ReleaseOf returns the Release the given entity ref belongs to: the entity's variant as a named member of its Series (Name is empty for the bare line), or the curated release when the family is a curated stray. Like SeriesOf it is computed and never affects identity.
func ReleasesOf ¶ added in v0.2.7
ReleasesOf returns the Releases of the given Series — its named members (llama-4's scout and maverick; gemini-3.0's flash, flash-lite and pro) plus the un-named bare-line release when the line has entities with no variant — sorted ascending by release name (the empty name sorts first).
A Series with no entities in the static registry yields nil (no error — an unknown line simply has no releases), so a caller distinguishes "unknown line" from "known line, no releases" by the line's presence in SeriesAll, not by this result. The returned slice is a fresh copy.
type ReleaseGroup ¶ added in v0.2.10
ReleaseGroup is one NAMED release and its entities, ascending by canonical key. The un-named release never appears here; it is hoisted onto its SeriesGroup.
type ReleaseStage ¶ added in v0.2.6
type ReleaseStage int
ReleaseStage classifies the release stage a model instance advertises IN ITS ID (preview / beta / latest / …). It is a closed int enum, following the DerivationKind / Quantization / ModelStatus precedent: the set of stage tokens is small and well-understood, so a closed enum gives type safety at call sites without a stringly-typed axis.
ReleaseStage is DELIBERATELY separate from ModelStatus even though the two overlap on tokens like "beta". They are two different provenance levels:
- ModelStatus is upstream-DECLARED lifecycle metadata (the api.json `status` field): the provider tells us "this is beta".
- ReleaseStage is ID-token-DERIVED (an instance fact read out of the model ID by DetectStageFromID): bestiary infers "this ID carries a `-beta` marker".
A model can carry one, both, or neither. `show` renders them under distinct labels ("stage" vs "status") so the two provenance levels never blur together.
The zero value is StageNone: on this SCALAR field absence is meaningful — a model whose ID carries no stage marker is a normal, generally-available release — so None sits at zero. This None-at-zero convention matches ModelStatus (a scalar where absence carries information) and deliberately differs from the Other-at-zero convention on the models.dev element enums (LinkType, ReasoningOptionKind), whose every element always arrives with a discriminating tag.
Wire names are lowercase ASCII strings; MarshalText / UnmarshalText implement encoding.TextMarshaler / encoding.TextUnmarshaler so a ReleaseStage serializes as a JSON/YAML string rather than an integer.
const ( // StageNone is the zero value: the ID carries no recognized stage marker // (a normal, generally-available release). StageNone ReleaseStage = iota // StageStable: an explicitly stable/GA release. Enum member exists for CLI // and parse completeness; "stable" is NOT ID-detected this epoch (a bare // "stable" token in an ID is far more often a family name — see the // stable-diffusion guard in DetectReleaseStage — so detecting it would be // unsafe). ID-detection of "stable" is deferred (GH#13). StageStable // StagePreview: a preview / early-access release (ID-detected). StagePreview // StageBeta: a beta release (ID-detected). Detected without stripping — the // `beta` token stays in the ID's decomposition (it is entity-key material for // some families today, e.g. grok-4.20-beta-*), and re-keying it is deferred. StageBeta // StageAlpha: an early, unstable alpha release. Enum member exists for CLI // and parse completeness; "alpha" is NOT ID-detected this epoch (deferred, // GH#13). StageAlpha // StageExperimental: an experimental release. Enum member exists for CLI and // parse completeness; neither "experimental" nor its "-exp" short form is // ID-detected this epoch (deferred, GH#13). StageExperimental // StageLatest: a rolling "latest" alias (ID-detected). NOTE: "latest" (like // "original") NAMES A MOVING TARGET, not a fixed property of one artifact — // the model an id like "…-latest" resolves to changes over time. It is // recorded as a stage so the alias is visible, not because the artifact is // intrinsically "latest". StageLatest // StageOriginal: a rolling "original" alias (ID-detected). Like StageLatest, // this NAMES A MOVING TARGET (the pinned-original counterpart of a rolling // alias), not a fixed artifact property. StageOriginal // StageOther is the RESERVED fail-safe bucket for a stage token that is // present but not covered by the named constants above. Following the // Quantization / ModelStatus reserved-member precedent, it exists so the wire // format is stable when a FUTURE non-ID stage feeder lands (e.g. a metadata // field). It is UNUSED by the ID-detection path this epoch: DetectReleaseStage // returns known members only and NEVER StageOther, and ParseReleaseStage // rejects it as an internal sentinel. Its verbatim companion is StageRaw on // ModelInfo (populated only when Stage is StageOther, mirroring StatusRaw). StageOther )
func DetectReleaseStage ¶ added in v0.2.6
func DetectReleaseStage(tok string) (ReleaseStage, bool)
DetectReleaseStage reports the ReleaseStage a single, standalone ID token denotes and whether it is a recognized ID-detected stage. It is the ID-detection primitive (the analogue of detectModelStatus, but exported because the enrichment and codegen both consume it):
- a recognized token (preview / beta / latest / original) → (its constant, true);
- any other token, including "stable" / "alpha" / "experimental" / "exp" whose ID-detection is deferred this epoch → (StageNone, false).
It is known-members-only: it NEVER returns StageOther (that reserved bucket is for a future non-ID feeder, not the ID path — returning it here would fabricate an unreachable state). It matches STANDALONE tokens only (exact, case-insensitive; no substring matching) and is family-member-guarded by construction: "stable" is not in the detected set, so "stable-diffusion" — whether passed whole or tokenized to "stable" + "diffusion" — can never resolve to a stage.
func DetectStageFromID ¶ added in v0.2.6
func DetectStageFromID(id ModelID) (ReleaseStage, string)
DetectStageFromID scans a model ID for a recognized release-stage marker and returns (stage, raw) — mirroring detectModelStatus's return contract:
- a recognized standalone stage token → (its constant, "");
- no recognized token → (StageNone, "").
The second return is the verbatim-token slot reserved for the StageOther path (populated only when a future non-ID feeder produces StageOther); the ID path never yields StageOther, so it is always "" this epoch — the caller assigns it to ModelInfo.StageRaw, which therefore mirrors StatusRaw (non-empty only for the Other bucket).
It is a PURE function of the ID and the embedded stage table, so it is applied identically at every enrichment joint (codegen bake, wire decode, store read) — the same ID always yields the same stage, so a live-sync row and its baked static row never disagree. Any provider/path prefix is dropped (up to the last "/") before tokenizing so a path segment can never masquerade as a stage; the remaining name is split on every non-alphanumeric byte and each token is checked via DetectReleaseStage (exact, standalone). The FIRST recognized token (scanning left to right) wins — catalog IDs carry at most one stage marker, so the tie-break is documentation, not a real ambiguity.
func ParseReleaseStage ¶ added in v0.2.6
func ParseReleaseStage(s string) (ReleaseStage, error)
ParseReleaseStage parses a ReleaseStage from a string using a case-insensitive exact match against the canonical wire names. It is the CLI / configuration path (the analogue of ParseModelStatus / ParseQuantization): the empty string returns StageNone with no error, a recognized name returns its constant, and any other non-empty string returns an actionable error naming what was received and the valid values. It rejects the internal "other" sentinel (StageOther is not a user-selectable stage) and never silently buckets an unknown token.
NOTE: there is intentionally NO CLI caller for ParseReleaseStage this epoch (`list` gains no stage filter — that is deferred). It is the public parse half of the stage axis, defined now per the final-interface principle (define the API you know the axis needs) rather than added later; it is NOT dead code and must not be removed as such.
func (ReleaseStage) IsKnown ¶ added in v0.2.6
func (s ReleaseStage) IsKnown() bool
IsKnown reports whether s is a named constant in this package (i.e. not an out-of-range integer). StageOther is considered known — it is a named member of the enum; only truly out-of-range integers return false.
func (ReleaseStage) MarshalText ¶ added in v0.2.6
func (s ReleaseStage) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler, emitting the canonical wire name (so ReleaseStage serializes as a JSON string, not an integer). An out-of-range value is a programming error and yields an actionable error.
func (ReleaseStage) String ¶ added in v0.2.6
func (s ReleaseStage) String() string
String returns the canonical lowercase wire name of the stage. An out-of-range value renders as "releasestage(<n>)" so logs never silently drop an unexpected value.
func (*ReleaseStage) UnmarshalText ¶ added in v0.2.6
func (s *ReleaseStage) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler, parsing a canonical wire name back into a ReleaseStage. Parsing is case-insensitive so a mixed-case token round-trips. An unrecognized token yields an actionable error.
type ResolveOption ¶
type ResolveOption func(*resolveConfig)
ResolveOption configures a Resolve call. Options are applied in order; later options override earlier ones.
func WithInputFormat ¶ added in v0.2.0
func WithInputFormat(f InputFormat) ResolveOption
WithInputFormat pins the InputFormat for a Resolve call.
When InputFormatPeasant is specified (the default from the CLI), Resolve dispatches as SchemeCanonical and does NOT auto-detect from the input prefix. A PURL or HuggingFace input passed with InputFormatPeasant will fail to match (ErrNotFound) — this is intentional. Pass the matching --format flag explicitly.
For huggingface/hf, purl, and raw, dispatches directly to the corresponding scheme without auto-detect.
func WithScheme ¶
func WithScheme(s CanonicalScheme) ResolveOption
WithScheme pins the CanonicalScheme for a Resolve call. When not specified, Resolve auto-detects the scheme from the input prefix:
- "pkg:huggingface/<provider>/<id>" → SchemePURL: strip prefix, retain provider hint
- "<word>/<word>" two-segment form (no "pkg:" prefix, no "@" or versioned token) → SchemeHuggingFace: strip provider prefix, match raw ID
- "<family>/<variant>[@date]" or "<provider>/<family>/<variant>[@date]" form → SchemeCanonical
- Otherwise → SchemeRaw (exact model ID lookup)
SchemeCanonical is auto-detected when the input contains 1–3 "/" separators AND at least one of: an "@" date suffix, or a versioned token (e.g. "4.5", "2.5"). Use WithScheme to override auto-detection.
type Series ¶ added in v0.2.7
Series is a versioned model line: one family at one generation (llama-4, gemini-3.0, claude-4.5). It is COMPUTED from an entity's Family plus its identity Version — never stored, never part of any key.
Generation is the identity version verbatim, with one normalization applied: a bare-integer generation "N" folds into "N.0" if and only if the SAME family also spells "N.0", so one line is never split in two by a spelling difference while a family with no dotted sibling (llama-4) keeps its bare generation. Generation is EMPTY for an unversioned line (e.g. the bare "gemma" entities) — an empty generation is a real Series, not a missing one, so it is included in SeriesAll.
func SeriesAll ¶ added in v0.2.7
func SeriesAll() []Series
SeriesAll returns every distinct Series in the static registry — one entry per (family, generation) line — sorted ascending by family, then by generation. Lines with an empty generation (families whose entities carry no identity version) are INCLUDED: an unversioned line is a real line, not a missing one.
The result is COMPUTED from entity key components on first use and memoized (see taxonomy.go); it never affects entity identity. The returned slice is a fresh copy the caller may mutate.
func SeriesOf ¶ added in v0.2.7
SeriesOf returns the Series the given entity ref belongs to: its family at its normalized generation, or the curated target line when the family is a curated stray. The result is COMPUTED — calling it can never change an entity key.
The ref need not exist in the static registry: an unknown ref still computes to the Series it would belong to (a taxonomy is a function of the key components, not of registry membership). Generation normalization is family-scoped and is therefore taken from the registry's spelling set.
func (Series) String ¶ added in v0.2.7
String renders the Series as "family-generation" (llama-4, gemini-3.0), or as the bare family name when the line carries no generation. It is a DISPLAY rendering for humans and CLI output; it is deliberately NOT used as a lookup key (see seriesKey), because a family name may itself contain a dash and therefore the rendering is not injective.
type SeriesGroup ¶ added in v0.2.10
type SeriesGroup struct {
Series Series
// Hoisted are the entities of the line's un-named release, lifted to sit
// directly under the Series. Empty for a named-only line. Ascending by
// canonical entity key.
Hoisted []Entity
// Releases are the line's NAMED releases only, ascending by release name.
Releases []ReleaseGroup
// EntityCount is len(Hoisted) plus every release's entities.
EntityCount int
}
SeriesGroup is one versioned line with the base hoist applied: Hoisted carries the un-named release's entities directly, and Releases carries only genuinely named releases. There is no "(base)" release node — see the package comment above for why.
func SeriesGroups ¶ added in v0.2.10
func SeriesGroups() []SeriesGroup
SeriesGroups returns every Series in the static registry with the base hoist applied, ascending by family then generation — the flat, creator-agnostic view of the same substrate CreatorGroups nests.
Together the groups PARTITION the corpus: every entity in Entities() appears in exactly one group, either hoisted or under exactly one named release. Each returned Entity is a defensive deep copy, as with Entities().
func (SeriesGroup) Shape ¶ added in v0.2.10
func (g SeriesGroup) Shape() SeriesShape
Shape derives how this line should be laid out. It is computed from the group's own contents rather than stored, so it can never disagree with them.
type SeriesShape ¶ added in v0.2.10
type SeriesShape int
SeriesShape classifies a Series by which kinds of release it actually has. It is the one fact a renderer needs in order to lay a series out: a base-only line attaches its entities directly with nothing to disclose, while a mixed line must show its hoisted entities ABOVE its named-release disclosures and visually distinguish the two (they sit at different levels of the hierarchy despite being adjacent on screen).
Following the ModelStatus precedent, the zero value is meaningful: an empty SeriesGroup is SeriesShapeNone (no entities at all), never a silent "named-only". A shape is DERIVED on demand from the group's contents, so it cannot drift out of agreement with them.
const ( // SeriesShapeNone is the zero value: the series holds no entities. The // projection never emits such a group; it is the honest answer for a // hand-constructed or zero-value SeriesGroup. SeriesShapeNone SeriesShape = iota // SeriesShapeBaseOnly is a line whose entities are ALL un-named — there is // nothing to disclose, so a renderer attaches the entities directly. SeriesShapeBaseOnly // SeriesShapeMixed is a line with both hoisted (un-named) entities and named // releases. The hoisted entities render above the release disclosures and // must be visually distinct from them. SeriesShapeMixed // SeriesShapeNamedOnly is a line whose entities all belong to named releases; // there is nothing to hoist. SeriesShapeNamedOnly )
func (SeriesShape) String ¶ added in v0.2.10
func (s SeriesShape) String() string
String renders the shape as a stable lowercase token, for display and for legible test failures.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a SQLite-backed cache for AI model metadata. Use OpenStore to create, and Close when done.
func OpenStore ¶
OpenStore opens (or creates) the SQLite database at path. It applies any pending schema migrations before returning. Caller must call Close when done.
func (*Store) QueryByCanonical ¶
QueryByCanonical returns ModelInfo entries matching the canonical axes in f. Cross-provider results are returned as a slice. Empty fields in f act as wildcards: an empty Family matches any family, an empty Variant matches any variant, and an empty Date matches any date. Returns an empty slice (not an error) when no matching models are found.
The query uses the (family, variant) prefix of idx_canonical for efficient lookup when f.Family is non-empty.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryCreators ¶ added in v0.2.8
QueryCreators reads the persisted v8 creators dimension back as a Family → Creator map. It is the JOIN-queryable, self-describing read of the store's own creator record (the Entity.Sources projection precedent at the dimension level): an external SQL consumer or a downstream read that wants the store's persisted mapping reads it here, distinct from the running binary's Family.Creator projection over the embedded seed. Returns an empty (non-nil) map when the dimension is unpopulated.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryCurrentIngests ¶ added in v0.2.5
func (s *Store) QueryCurrentIngests(ctx context.Context) ([]DatasetIngested, error)
QueryCurrentIngests returns the CURRENT ingest of every source: the row with the maximum ingested_at per data_source_id, sorted ascending by data_source_id. It reads the append-only dataset_ingested history and collapses it to one current row per source (the ingest-log analogue of DatasetIngestedFor's MAX, across all sources at once).
The query relies on SQLite's documented bare-column rule: with a single MAX() aggregate and a GROUP BY, the bare parser_schema column takes its value from the same row that supplied the maximum ingested_at, so the returned parser_schema is the current ingest's, not an arbitrary row's.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryEntityMetadata ¶ added in v0.2.5
func (s *Store) QueryEntityMetadata(ctx context.Context) ([]EntityMetadata, error)
QueryEntityMetadata returns all cached entity metadata with its benchmark and link children reassembled onto each parent. The order is deterministic: parents ascending by metadata_id, and within a parent the children in insertion order (rowid). Enum-typed columns are decoded back from their stored string forms.
The reassembly is three sequential passes (parents, then benchmarks, then links): zombiezen.com/go/sqlite does not permit issuing a new statement while a result cursor is open, so nested per-parent child queries are not possible; the flat child passes are keyed back onto their parent by metadata_id.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryIngestHistory ¶ added in v0.2.5
func (s *Store) QueryIngestHistory(ctx context.Context, id DataSourceID) ([]DatasetIngested, error)
QueryIngestHistory returns every ingest row for a single source, sorted ascending by ingested_at (oldest first). It is the per-source history view behind `sources --history`; an empty slice (not an error) is returned when the source has no ingest rows.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryModel ¶
QueryModel returns the first model found with the given ID, or ErrNotFound if no model with that ID exists in the store. Note: with the composite (model_id, provider) primary key, multiple rows may share the same model_id across different providers. Use QueryModelsByID to retrieve all provider variants for a given model ID.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryModels ¶
QueryModels returns all cached models. If provider is non-empty, results are filtered to only models from that provider. An empty provider string returns ALL models regardless of provider.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryModelsByID ¶
QueryModelsByID returns all cached models with the given ID across all providers. Returns an empty slice (not an error) if none are found.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) QueryNomina ¶ added in v0.2.7
QueryNomina reads every persisted naming row back as []Nomen, sorted deterministically (lessNomen) so a round-trip is order-stable. It LEFT-JOINs the nomen_attestations child rows back into each Nomen's Attestations set (LEFT so a parent with no attestations still yields a Nomen), grouping child rows by the parent triple and sorting each set by the TOTAL lessAttestation key (sortAndDedupAttestations) — so the full per-attestation provenance (SourceURL, ArchivedURL, Source, Authority, Method, IngestedAt) round-trips losslessly, INCLUDING a curated-authored Authority that differs from the scheme/source default (the case the deleted v7 single-attestation bridge could not carry). The ResolvesTo EntityRef is reconstructed by PARSING the stored entity_key back into its tuple (parseEntityKey); scheme/status/authority/method tokens decode via their permissive parsers.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) UpsertCreators ¶ added in v0.2.8
UpsertCreators populates the v8 creators BCNF dimension from the curated creators.json seed (the data_sources dimension-persistence precedent). The seed is the single source of truth for Family → Creator, so each row is an INSERT OR REPLACE keyed by family — a full replace over the seed is correct and idempotent (re-syncing the same seed yields identical rows). Rows are written in family-sorted order so the write is deterministic (INV3). Only families whose creator is non-empty and whose family Family.IsKnown() are written — the same FK-style consistency the datasource guard enforces; an unmapped family is expressed by the ABSENCE of a row (Family.Creator returns CreatorNone), never a row with an empty creator.
The persisted table is the STORE's record of what the syncing binary knew; it is read back by QueryCreators. It is deliberately distinct from the running binary's Family.Creator projection (embedded seed) — see the scanModelInfo skew note.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) UpsertDataSources ¶ added in v0.2.4
func (s *Store) UpsertDataSources(ctx context.Context, sources []DataSource, ingested []DatasetIngested) error
UpsertDataSources writes the data-source dimension rows and appends their ingest rows in a single transaction. Rows are written parents-before-children to satisfy the dataset_ingested.data_source_id foreign key: every DataSource is written first (insert-or-update on the id primary key), then every DatasetIngested. A DatasetIngested whose SourceID names a DataSource absent from BOTH this call and the existing data_sources table is rejected by the foreign key (when foreign_keys is ON).
The ingest pass is APPEND-ONLY: it uses INSERT OR IGNORE against the composite primary key (data_source_id, ingested_at). A new (source, timestamp) appends a history row; an identical (source, timestamp) is the same ingest fact re- asserted, so OR IGNORE keeps the original untouched — it can never MUTATE an existing row (unlike OR REPLACE, which would overwrite parser_schema). The current ingest for a source is the row with the maximum ingested_at, surfaced by QueryCurrentIngests / DatasetIngestedFor.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) UpsertEntityMetadata ¶ added in v0.2.5
func (s *Store) UpsertEntityMetadata(ctx context.Context, rows []EntityMetadata) error
UpsertEntityMetadata writes each EntityMetadata and its benchmark / link children in a single transaction. The children of a metadata_id are a REPLACEABLE SET owned by their parent: per row the method (1) INSERT OR REPLACE the parent entity_metadata row, (2) DELETE the existing metadata_benchmarks and metadata_links for that metadata_id, then (3) INSERT the current children.
This order is foreign-key safe under foreign_keys=ON: INSERT OR REPLACE keeps the same metadata_id, so at the end of that statement any pre-existing children still resolve their parent (the FK is checked at statement end, and a parent with the same key exists). The subsequent delete-then-insert then refreshes the child set. Re-syncing identical metadata is idempotent by CONTENT — the row counts and values are unchanged.
Enum-typed columns persist their STRING forms: a link's type column stores LinkType.String() and type_raw carries the verbatim upstream token (populated only when the type is the other bucket). entity_metadata has no status column (status is not present on the models.json side). The parent's source_id is a foreign key into data_sources, so callers must register the DataSource (via UpsertDataSources) before attaching metadata attributed to it.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) UpsertEntitySources ¶ added in v0.2.4
func (s *Store) UpsertEntitySources(ctx context.Context, sources []EntitySource) error
UpsertEntitySources inserts or replaces the entity↔source join rows in a single transaction. Rows are written parents-before-children to satisfy the entity_source.entity_key foreign key: pass 1 ensures a minimal entities dimension row exists for each distinct EntityKey (INSERT OR IGNORE so a richer pre-existing row is never clobbered; the decomposed columns default to the empty string — the store's entities table is a foreign-key target, not the authoritative entity decomposition, which lives in the generated registry), then pass 2 writes the join rows. The entity_source.data_source_id foreign key is NOT auto-satisfied here: callers must have populated data_sources first via UpsertDataSources, so an EntitySource naming an unknown source is rejected (when foreign_keys is ON).
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) UpsertModels ¶
UpsertModels inserts or replaces the given models in the store. It sets LastSynced to the current UTC time in RFC3339 format for each model. All upserts run inside a single transaction.
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
func (*Store) UpsertNomina ¶ added in v0.2.7
UpsertNomina writes the naming rows into the v8 nomina parent table and their evidence sets into the nomen_attestations child table in a single transaction. Per nomen:
- The parent row is a per-triple IDEMPOTENT insert keyed by the primary key (value, scheme, entity_key): INSERT OR IGNORE, so re-persisting the same triple is a no-op that never MUTATES an existing status (unlike OR REPLACE). A same-triple Status CONFLICT is not reconciled here by last-write-wins — the codegen guard ValidateNomina rejects a conflicting mint before it ever reaches the store, and OR IGNORE keeps the incumbent so a stray duplicate at sync cannot silently overwrite.
- The attestation set is a REPLACEABLE SET owned by the triple (the entity_metadata child-table precedent): the prior nomen_attestations rows for the triple are DELETEd and the current Attestations re-inserted, so a re-sync with a changed evidence set converges by content and re-syncing an identical set is idempotent.
The nomen_attestations.source_id foreign key into data_sources is NOT auto-satisfied: callers must have populated data_sources first (via UpsertDataSources), so an attestation naming an unknown source is rejected when foreign_keys is ON and the whole transaction rolls back (no partial write). entity_key is deliberately NOT an FK (the entities table is a stub dimension; a minted canonical/provider-id nomen may name an entity never written to it).
ctx is accepted for API compatibility; zombiezen.com/go/sqlite does not support per-operation context cancellation.
type SuppressionEntry ¶ added in v0.2.7
type SuppressionEntry struct {
// Entity is the entity whose preferred naming omits the suppressed modifiers. Its
// key (EntityRef.String()) is NOT changed by the policy.
Entity EntityRef
// Suppress holds the redundant identity-modifier tokens, sorted and deduplicated.
Suppress []string
// Reason is the curation rationale for calling the capability innate.
Reason string
// SourceURL is WHO documents the innate capability (claim attribution). May be empty.
SourceURL string
}
SuppressionEntry is one validated seed entry: the entity it applies to, the identity-class modifier tokens declared redundant for it, and the curation provenance. It is exported so the per-entry fence can enumerate the shipped seed and require a literal before/after row for every entry.
func SuppressionSeed ¶ added in v0.2.7
func SuppressionSeed() []SuppressionEntry
SuppressionSeed returns the shipped, validated suppression seed — one entry per entity carrying a redundant modifier — in stable entity-key order. It degrades to an empty slice when the seed is missing or corrupt. The returned slice and its token slices are copies, so a caller cannot mutate the cached table.
type TierCost ¶ added in v0.2.5
type TierCost struct {
// CostInputPerMTok is the input cost in USD per million tokens, or nil when unset.
CostInputPerMTok *float64
// CostOutputPerMTok is the output cost in USD per million tokens, or nil when unset.
CostOutputPerMTok *float64
// CostReasoningPerMTok is the reasoning cost in USD per million tokens, or nil when unset.
CostReasoningPerMTok *float64
// CostCacheReadPerMTok is the cache-read cost in USD per million tokens, or nil when unset.
CostCacheReadPerMTok *float64
// CostCacheWritePerMTok is the cache-write cost in USD per million tokens, or nil when unset.
CostCacheWritePerMTok *float64
// CostInputAudioPerMTok is the audio-input cost in USD per million tokens, or nil when unset.
CostInputAudioPerMTok *float64
// CostOutputAudioPerMTok is the audio-output cost in USD per million tokens, or nil when unset.
CostOutputAudioPerMTok *float64
}
TierCost is one bundle of cost overrides. Every axis is optional: a nil pointer means "not overridden at this tier". The per-million-token costs mirror the flat cost fields on ModelInfo and add audio input/output rates.
type WeightsBasis ¶ added in v0.2.10
type WeightsBasis int
WeightsBasis names WHERE a row's weights figure came from.
BasisMeasured sits at zero deliberately (the enum-zero-is-the-safe-default convention used elsewhere in this package): a QuantVRAM row that was deserialized without ever seeing this type IS a measured, ingested file size, so the zero value tells the truth about existing data.
This enum is the instrument that lets a DERIVED weights figure exist without weakening the ingested one: see the invariant amendment recorded in vram.go and entity.go. A derived figure is never written into QuantVRAM and never feeds VRAMBytes.
const ( // BasisMeasured is the ingested GGUF file size — a ground-truth measurement. BasisMeasured WeightsBasis = iota // BasisDerived is TotalParams x BitsPerWeight(quant) / 8 — an ESTIMATE computed at // display time from an attested total parameter count. It is never a file size and // is never stored. BasisDerived )
func (WeightsBasis) String ¶ added in v0.2.10
func (w WeightsBasis) String() string
String returns a short lowercase label for the basis. An out-of-range value renders as "weightsbasis(<n>)" rather than masquerading as "measured".
Source Files
¶
- bestiary.go
- canonical.go
- client.go
- creator.go
- creator_lab_seed.go
- creatorgroups.go
- datasource.go
- derivation.go
- designation.go
- entities_constants_gen.go
- entity.go
- errors.go
- families_gen.go
- family.go
- fit.go
- format.go
- harness.go
- host.go
- host_detect.go
- huggingface_nomina.go
- id_prefix.go
- iri.go
- lineage.go
- merge.go
- metadata.go
- metadata_join.go
- modality.go
- modelref.go
- models_metadata_gen.go
- models_static_gen.go
- modifier.go
- modifierclass.go
- nomen.go
- nomen_claims.go
- oci.go
- param_size_data.go
- parse.go
- provider.go
- providers_gen.go
- quant_vram_data.go
- quantization.go
- region.go
- registry.go
- resolve.go
- stage.go
- store.go
- suppression.go
- taxonomy.go
- version.go
- vram.go
- wire.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
bestiary
command
|
|
|
bestiary-gen
command
bestiary-gen consumes the models.dev catalog and writes five generated files into the bestiary package root:
|
bestiary-gen consumes the models.dev catalog and writes five generated files into the bestiary package root: |
|
bestiary-hf
command
Command bestiary-hf is the OFFLINE, network-gated HuggingFace Hub refresh tool.
|
Command bestiary-hf is the OFFLINE, network-gated HuggingFace Hub refresh tool. |
|
bestiary-ollama
command
Command bestiary-ollama is the OFFLINE, network-gated Ollama refresh tool.
|
Command bestiary-ollama is the OFFLINE, network-gated Ollama refresh tool. |
|
bestiary-web
command
Command bestiary-web serves an OFFLINE, read-only web view of the bestiary catalog.
|
Command bestiary-web serves an OFFLINE, read-only web view of the bestiary catalog. |
|
internal
|
|
|
politebot
Package politebot is the shared, compiler-private polite-HTTP plumbing for the offline registry-ingest tools.
|
Package politebot is the shared, compiler-private polite-HTTP plumbing for the offline registry-ingest tools. |
|
Package testcase is the pure-data foundation for bestiary's canonical test-case corpus: a typed, generic Case/Corpus model with closed-set classification and provenance metadata, a pure JSON loader, and pure validators.
|
Package testcase is the pure-data foundation for bestiary's canonical test-case corpus: a typed, generic Case/Corpus model with closed-set classification and provenance metadata, a pure JSON loader, and pure validators. |
|
assert
Package assert is the testing seam for the test-case corpus: helpers that take *testing.T and fail a test when a corpus violates its own invariants.
|
Package assert is the testing seam for the test-case corpus: helpers that take *testing.T and fail a test when a corpus violates its own invariants. |