Skip to main content

Module catalogue

Module catalogue 

Source
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ยง

AccuracyRow
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.
CatalogueEntry
One variantโ€™s catalogue entry.
CatalogueFile ๐Ÿ”’
CatalogueSource
Where the feed is enumerated, fetched and versioned.
Download
One downloadable quantisation of the variant.
HeadlineBenchmark
The benchmark a variantโ€™s headline figure comes from.
License
The licence block, in the two forms the feed carries.
SpeedRow
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ยง

EntryKind
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 .gguf link 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 cap is 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.