Hf Hub banner
huggingface huggingface

Hf Hub

Development community

Description

Rust client for the huggingface hub aiming for minimal subset of features over `huggingface-hub` python package

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

hf-hub

Rust client for the [Hugging Face Hub API](https://huggingface.co/docs/hub/api).

`hf-hub` provides a typed, ergonomic interface for interacting with the Hugging Face Hub from Rust. It is the Rust equivalent of the Python [`huggingface_hub`](https://github.com/huggingface/huggingface_hub) library.

Both an **async** interface (`HFClient`, on by default) and a **synchronous** interface (`HFClientSync`, enabled via the `blocking` feature) are provided. The two mirror each other method-for-method.

Features

  • Repository operations — query model, dataset, and space metadata; create, delete, update, and move repositories
  • File operations — upload files and folders, download files, list repository trees, check file existence
  • Commit operations — create commits with multiple file operations, list commit history, view diffs between revisions
  • Branch and tag management — create and delete branches and tags, list refs
  • User and organization info — whoami, user profiles, organization details, followers
  • Streaming pagination — async list endpoints return impl Stream> for lazy, memory-efficient iteration; blocking counterparts collect into Vec
  • Bucket operations — create, delete, list, and move buckets; upload, download, and delete files within buckets
  • Xet high-performance transfers — support for Hugging Face's Xet storage backend
  • Async or blocking — use HFClient with your own tokio runtime, or HFClientSync for synchronous callers (requires the blocking feature)

Installation

Add to your `Cargo.toml`:

[dependencies]
hf-hub = "1.0.0"

To use the synchronous interface, enable the `blocking` feature:

[dependencies]
hf-hub = { version = "1.0.0", features = ["blocking"] }

CLI Installation

The `hfrs` command-line tool provides a terminal interface to the Hub. Install it with:

cargo install --git https://github.com/huggingface/hf-hub.git hfrs

This bui