gizlang/providers
the kinds of model provider a program can attach, as one list: the API each speaks, its address, how an attached provider signs in, and the models its API lists. An app keeps the attached providers (their labels and keys) in its own store; this list is what every such store names.
import * as Providers from "gizlang/providers";Types
Sign
type Sign = "key" | "oauth" | "sso" | "url"How an attached provider signs in: "key" an API key; "oauth" a subscription sign-in; "sso" the Giz account (gizlang/signin); "url" the address of a server, a key optional.
Kind
type Kind = { id: string; name: string; wire: Wire; base: string; sign: Sign; window: i64; }A kind of provider: its id (the prefix of its models' names, "openai:gpt-5"), its name, the wire and address of its API ("": each attached provider gives its own), how one signs in and its context window (0: its API says).
id:stringname:stringwire:stringbase:stringsign:stringwindow:i64
Listed
type Listed = { id: string; name: string; kind: string; tools: bool; context: i64; price: string; }A model an API lists: its id, its name (its id when the API gives none), its kind ("language" for a chat model; "" when the API does not say), whether it takes tools ("tools" in its supported_parameters; true when the API does not say), its context window in tokens (0: the API does not say) and its price ("": not said).
id:stringname:stringkind:stringtools:boolcontext:i64price:string
Functions
kinds
function kinds(): Vec<Kind>The kinds of provider. gizstack is GizStack's AI Gateway and gizai giz.ai's API, both with the Giz account;
compatible any server of the OpenAI API; worker a Gizlang model server (giz ai serve).
Effects: fail, alloc.
kind
function kind(id: string): Option<Kind>The kind of id.
Effects: fail, alloc.
models
function models(c: ModelApi): Vec<Listed> throws stringThe models c offers (GET /models, as its wire lists them), in its order.
Effects: fail, read, write, console, io, alloc.