Skip to content

Nightly - #204

Merged
danielhanchen merged 663 commits into
mainfrom
nightly
Feb 28, 2024
Merged

danielhanchen merged 663 commits into
mainfrom
nightly

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

No description provided.

* Update save.py

* saving

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update __init__.py

* Update save.py

* Update save.py

* Update save.py

* save

* trainer

* spaces

* original

* Gemma

* Update pyproject.toml

* Update mapper.py

* Update fast_lora.py

* FastGemmaModel

* model_type

* Update llama.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update llama.py

* Update fast_lora.py

* Update llama.py

* Update llama.py

* Update cross_entropy_loss.py

* Update llama.py

* Update llama.py

* gemma

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update fast_lora.py

* Update fast_lora.py

* Fast CE Loss

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* CE

* Update llama.py

* Update llama.py

* Update cross_entropy_loss.py

* Update geglu.py

* Update cross_entropy_loss.py

* revert

* Update llama.py

* Update llama.py

* norm

* Update gemma.py

* Update gemma.py

* position_ids

* Update gemma.py

* Update gemma.py

* pos

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* revert

* revert

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* rope

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* llama

* Update llama.py

* gemma

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update save.py

* RoPE

* Update llama.py

* Update llama.py

* Update llama.py

* Update gemma.py

* correct_dtype

* Update gemma.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Chat Templates

* Update README.md

* Update README.md

* Update llama.py

* DoRA

* Update _utils.py

* Update chat_templates.py
@danielhanchen
danielhanchen merged commit dbba69b into main Feb 28, 2024
Stanley00 pushed a commit to stanley-fork/unsloth that referenced this pull request Mar 12, 2026
…mbnail

Fix: Resolve image preview thumbnail not rendering before send
abiswas-realadvice pushed a commit to abiswas-realadvice/unsloth that referenced this pull request May 14, 2026
* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update __init__.py

* Update save.py

* Update save.py

* Update save.py

* save

* trainer

* spaces

* original

* Gemma

* Update pyproject.toml

* Update mapper.py

* Update fast_lora.py

* FastGemmaModel

* model_type

* Update llama.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update llama.py

* Update fast_lora.py

* Update llama.py

* Update llama.py

* Update cross_entropy_loss.py

* Update llama.py

* Update llama.py

* gemma

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update fast_lora.py

* Update fast_lora.py

* Fast CE Loss

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* CE

* Update llama.py

* Update llama.py

* Update cross_entropy_loss.py

* Update geglu.py

* Update cross_entropy_loss.py

* revert

* Update llama.py

* Update llama.py

* norm

* Update gemma.py

* Update gemma.py

* position_ids

* Update gemma.py

* Update gemma.py

* pos

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* revert

* revert

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* rope

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* llama

* Update llama.py

* gemma

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update save.py

* RoPE

* Update llama.py

* Update llama.py

* Update llama.py

* Update gemma.py

* correct_dtype

* Update gemma.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Chat Templates

* Update README.md

* Update README.md

* Update llama.py

* DoRA

* Update _utils.py

* Update chat_templates.py

* Update llama.py

* Hotfix - fix DoRA, Gemma prompt template (unslothai#202) (unslothai#203)

* Update save.py

* saving

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update save.py

* Update __init__.py

* Update save.py

* Update save.py

* Update save.py

* save

* trainer

* spaces

* original

* Gemma

* Update pyproject.toml

* Update mapper.py

* Update fast_lora.py

* FastGemmaModel

* model_type

* Update llama.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update llama.py

* Update fast_lora.py

* Update llama.py

* Update llama.py

* Update cross_entropy_loss.py

* Update llama.py

* Update llama.py

* gemma

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update fast_lora.py

* Update fast_lora.py

* Fast CE Loss

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* CE

* Update llama.py

* Update llama.py

* Update cross_entropy_loss.py

* Update geglu.py

* Update cross_entropy_loss.py

* revert

* Update llama.py

* Update llama.py

* norm

* Update gemma.py

* Update gemma.py

* position_ids

* Update gemma.py

* Update gemma.py

* pos

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* revert

* revert

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update llama.py

* Update llama.py

* Update llama.py

* Update llama.py

* rope

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* llama

* Update llama.py

* gemma

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update gemma.py

* Update save.py

* RoPE

* Update llama.py

* Update llama.py

* Update llama.py

* Update gemma.py

* correct_dtype

* Update gemma.py

* Update cross_entropy_loss.py

* Update cross_entropy_loss.py

* Chat Templates

* Update README.md

* Update README.md

* Update llama.py

* DoRA

* Update _utils.py

* Update chat_templates.py
wasimysaid added a commit that referenced this pull request Sep 25, 2026
* fix(studio): keep every chat GGUF quant listed across cache folders

The variant listing resolved a repo against one cache folder at a time, so moving
the download folder (or switching back to the default) dropped quants that were
still on disk in another remembered folder, and the surviving rows lost the
cache_path of the copy they describe.

List logical quants across the active cache and every remembered folder, keeping
each quant's own cache_path, and reconcile them with the download-state rows so
the picker shows one row per quant no matter which folder holds it. Deletes and
loads then resolve the same copy the listing named.

Closes #10437

Adapted from #10438 onto current main.

* fix(studio): judge merged offline GGUF sources by their own state

A remembered cache's quants are merged into the listing when the request
is local-only or offline, and there the Hub readiness pass cannot run.
Every merged source was therefore reported as downloaded, so a copy whose
main shards are complete but whose projector or drafter never finished was
advertised as a model the picker could load, while the same snapshot
requested directly reported it partial and offered the resume.

Judge each source against its own snapshot instead, with the same local
manifest, marker and blob check the direct listing uses, and fall back to
a partial row when it does not pass.

Reported-by: Codex review (P2) on #204.

* test(studio): accept the cache-location flag in the boundary stub

The route now forwards `include_cache_locations` to the variants service, so
the inventory boundary test's stub of that service has to accept it; otherwise
the call raises inside the endpoint and the route answers 500.

* fix(studio): rank duplicate GGUF sources by their own partial state

A remembered copy of a quant could shadow a healthy duplicate when the
shadowed copy was verified complete by its manifest but still marked
partial by its own snapshot state, such as a cancellation marker: the
merge then reported the quant as unusable and offered a retry while the
loadable duplicate was omitted from the listing.

Rank duplicates on the full per-snapshot partial verdict in addition to
the completed-vs-incomplete manifest rule.

Reported-by: Codex review (P2) on #204.

* fix(studio): rank loader candidates by snapshot state, not manifest alone

`_cached_variant_candidates` ordered cached copies by manifest completeness
only, so an active snapshot a cancellation marker had already invalidated was
yielded before a healthy duplicate in a remembered folder; the merged listing
picked the healthy copy but `cached_gguf_for_load` could still open the
cancelled one and fail offline on the interrupted companion.

Rank on the same full per-snapshot verdict the listing uses.

The delete preview also named the folder it would delete, so an API-key
authenticated request read the host's absolute cache directory out of
`/api/hub/delete-impact`. It now passes through the host-path boundary and
answers with the opaque `cache_ref` the delete call already accepts; a
browser session still reads the path.

Reported-by: Codex review (P1/P2) on #204.

* fix(studio): keep remembered-cache quants reachable and referenced

Four follow-ups from the same review area:

- The merged-listing pass had a second anonymous test after
  `hub_cached_read_refused` had already authorized this caller, so a public
  repo's authorized anonymous read lost quants that exist only in a
  remembered folder. The authorization verdict decides; trust it.
- A quant the snapshot lists but does not complete -- an interrupted split
  download -- was dropped from the merge entirely, so it could neither be
  marked partial nor keep its folder. It is now a fallback source that the
  merge reports as a resume, not as a loadable copy.
- Merging can change which rows are root-level, and the default is chosen
  among root rows; keep the merged set's own answer instead of the one the
  active cache picked alone.
- Both variant response models now declare the opaque `cache_ref` sibling
  the host-path boundary adds, so FastAPI serialization keeps the only
  handle an API-key caller has for pinning a later delete to a listed copy.

Reported-by: Codex review on #204.

* fix(studio): judge merged cached sources by their own state and reference

Addresses the review findings on the remembered-cache merge:

- Rank duplicate sources on the current revision's companion readiness, which
  only that copy's own Hub answer knows, so a usable duplicate is not discarded
  for one the snapshot judges partial.
- Apply that same local partial verdict to a quant the current revision no
  longer lists, instead of keeping the synthesized loadable row.
- Prefer downloaded non-partial rows when recomputing the merged default.
- Carry partial transport, resumability and remaining bytes from the copy's own
  folder so a remembered partial keeps its resume affordance.
- Forward the redacted cache reference as the delete target, and declare it on
  the variant model so it survives response serialization.

Focused regressions cover each; reverting the fixes fails them.

* fix(studio): delete the cached GGUF copy the row names

A logical quant delete carries no folder, so the server re-resolved its
target with the local-only duplicate ranking while the listing had ranked
those duplicates by their own scoped companion readiness. The two can
disagree, and the delete then removed a copy the row never showed.

Carry the listed copy's own cache path through the expander row, the
pinned-quant row (from the validation listing) and the delete preview, so
preview and delete act on the copy the user sees.

* fix(studio): keep redacted GGUF deletes on the listed copy

Host-path redaction nulls cache_path and answers with the opaque cache_ref,
so a picker row that forwards only the cleared path sends nothing and the
server re-ranks duplicates by local-only state. The chat variant model now
declares cache_ref, the expander, sole-quant, and pinned-copy rows prefer it
for both the delete and its preview, and the disk card previews the same
identity its delete sends.

* fix(studio): settle the GGUF replacement's review findings at the current baseline

Restore the deleted useDeleteConfirmAction invocation that left the download
card's confirm dialog unparsable, judge a remembered partial's resume affordance
against the cache root a resume really continues in, keep the bare repo pin while
a runnable non-GGUF copy survives, and type the pinned-variant map so the frontend
projects compile.

* fix(studio): resolve GGUF quants across remembered cache folders

* test(studio): keep cache-aware picker contracts current

* fix(studio): retain single-cache GGUF snapshot pins and normalize formatting

* fix(studio): reject invalid targeted GGUF delete previews

* test(studio): group GGUF cache-switch regressions by scenario
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…ai#11938)

* fix(studio): keep every chat GGUF quant listed across cache folders

The variant listing resolved a repo against one cache folder at a time, so moving
the download folder (or switching back to the default) dropped quants that were
still on disk in another remembered folder, and the surviving rows lost the
cache_path of the copy they describe.

List logical quants across the active cache and every remembered folder, keeping
each quant's own cache_path, and reconcile them with the download-state rows so
the picker shows one row per quant no matter which folder holds it. Deletes and
loads then resolve the same copy the listing named.

Closes unslothai#10437

Adapted from unslothai#10438 onto current main.

* fix(studio): judge merged offline GGUF sources by their own state

A remembered cache's quants are merged into the listing when the request
is local-only or offline, and there the Hub readiness pass cannot run.
Every merged source was therefore reported as downloaded, so a copy whose
main shards are complete but whose projector or drafter never finished was
advertised as a model the picker could load, while the same snapshot
requested directly reported it partial and offered the resume.

Judge each source against its own snapshot instead, with the same local
manifest, marker and blob check the direct listing uses, and fall back to
a partial row when it does not pass.

Reported-by: Codex review (P2) on unslothai#204.

* test(studio): accept the cache-location flag in the boundary stub

The route now forwards `include_cache_locations` to the variants service, so
the inventory boundary test's stub of that service has to accept it; otherwise
the call raises inside the endpoint and the route answers 500.

* fix(studio): rank duplicate GGUF sources by their own partial state

A remembered copy of a quant could shadow a healthy duplicate when the
shadowed copy was verified complete by its manifest but still marked
partial by its own snapshot state, such as a cancellation marker: the
merge then reported the quant as unusable and offered a retry while the
loadable duplicate was omitted from the listing.

Rank duplicates on the full per-snapshot partial verdict in addition to
the completed-vs-incomplete manifest rule.

Reported-by: Codex review (P2) on unslothai#204.

* fix(studio): rank loader candidates by snapshot state, not manifest alone

`_cached_variant_candidates` ordered cached copies by manifest completeness
only, so an active snapshot a cancellation marker had already invalidated was
yielded before a healthy duplicate in a remembered folder; the merged listing
picked the healthy copy but `cached_gguf_for_load` could still open the
cancelled one and fail offline on the interrupted companion.

Rank on the same full per-snapshot verdict the listing uses.

The delete preview also named the folder it would delete, so an API-key
authenticated request read the host's absolute cache directory out of
`/api/hub/delete-impact`. It now passes through the host-path boundary and
answers with the opaque `cache_ref` the delete call already accepts; a
browser session still reads the path.

Reported-by: Codex review (P1/P2) on unslothai#204.

* fix(studio): keep remembered-cache quants reachable and referenced

Four follow-ups from the same review area:

- The merged-listing pass had a second anonymous test after
  `hub_cached_read_refused` had already authorized this caller, so a public
  repo's authorized anonymous read lost quants that exist only in a
  remembered folder. The authorization verdict decides; trust it.
- A quant the snapshot lists but does not complete -- an interrupted split
  download -- was dropped from the merge entirely, so it could neither be
  marked partial nor keep its folder. It is now a fallback source that the
  merge reports as a resume, not as a loadable copy.
- Merging can change which rows are root-level, and the default is chosen
  among root rows; keep the merged set's own answer instead of the one the
  active cache picked alone.
- Both variant response models now declare the opaque `cache_ref` sibling
  the host-path boundary adds, so FastAPI serialization keeps the only
  handle an API-key caller has for pinning a later delete to a listed copy.

Reported-by: Codex review on unslothai#204.

* fix(studio): judge merged cached sources by their own state and reference

Addresses the review findings on the remembered-cache merge:

- Rank duplicate sources on the current revision's companion readiness, which
  only that copy's own Hub answer knows, so a usable duplicate is not discarded
  for one the snapshot judges partial.
- Apply that same local partial verdict to a quant the current revision no
  longer lists, instead of keeping the synthesized loadable row.
- Prefer downloaded non-partial rows when recomputing the merged default.
- Carry partial transport, resumability and remaining bytes from the copy's own
  folder so a remembered partial keeps its resume affordance.
- Forward the redacted cache reference as the delete target, and declare it on
  the variant model so it survives response serialization.

Focused regressions cover each; reverting the fixes fails them.

* fix(studio): delete the cached GGUF copy the row names

A logical quant delete carries no folder, so the server re-resolved its
target with the local-only duplicate ranking while the listing had ranked
those duplicates by their own scoped companion readiness. The two can
disagree, and the delete then removed a copy the row never showed.

Carry the listed copy's own cache path through the expander row, the
pinned-quant row (from the validation listing) and the delete preview, so
preview and delete act on the copy the user sees.

* fix(studio): keep redacted GGUF deletes on the listed copy

Host-path redaction nulls cache_path and answers with the opaque cache_ref,
so a picker row that forwards only the cleared path sends nothing and the
server re-ranks duplicates by local-only state. The chat variant model now
declares cache_ref, the expander, sole-quant, and pinned-copy rows prefer it
for both the delete and its preview, and the disk card previews the same
identity its delete sends.

* fix(studio): settle the GGUF replacement's review findings at the current baseline

Restore the deleted useDeleteConfirmAction invocation that left the download
card's confirm dialog unparsable, judge a remembered partial's resume affordance
against the cache root a resume really continues in, keep the bare repo pin while
a runnable non-GGUF copy survives, and type the pinned-variant map so the frontend
projects compile.

* fix(studio): resolve GGUF quants across remembered cache folders

* test(studio): keep cache-aware picker contracts current

* fix(studio): retain single-cache GGUF snapshot pins and normalize formatting

* fix(studio): reject invalid targeted GGUF delete previews

* test(studio): group GGUF cache-switch regressions by scenario
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