Files
lightcraft/crates/fetch
Andrew FrahnandClaude Opus 5.5 2eeff54b2b #366: SAM 3 mirrors accept a local folder (file:// or absolute path); vocab.json / merges.txt pinned
A mirror entry may now be a local folder holding the checkpoint files, so
people who fetched facebook/sam3 by hand can install it without a web server.
Local copies go through the same size + SHA-256 checks; the two tokenizer
files are now pinned to the official checkpoint.

Sources: own design.

(cherry picked from commit c47066a97a)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 11:15:28 +11:00
..

lightcraft-fetch

Native model downloads in pure Rust (L0, Apache-2.0): HTTP/1.1 over std sockets and rustls with the RustCrypto provider, without ring, aws-lc, C or assembly build dependencies. The wasm32 crate is empty.

Call download with bounded file specifications and ordered mirrors, or download_url for an exact catalog URL (including its query). Each file has a local filename independent of the URL, a size cap and optional pinned size/SHA-256. Transfers resume pinned .part files, verify before renaming, report progress and check cancellation during reads. Run on a worker thread. No proxy support; DNS resolution uses the platform resolver. Tokens are off by default and never forwarded to a different redirect host. A redirect from https to http is refused.

Tests use local synthetic HTTP servers for redirects, resume, truncation, cancellation, stalls, hashes, size limits and hostile specifications; they make no internet requests.