releases.shpreview

v1.9.0

[v1.9.0] Agent-Aware CLI, Spaces Volumes, and more

$npx -y @buildinternet/releases show rel_eDUA4eTugGOL0AW61yhb7

šŸš€ Spaces Volumes: Mount Models, Datasets, and Buckets Directly

Hugging Face Spaces now support mounting volumes, giving your Space direct filesystem access to models, datasets, and storage buckets. This replaces the deprecated persistent storage feature.

from huggingface_hub import HfApi, Volume

api = HfApi()
api.set_space_volumes(
    repo_id="username/my-space",
    volumes=[
        Volume(type="model", source="username/my-model", mount_path="/models", read_only=True),
        Volume(type="bucket", source="username/my-bucket", mount_path="/data"),
    ],
)

Volumes can also be set at creation time via create_repo(space_volumes=...) and duplicate_repo(space_volumes=...), and from the CLI with the --volume / -v flag:

# Create a Space with volumes mounted
hf repos create my-space --type space --space-sdk gradio \
    -v hf://gpt2:/models -v hf://buckets/org/b:/data

# Duplicate a Space with volumes
hf repos duplicate org/my-space my-space --type space \
    -v hf://gpt2:/models -v hf://buckets/org/b:/data
  • Add support for mounted volumes by @Wauplin in #4018
  • Support volumes at repo creation and duplication by @Wauplin in #4035

šŸ¤– The hf CLI Now Auto-Detects AI Agents and Adapts Its Output

AI coding agents (Claude Code, Cursor, Codex, Copilot, Gemini, ...) increasingly use the hf CLI to interact with the Hub. Until now, the output was designed for humans - ANSI colors, padded tables, emoji booleans, truncated cells - making it hard for agents to parse reliably.

Starting with v1.9, the CLI automatically detects when it's running inside an agent and adapts its output: no ANSI, no truncation, tab-separated tables, compact JSON, full timestamps. No configuration needed - it just works. This is only a first step toward making the hf CLI the primary entry point to the Hugging Face Hub for AI agents!

Agent mode is auto-detected but you can also force a mode explicitly with --format:

hf models ls --limit 5                  # auto-detect
hf models ls --limit 5 --format agent   # force agent-friendly output
hf models ls --limit 5 --format json    # structured JSON
hf models ls --limit 5 --format quiet   # IDs only, great for piping

Here's what an agent sees compared to a human:

hf auth whoami

# Human
āœ“ Logged in
  user: Wauplin
  orgs: huggingface, awesome-org

# Agent
user=Wauplin orgs=huggingface,awesome-org

# JSON
{"user": "Wauplin", "orgs": ["huggingface", "awesome-org"]}

hf models ls --author google --limit 3

# Human
ID                         DOWNLOADS TRENDING_SCORE
-------------------------- --------- --------------
google/embeddinggemma-300m 1213145   17            
google/gemma-3-4b-it       1512637   16            
google/gemma-3-27b-it      988618    12   

# Agent (TSV, no truncation, no ANSI)
id      downloads       trending_score
google/embeddinggemma-300m      1213145 17
google/gemma-3-4b-it    1512637 16
google/gemma-3-27b-it   988618  12

hf models info google/gemma-3-27b-it

# Human — pretty-printed JSON (indent=2)
{
  "id": "google/gemma-3-27b-it",
  "author": "google",
  ...
}

# Agent — compact JSON (~40% fewer tokens)
{"id": "google/gemma-3-27b-it", "author": "google", "card_data": ...}

Commands migrated so far: hf models ls|info, hf datasets ls|info|parquet|sql, hf spaces ls|info, hf papers ls|search|info, hf auth whoami. More commands will be migrated soon

  • Add out output singleton with agent/human mode rendering by @hanouticelina in #4005
  • Migrate models, datasets, spaces, papers to out singleton by @hanouticelina in #4026
  • Add FormatWithAutoOpt with callback to auto-set output mode by @hanouticelina in #4028
  • Add tests for out output singleton by @hanouticelina in #4020
  • Add agent detection helpers by @hanouticelina in #4015
  • Enrich CLI errors with available options and commands by @hanouticelina in #4034

🧩 Install Agent Skills from the Hugging Face Marketplace

The hf skills add command now supports installing skills directly from the Hugging Face skills marketplace (https://github.com/huggingface/skills) - pre-built tools that give AI agents new capabilities.

# Install a marketplace skill
hf skills add gradio

# Install with Claude Code integration
hf skills add huggingface-gradio --claude

# Upgrade all installed skills
hf skills upgrade
  • Support skills from hf skills by @burtenshaw in #3956
  • Improve hf CLI skill description for better agent triggering by @hanouticelina in #3973

šŸ”§ More CLI Improvements

  • Auto-install official HF CLI extensions on first invocation by @hanouticelina in #4007
  • Add summary field to hf papers search CLI output by @Wauplin in #4006
  • Interactive CLI autoupdate prompt by @Wauplin in #3983

šŸ”§ Other Improvements

  • Clarify 404 access guidance in errors by @Pierrci in #4010
  • Add HF_HUB_DISABLE_SYMLINKS env variable to force no-symlink cache by @Wauplin in #4032
  • Add CACHEDIR.TAG to cache directories by @Wauplin in #4030
  • Support None type in strict dataclass by @Wauplin in #3987
  • Reject bool/int cross-type confusion in @strict dataclass validation by @Wauplin in #3992

šŸ› Bug Fixes

  • Fix PyTorchModelHubMixin not calling eval() on safetensors load by @joaquinhuigomez in #3997
  • Bump to hf-xet 1.4.3 and add regression test by @Wauplin in #4019
  • Validate shard filenames in sharded checkpoint index files by @Wauplin in #4033
  • Fix test_create_commit_conflict test by @Wauplin in #3986
  • Do not scan CACHEDIR.TAG file in cache by @Wauplin in #4036
  • Deduplicate repo folder name generation logic by @cphlipot in #4024

šŸ“– Documentation

  • Add tip about AI agents skill to CLI guide by @gary149 in #3970
  • Link to Hub local cache docs from manage-cache guide by @Wauplin in #3989
  • Note that environment variables are read at import time by @Wauplin in #3990
  • Add DatasetLeaderboardEntry and EvalResultEntry to docs reference by @pcuenca in #3982
  • Fix typos and outdated references in CONTRIBUTING.md by @GopalGB in #4009
  • no explicit models/ in hf:// protocol by @lhoestq in #3980
  • Add CLAUDE.md symlink pointing to AGENTS.md by @hanouticelina in #4013

šŸ—ļø Internal

  • Bump minimum Python version from 3.9 to 3.10 by @hanouticelina in #4008
  • Use match/case statements where appropriate by @hanouticelina in #4012
  • Fix ty type-checking errors after latest release by @hanouticelina in #3978
  • Prepare for v1.9 release by @Wauplin in #3988
  • Update python-release.yml by @hf-security-analysis[bot] in #4011
  • Pin GitHub Actions to commit SHAs by @paulinebm in #4029
  • Remove claude.yml workflow file by @hf-security-analysis[bot] in #4031
  • Generate slack message for prerelease by @Wauplin in #3976

Fetched April 7, 2026