unslothai/unsloth · warning · HTTPException
Multiple cached {noun} differ only by case. Delete the exact
Error message
Multiple cached {noun} differ only by case. Delete the exact repo casing from On Device. What it means
HTTPException 409 raised by resolve_destructive_repo_ids when the HF cache dir contains multiple repos whose ids differ from the requested one only by letter case (resolved by resolve_destructive_case_matches returning None). Deleting could hit the wrong casing on case-insensitive filesystems, so the API refuses the destructive operation and asks the user to delete the exact casing from the On Device UI.
Source
Thrown at studio/backend/hub/services/__init__.py:22
"""Shared helpers for the Hub service layer."""
from __future__ import annotations
from typing import Iterable
from fastapi import HTTPException
from hub.utils.hf_cache_state import resolve_destructive_case_matches
def resolve_destructive_repo_ids(repo_id: str, candidates: Iterable[str], *, noun: str) -> set[str]:
"""Cache-dir repo ids a destructive op on *repo_id* may target.
Refuses with 409 on ambiguous case-only matches so a delete never removes
the wrong casing. *noun* is the plural shown to the user."""
resolved = resolve_destructive_case_matches(repo_id, candidates)
if resolved is None:
raise HTTPException(
status_code = 409,
detail = (
f"Multiple cached {noun} differ only by case. "
"Delete the exact repo casing from On Device."
),
)
return resolved
View on GitHub (pinned to 203007d190)
Solutions
- Open the On Device page and delete the exact repo casing you want removed, one entry at a time.
- Clean duplicates by deleting both case variants and re-downloading the correctly-cased repo.
- Audit scripts that normalize repo ids to lowercase before download.
Example fix
# before DELETE /hub/datasets/user/model # cache holds both User/Model and user/model -> 409 # after # On Device UI: delete 'User/Model' explicitly, then retry the API call for the remaining casing
Defensive patterns
Strategy: try-catch
Try / catch
import httpx
resp = httpx.delete(f"{api}/hub/datasets/{repo_id}")
if resp.status_code == 409 and "differ only by case" in resp.text:
# direct the user to On Device to pick the exact casing
show_message("Multiple cached casings exist; delete the exact one from On Device.") Prevention
- Always download repos using the exact canonical casing from the Hub.
- Never lowercase/normalize repo ids in scripts that write to the HF cache.
- When listing cached repos for a delete UI, show and submit the exact stored casing.
When it happens
Trigger: Calling a delete endpoint for a repo while the cache holds e.g. both 'User/Model' and 'user/model' (or other case variants) matching case-insensitively; common after downloading the same repo under differently-cased ids at different times.
Common situations: macOS/Windows (case-insensitive FS) caches where both casings were snapshotted; scripts that lowercase repo ids before downloading; re-adding a repo with different capitalization.
Related errors
- Failed to read the local dataset cache.
- Invalid repo_id format
- Dataset not found in cache
- Failed to create models folder: {path}: {e}
- Models folder path is not a directory: {path}
AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15).
Data as JSON: /api/errors/e2c6f1f1983e60ab.
Report an issue: GitHub.