Install huggingface_hub and authenticate with huggingface-cli login using your User Access Token (write scope required).
Create the remote repository if it does not exist: api.create_repo(repo_id='USERNAME/MODEL_NAME', repo_type='model', private=True).
Save your model and tokenizer locally using model.save_pretrained(local_dir) and tokenizer.save_pretrained(local_dir).
Upload the local directory with api.upload_folder(folder_path=local_dir, repo_id='USERNAME/MODEL_NAME', repo_type='model').
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.
Verify the upload by navigating to the repository on the Hub and confirming all expected files appear.
Known gotchas
Large model files (above the Hub's LFS threshold, generally 10 MB) must go through Git LFS; the SDK handles this automatically, but a misconfigured local git-lfs installation can cause silent upload failures.
Tokens with only read scope cannot push to repositories; ensure the token has write (or fine-grained write) permissions.
Uploading an entire folder overwrites files that share the same name but does not delete files already in the repo that are absent locally; use delete_file() explicitly for removals.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp