Hugging Face Hub: upload a model repository

domain: huggingface.co/docs/hub · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install huggingface_hub and authenticate with huggingface-cli login using your User Access Token (write scope required).
  2. Create the remote repository if it does not exist: api.create_repo(repo_id='USERNAME/MODEL_NAME', repo_type='model', private=True).
  3. Save your model and tokenizer locally using model.save_pretrained(local_dir) and tokenizer.save_pretrained(local_dir).
  4. Upload the local directory with api.upload_folder(folder_path=local_dir, repo_id='USERNAME/MODEL_NAME', repo_type='model').
  5. Add a model card by creating a README.md in the local directory before uploading, or use ModelCard.push_to_hub() to create it separately.
  6. Verify the upload by navigating to the repository on the Hub and confirming all expected files appear.

Known gotchas

Related routes

Generate a model card for a Hugging Face Hub model following the modelcard metadata standard
huggingface.co/docs/hub · 5 steps · unrated
Download and run a Hugging Face model locally
huggingface.co · 4 steps · unrated
Hugging Face Inference Endpoints: deploy a model endpoint
huggingface.co/docs/inference-endpoints · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans