Expand description
Model weight management: pinned specs, RAM-based selection, checksum
verification, and (feature download) the single permitted network fetch.
Security spine: weights are pinned by SHA-256. A spec with an empty hash is treated as not-yet-pinned and refused, so Kintsugi never loads an unverified blob. The download is the only network egress Kintsugi ever performs.
Structs§
- Model
Spec - A pinned model: where to fetch it, its checksum, and the RAM it needs.
Constants§
- MODEL_
FALLBACK - Low-RAM fallback: Qwen3-1.7B-Instruct, Q4_K_M (~1.1 GB), auto-selected on
machines with less RAM. URL/sha must be pinned before enabling
download. - MODEL_
PRIMARY - Primary model: Qwen3-4B-Instruct, Q4_K_M (~2.5 GB), used when RAM ≥ ~6 GB.
Functions§
- detect_
ram_ mb - Best-effort total system RAM in MB. Falls back to a conservative 4096.
- ensure_
weights - Ensure the weights for
specexist and verify underdir, returning the path. - select_
spec - Choose the largest model that comfortably fits in the available RAM.
- sha256_
file - Compute the SHA-256 of a file as a lowercase hex string.
- verify
- Verify a file matches the spec’s pinned checksum.