Expand description
The transcribe.cpp catalogue: the per-variant feed the runtime publishes.
Each variant is one JSON document (catalog/<variant>.json) carrying
the modelโs identity, its downloads, and the measured accuracy and
speed rows. Parsing is tolerant by design: upstream grows the schema,
so unknown fields are ignored and the optional blocks default, while a
document from another schema is refused by name rather than
half-read.
Re-exportsยง
use std::io::Read as _;๐use std::path::Path;๐use std::time::Duration;๐use std::time::SystemTime;๐use serde::Deserialize;๐use serde::Deserialize;๐use serde::Serialize;๐use serde::Serialize;๐use crate::Error;๐
Structsยง
- Accuracy
Row - One measured accuracy row.
- Capabilities
- What a variant can do, as far as the feed verifies it.
- Catalogue
- The feed as one fetch found it.
- Catalogue
Entry - One variantโs catalogue entry.
- Catalogue
File ๐ - Catalogue
Source - Where the feed is enumerated, fetched and versioned.
- Download
- One downloadable quantisation of the variant.
- Headline
Benchmark - The benchmark a variantโs headline figure comes from.
- License
- The licence block, in the two forms the feed carries.
- Speed
Row - One measured speed row. Many fields cross that nothing reads; the wall-clock realtime factor is the one the page compares on.
- Support
- One capabilityโs support flag.
Enumsยง
- Entry
Kind - What one catalogue entry is FOR: the slot it can fill. Exhaustive on purpose - a consumer that ignores it does not compile, so the two feedsโ entries can never be mixed up by an assumption.
Constantsยง
- CATALOGUE_
CACHE_ ๐FILE - The record of the last fetched feed under
read_catalogue_cacheโs directory. - CATALOGUE_
CACHE_ ๐VERSION - The recordโs own layout version. A file written by a layout this build does not know is ignored rather than misread.
- DOWNLOADS_
OPEN ๐ - The markers the feed wraps its machine-readable regions in.
- FETCH_
WORKERS ๐ - How many entry documents are fetched at once. The feed is roughly 75 small files, so this is what turns a ten-second serial walk into one that finishes while the page is still drawing its first frame.
- MAX_
RESPONSE_ ๐BYTES - Bytes any single catalogue response may carry before the fetch refuses to buffer more. The feedโs documents are about 13 KiB; the cap is what keeps a broken mirror from growing this process.
- PREFERRED_
DOWNLOADS - The quantisations this runtime runs, best first: the order a download is picked in when a source offers several, and the set a cleanup candidate must offer at least one of. One ladder, so a row the feed admits and the download that row resolves to can never disagree.
- REFERENCE_
QUANTS ๐ - The quants a headline accuracy figure is read at, most preferred first: the reference quants the catalogue measures its headline rows at, so a comparison across variants reads the same axis.
- SCHEMA
- The schema string every entry this build reads carries.
- TABLE_
CLOSE ๐
Functionsยง
- doc_
links - The download links one variantโs doc carries, by file name.
- download_
links - The download links a variantโs own documents carry, by file name.
- feed_
client ๐ - The client every feed request goes through: the timeouts, and the User-Agent api.github.com refuses a request without.
- fetch_
catalogue - Fetch the whole catalogue. Blocking, like everything else here.
- fetch_
chunk ๐ - Fetch and parse one slice of the listing; a document that cannot be read is counted, not returned.
- fetch_
doc - Fetch one variantโs per-model doc, where its own download links live.
- file_
links - Every
.gguflink in a whole document, by file name. - get_
bounded_ ๐text - GET one response, bounded: a status that is not success is its own
error, and a body past
capis refused rather than buffered. - gguf_
links ๐ - link_
targets ๐ - Every markdown link target on one line: the text between
](and). - listed_
files ๐ - The entry documents a listing names: JSON files, never the underscore-prefixed schema and profile records beside them.
- parse_
entry - Parse one catalogue document, refusing anything that is not an entry of the schema this build reads.
- read_
catalogue_ cache - Read the last fetched catalogue under
dir, when there is one this build wrote. - release_
tag ๐ - The tag of a GitHub release document.
- rfc3339_
now ๐ - Now, in RFC 3339 UTC. A clock before the epoch formats as the epoch rather than failing: a wrong label beats no feed.
- write_
catalogue_ cache - Write the feed under
dir, so a page reads the last-known rows without the network.