← All notes

Uploading to the Hub with huggingface_hub

Answer: Log in to your Hugging Face account, create a repository with create_repo, then upload a file to your repository using upload_file.

Use upload_folder to upload a local folder to an existing repository. The hf upload command uploads files from the terminal.

Repositories

create_repo creates a model repository by default; set the repository type to dataset or space when needed. A repository can be public or private.

Folder uploads

Low-level commits

create_commit takes operations: CommitOperationAdd uploads a file, CommitOperationDelete removes a file or folder, CommitOperationCopy copies a file.

Artifacts

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Hugging Face docs (huggingface/transformers, huggingface/huggingface_hub, huggingface/diffusers on GitHub), Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Hugging Face docs, Upload files to the Hub, Apache-2.0 (huggingface docs repos); Hugging Face docs, Create and manage a repository, Apache-2.0 (huggingface docs repos).

Cite this

Permanent ID: iil:note:0ng30ymp

iinventedlight. 2026. "Uploading to the Hub with huggingface_hub." iinventedlight Library, iil:note:0ng30ymp, version of 2026-11-09. https://iinventedlight.com/library/notes/hf-hub-upload-files/. License: CC-BY-4.0.

@misc{iil_note_0ng30ymp,
  author = {{iinventedlight}},
  title = {{Uploading to the Hub with huggingface\_hub}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-09},
  url = {https://iinventedlight.com/library/notes/hf-hub-upload-files/},
  note = {Permanent ID iil:note:0ng30ymp. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/hf-hub-upload-files.md.