Skip to content

fix(studio): keep On Device GGUF discovery local when offline - #12451

Closed
Souravrajvi0 wants to merge 3 commits into
unslothai:mainfrom
Souravrajvi0:fix/studio-offline-on-device-gguf
Closed

Souravrajvi0 wants to merge 3 commits into
unslothai:mainfrom
Souravrajvi0:fix/studio-offline-on-device-gguf

Conversation

@Souravrajvi0

Copy link
Copy Markdown
Contributor

Summary

Fixes #12415.

On Device GGUF quant discovery no longer blocks on Hugging Face when the machine is offline or when the picker should list disk-only quants.

Changes

Frontend

  • isGgufVariantsListingOffline() — Hub backoff or navigator.onLine === false — drives prefer_local_cache / offline on GGUF variant API calls.
  • On Device expander requests preferLocalCache when “Show all quantizations” is off or listing is offline (remote discovery remains for undownloaded quants while online with that setting on).

Backend

  • prefer_local_cache skips Hub cache-auth probes (same as offline).
  • prefer_local_cache does not fall through to list_gguf_variants() when nothing is cached locally.

Test plan

  • pytest studio/backend/tests/test_cached_gguf_routes.py::test_prefer_local_cache_without_on_disk_repo_skips_remote
  • node --experimental-strip-types --test tests/hub-network-availability.test.ts (frontend)
  • Model picker contract updated for expander local-discovery behavior

Treat navigator offline like Hub backoff for variant listings, request
prefer_local_cache from the On Device picker when appropriate, and stop
prefer_local_cache responses from falling through to remote Hub discovery
or cache authorization probes.
With "All quantizations" off, the On Device expander now asks for the disk
answer. The existing prefer_local_cache path already lists a cached repo with
no Hub listing or access probe for UI sessions, and an unreachable Hub already
gets the disk answer through isHuggingFaceOffline().

This drops the parts that broke other callers:
- prefer_local_cache falls back to the Hub listing again when nothing is
  cached; Images and Video resolve undownloaded GGUF quants through it.
- API-key tokens are probed again under prefer_local_cache, and a refused
  caller no longer sees cached empty quant folders.
- GGUF listings no longer treat navigator.onLine === false as offline.
  network.ts keeps that flag advisory because it reports offline on WSL2 and
  some WebKitGTK/Tauri webviews.

Adds regression tests for the three backend cases and pins the expander
request in the picker contract test.
@Etherll

Etherll commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

superseded by #12460.

@Etherll Etherll closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Desktop: Hugging Face quant discovery blocks loading On Device models offline

4 participants