Skip to content

Invalid repo_id: Studio rejects valid HF repo with 100-char namespace/repo_name (96-char limit applied to full string instead of name segment) #6946

Closed

Description

@biondogs

Bug

Unsloth Studio v2026.7.1 rejects a valid HuggingFace repo_id because is_valid_repo_id() in studio/backend/hub/utils/paths.py applies the 96-character length limit to the full namespace/repo_name string instead of to the repo name segment individually.

Reproduction

Model: DavidAU/Qwen3.6-40B-Claude-4.6-Opus-Deckard-Heretic-Uncensored-Thinking-NEO-CODE-Di-IMatrix-MAX-GGUF

Error:

Invalid repo_id: '"DavidAU/Qwen3.6-40B-Claude-4.6-Opus-Deckard-Heretic-Uncensored-Thinking-NEO-CODE-Di-IMatrix-MAX-GGUF'

Unsloth version:

unsloth: 2026.7.1
unsloth_zoo: 2026.7.1
huggingface_hub: 0.36.2

Root Cause

The repo_id is 100 characters total:

  • Namespace: DavidAU (7 chars)
  • Repo name: Qwen3.6-40B-Claude-4.6-Opus-Deckard-Heretic-Uncensored-Thinking-NEO-CODE-Di-IMatrix-MAX-GGUF (92 chars)
  • Total: 100 chars

The function is_valid_repo_id() in studio/backend/hub/utils/paths.py (line 184) checks:

if len(repo_id) > _MAX_REPO_ID_LENGTH or repo_id.endswith(".git"):
    return False

where _MAX_REPO_ID_LENGTH = 96. This applies the 96-char limit to the entire namespace/repo_name string.

However, HuggingFace Hub's own validate_repo_id() in huggingface_hub applies the 96-char limit to the repo name segment only (the part after /), not to the combined string. The repo name is 92 chars, which is within the 96-char limit.

The Fix

The length check should be applied per-segment, not to the full string:

def is_valid_repo_id(repo_id: str) -> bool:
    if not repo_id or repo_id != repo_id.strip():
        return False
    if repo_id.endswith(".git"):
        return False
    if "--" in repo_id or ".." in repo_id:
        return False
    segments = repo_id.split("/")
    if len(segments) not in (1, 2):
        return False
    return all(
        segment not in ("", ".", "..")
        and len(segment) <= _MAX_REPO_ID_LENGTH
        and _VALID_REPO_ID_SEGMENT.fullmatch(segment) is not None
        for segment in segments
    )

Impact

Any HuggingFace repo where namespace/ + repo_name exceeds 96 characters total will be rejected by Unsloth Studio, even though the repo name itself is within HuggingFace's 96-char limit and the repo loads fine via huggingface_hub directly.

This affects many DavidAU GGUF repos (which tend to have long descriptive names) and potentially other community model repos.

Workaround

I patched paths.py on my server and the model loads correctly. The fix is a one-line change (move the length check inside the segment loop).

Environment

  • OS: Arch Linux ARM (aarch64)
  • Install method: curl-based Unsloth Studio installer
  • Python: 3.13.11 (uv-managed venv at ~/.unsloth/studio/unsloth_studio/)
  • unsloth: 2026.7.1
  • unsloth_zoo: 2026.7.1
  • huggingface_hub: 0.36.2

Activity

  1. added a commit that references this issue on Jul 8, 2026
    c245dbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions