gizai:family
the contract between the host (gizai:ai and giz ai) and a model family. A family is a folder ai/models/NAME whose family.giz gives family(): the models it serves (Entry), and what it does with them: their files (fetch, here), an image engine (image), a video engine (video), a speech-to-text engine (transcriber) and a worker (worker). The host names no model: gizai:models/registry lists the family of every folder, and giz ai registry writes that list again from the folders.
import * as Family from "gizai:family";Types
Entry
type Entry = { name: string; repo: string; kind: string; bits: Bits; about: string; standard?: bool; }A model by name: its Hugging Face repository ("" when its worker reads its files from its options), its kind ("text": a chat model, "embed": a sentence encoder, "rank": a cross-encoder, which gizai:llm runs; or "image", "video", "speech", "transcription", "talking-head"), the bits of its linears (an image model's: 8, or 4 for INT4; an encoder's are as stored), what it is, and whether it is the model of its kind that a caller gets when it names none.
name:stringrepo:stringkind:stringbits:_gizlang_lib_ai__llm__convert.Bitsabout:stringstandard:_gizlang_sdk_core.Option<bool>
Options
type Options = { names: Vec<string>; values: Vec<string>; }The flags of a command line with their values ("" for a flag without one).
names:Vec<string>values:Vec<string>
Family
type Family = { entries: Vec<Entry>; options?: Vec<string>; fetch?: (hub: Hub.Hub, e: Entry) => Result<string, string>; here?: (hub: Hub.Hub, e: Entry) => bool; image?: (hub: Hub.Hub, e: Entry, gpu: Gpu) => Result<Painter, string>; video?: (hub: Hub.Hub, e: Entry, gpu: Gpu) => Result<Filmer, string>; transcriber?: (hub: Hub.Hub, e: Entry) => Result<Transcriber, string>; worker?: (sys: System, hub: Hub.Hub, e: Entry, o: Options, place: Place) => Result<i64, string>; }A model family. Every field but entries is optional:
options: the flags its worker takes a value for ("--files").fetch: downloads (and converts) modeleinto the models folder, as its first use does; returns its folder. Without it a chat model or an encoder is fetched as gizai:llm reads it; another kind has nothing to fetch.here: whether the models folder holdseready. Without it, asfetch.image: the image engine ofeongpu(gizai:tasks/image). A family with it serves image.generate jobs.video: the video engine ofeongpu(gizai:tasks/video).transcriber: the speech-to-text engine ofe(gizai:tasks/transcription), its files fetched first.worker: serveseas giz's inference worker atplacewith the command line's options; returns when it stops.entries:Vec<M20.Entry>options:_gizlang_sdk_core.Option<Vec<string>>fetch:_gizlang_sdk_core.Option<(hub: gizlang_hub.Hub, e: M20.Entry) => _gizlang_sdk_core.Result<string, string>>here:_gizlang_sdk_core.Option<(hub: gizlang_hub.Hub, e: M20.Entry) => bool>image:_gizlang_sdk_core.Option<(hub: gizlang_hub.Hub, e: M20.Entry, gpu: M10.Gpu) => _gizlang_sdk_core.Result<_gizlang_lib_ai__tasks__image.Painter, string>>video:_gizlang_sdk_core.Option<(hub: gizlang_hub.Hub, e: M20.Entry, gpu: M10.Gpu) => _gizlang_sdk_core.Result<_gizlang_lib_ai__tasks__video.Filmer, string>>transcriber:_gizlang_sdk_core.Option<(hub: gizlang_hub.Hub, e: M20.Entry) => _gizlang_sdk_core.Result<_gizlang_lib_ai__tasks__transcription.Transcriber, string>>worker:_gizlang_sdk_core.Option<(sys: gizlang_system.System, hub: gizlang_hub.Hub, e: M20.Entry, o: M20.Options, place: M22.Place) => _gizlang_sdk_core.Result<i64, string>>
Functions
chat
function chat(name: string, repo: string, layers: i64, head: i64, about: string): EntryA chat model of gizai:llm: its linears and its head in layers and head bits.
encoding
function encoding(name: string, repo: string, kind: string, about: string): EntryA text encoder of gizai:llm (kind "embed" or "rank"), its linears as stored.
Methods
Options.text
function Options.text(self: Options, name: string, otherwise: string): stringThe value of flag name, else otherwise.
Effects: fail.
Options.number
function Options.number(self: Options, name: string, otherwise: i64): i64 throws stringThe whole number of flag name, else otherwise; an error where its value is not one.
Effects: fail.