# `HuggingfaceClient.Hub`
[🔗](https://github.com/huggingface/huggingface_client/blob/v0.1.0/lib/huggingface_client/hub.ex#L1)

Top-level facade for all HuggingFace Hub operations.

Delegates to the appropriate sub-module based on the operation. You can also
use each sub-module directly for advanced use cases.

## Quick reference

| Function                 | Delegated to                              |
|--------------------------|-------------------------------------------|
| `who_am_i/1`             | `HuggingfaceClient.Hub.Auth`              |
| `list_models/1`          | `HuggingfaceClient.Hub.Models`            |
| `model_info/2`           | `HuggingfaceClient.Hub.Models`            |
| `create_repo/2`          | `HuggingfaceClient.Hub.Repos`             |
| `delete_repo/2`          | `HuggingfaceClient.Hub.Repos`             |
| `upload_file/2`          | `HuggingfaceClient.Hub.Commits`           |
| `delete_file/2`          | `HuggingfaceClient.Hub.Commits`           |
| `list_collections/1`     | `HuggingfaceClient.Hub.Collections`       |
| `oauth_login_url/1`      | `HuggingfaceClient.Hub.OAuth`             |
| `oauth_handle_redirect/1`| `HuggingfaceClient.Hub.OAuth`             |
| `run_job/2`              | `HuggingfaceClient.Hub.Jobs`              |

# `create_branch`

Creates a branch. See `Hub.Repos.create_branch/3`.

# `create_collection`

Creates a collection. See `Hub.Collections.create/1`.

# `create_repo`

Creates a Hub repository. See `Hub.Repos.create/2`.

# `delete_branch`

Deletes a branch. See `Hub.Repos.delete_branch/3`.

# `delete_file`

Deletes a file in a commit. See `Hub.Commits.delete_file/2`.

# `delete_files`

Deletes multiple files in a commit. See `Hub.Commits.delete_files/2`.

# `delete_repo`

Deletes a Hub repository. See `Hub.Repos.delete/2`.

# `download_file`

Downloads a file. See `Hub.Repos.download_file/3`.

# `get_collection`

Gets a collection by slug. See `Hub.Collections.get/2`.

# `get_job`

Gets a job's status. See `Hub.Jobs.get/3`.

# `hub_cache_dir`

Returns the default Hub cache directory. See `Hub.Snapshots.default_cache_dir/0`.

# `list_collections`

Returns a lazy stream of collections. See `Hub.Collections.list/1`.

# `list_models`

Returns a lazy stream of models. See `Hub.Models.list/1`.

# `model_info`

Returns detailed metadata for a model. See `Hub.Models.get/2`.

# `oauth_handle_redirect`

Handles OAuth redirect and exchanges code for tokens. See `Hub.OAuth.handle_redirect/1`.

# `oauth_login_url`

Builds a PKCE OAuth login URL. See `Hub.OAuth.login_url/1`.

# `run_job`

Runs an inference job. See `Hub.Jobs.run/2`.

# `upload_file`

Uploads a file in a commit. See `Hub.Commits.upload_file/2`.

# `upload_files`

Uploads multiple files in a commit. See `Hub.Commits.upload_files/3`.

# `who_am_i`

Returns info about the currently authenticated user/org. See `Hub.Auth.who_am_i/1`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
