Skip to content

Pin model revisions and validate GGUF HTTP ranges - #430

Open
Taz33m wants to merge 1 commit into
Nehanth:mainfrom
Taz33m:fix/pin-and-validate-model-ranges
Open

Taz33m wants to merge 1 commit into
Nehanth:mainfrom
Taz33m:fix/pin-and-validate-model-ranges

Conversation

@Taz33m

@Taz33m Taz33m commented Nov 30, 2026

Copy link
Copy Markdown

What

The catalogue used mutable Hugging Face URLs, and a browser could cache a 206 response containing bytes from a different position in the file. This change pins the catalogue resources to immutable revisions. The room’s GGUF range reader verifies the returned offsets, the catalogue file size when known, and the actual byte count as the body streams. An incomplete stream fails before the cache write completes.

Existing browser cache entries keyed to mutable URLs will miss once. Split GGUF files use each shard’s size. Cache and peer content hashes and the separate Flash disk-ingest worker remain outside this range reader’s coverage.

This is the model-download portion of #334.

Tested on

  • Deno unit suite passed with 1,451 tests and five skips. Range tests cover offset errors, EOF clamping, truncation, extra bytes, cancellation and backpressure.
  • Compared pinned resource paths and GGUF sizes and SHA-256 values with Hugging Face revision metadata. A real 1 KiB request for Qwen3 1.7B passed the new validator.
  • Chrome 158 with SwiftShader passed all 13 checks in the synthetic three-tab room’s leftout scenario, including model startup and a second answer after the phone tab reloaded.

Keep cached GGUF byte ranges tied to one revision and check offsets, file size and streamed length before a download can complete. Use the synthetic GGUF size in browser tests.
@Taz33m
Taz33m requested a review from Nehanth as a code owner November 30, 2026 23:28
@vercel

vercel Bot commented Nov 30, 2026

Copy link
Copy Markdown

@Taz33m is attempting to deploy a commit to the nehanth's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant