github huggingface/huggingface_hub v1.11.0.rc0
[v1.11.0] Semantic Spaces search, Space logs, and more

latest release: v1.11.0
pre-release8 hours ago

🔍 Semantic search for Spaces

Discover Spaces using natural language. The new search_spaces() API and hf spaces search CLI use embedding-based semantic search to find relevant Spaces based on what they do - not just keyword matching on their name.

>>> from huggingface_hub import search_spaces

>>> results = search_spaces("remove background from photo")
>>> for space in results:
...     print(f"{space.id} (score: {space.score:.2f})")
briaai/BRIA-RMBG-1.4 (score: 0.87)

The same capability is available in the CLI:

$ hf spaces search "remove background from photo" --limit 3
ID                           TITLE                 SDK    LIKES STAGE   CATEGORY           SCORE
---------------------------- --------------------- ------ ----- ------- ------------------ -----
not-lain/background-removal  Background Removal    gradio 2794  RUNNING Image Editing      0.85 
briaai/BRIA-RMBG-2.0         BRIA RMBG 2.0         gradio 918   RUNNING Background Removal 0.84 
Xenova/remove-background-web Remove Background Web static 739   RUNNING Background Removal 0.81 
Hint: Use --description to show AI-generated descriptions.

# Filter by SDK, get JSON with descriptions
$ hf spaces search "chatbot" --sdk gradio --description --json --limit 1 | jq
[
  {
    "id": "BarBar288/Chatbot",
    "title": "Chatbot",
    "sdk": "gradio",
    "likes": 4,
    "stage": "RUNNING",
    "category": "Other",
    "score": 0.5,
    "description": "Perform various AI tasks like chat, image generation, and text-to-speech"
  }
]

📜 Programmatic access to Space logs

When a Space fails to build or crashes at runtime, you can now retrieve the logs programmatically — no need to open the browser. This is particularly useful for agentic workflows that need to debug Space failures autonomously.

>>> from huggingface_hub import fetch_space_logs

# Run logs (default)
>>> for line in fetch_space_logs("username/my-space"):
...     print(line, end="")

# Build logs — for BUILD_ERROR debugging
>>> for line in fetch_space_logs("username/my-space", build=True):
...     print(line, end="")

# Stream in real time
>>> for line in fetch_space_logs("username/my-space", follow=True):
...     print(line, end="")

The CLI equivalent:

$ hf spaces logs username/my-space              # run logs
$ hf spaces logs username/my-space --build      # build logs
$ hf spaces logs username/my-space -f           # stream in real time
$ hf spaces logs username/my-space -n 50        # last 50 lines

🖥️ CLI output standardization continues

This release continues the CLI output migration started in v1.9, bringing 11 more command groups to the unified --format flag. The old --quiet flags on migrated commands are replaced by --format quiet.

$ hf cache ls                          # auto-detect (human or agent)
$ hf cache ls --format json            # structured JSON
$ hf cache ls --format quiet           # minimal output, great for piping
$ hf upload my-model . .               # auto-detect (human or agent)

Confirmation prompts (e.g., hf cache rm, hf repos delete, hf buckets delete) are now mode-aware: they prompt in human mode, and require --yes in agent/json/quiet modes - no more hanging scripts.

Commands migrated in this release: collections, discussions, extensions, endpoints, webhooks, cache, repos, repo-files, download, upload, and upload-large-folder. Remaining commands (jobs, buckets, auth login/logout) will follow in a future release.

📦 Space volumes management from the CLI

A new hf spaces volumes command group lets you manage volumes mounted in Spaces directly from the command line — list, set, and delete using the familiar -v/--volume syntax.

# List mounted volumes
$ hf spaces volumes ls username/my-space
TYPE    SOURCE                MOUNT_PATH READ_ONLY
------- --------------------- ---------- ---------
model   gpt2                  /data      ✔
dataset badlogicgames/pi-mono /data2     ✔

# Set volumes
$ hf spaces volumes set username/my-space -v hf://buckets/username/my-bucket:/data
$ hf spaces volumes set username/my-space -v hf://models/username/my-model:/models

# Delete all volumes
$ hf spaces volumes delete username/my-space

🔧 More CLI improvements

hf auth token - Prints the current token to stdout, handy for piping into other commands:

$ hf auth token
hf_xxxx
Hint: Run `hf auth whoami` to see which account this token belongs to.

# Use it in a curl call
$ hf auth token | xargs -I {} curl -H "Authorization: Bearer {}" https://huggingface.co/api/whoami-v2

💔 Breaking change

model_name deprecated in list_models - Use search instead. Both were always equivalent (both map to ?search=... in the API), but now model_name emits a deprecation warning. Removal is planned for 2.0.

# Before
>>> list_models(model_name="gemma")

# After
>>> list_models(search="gemma")

The CLI is not affected - hf models ls already uses --search.

🔧 Other improvements

🐛 Bug fixes

📖 Documentation

🏗️ Internal

Don't miss a new huggingface_hub release

NewReleases is sending notifications on new releases.