Feature parity roadmap with Python huggingface_hub.

Current Status

Implemented

CategoryElixir FunctionPython EquivalentStatus
AuthHfHub.Auth.whoami/0whoami()Done
HfHub.Auth.login/1login()Done
HfHub.Auth.logout/0logout()Done
HfHub.Auth.get_token/0get_token()Done
HfHub.Auth.set_token/1-Done
HfHub.Auth.validate_token/1-Done
HfHub.Auth.auth_headers/1build_hf_headers()Done
ModelsHfHub.Api.list_models/1list_models()Done
HfHub.Api.model_info/2model_info()Done
DatasetsHfHub.Api.list_datasets/1list_datasets()Done
HfHub.Api.dataset_info/2dataset_info()Done
SpacesHfHub.Api.space_info/2space_info()Done
FilesHfHub.Api.list_files/2list_repo_files()Done
HfHub.Api.list_repo_tree/2list_repo_tree()Done
DatasetsHfHub.Api.dataset_configs/2get_dataset_config_names()Done
HfHub.Api.dataset_splits/2get_dataset_split_names()Done
HfHub.DatasetFiles.resolve/4get_dataset_files() (resolver)Done
DownloadHfHub.Download.hf_hub_download/1hf_hub_download()Done
HfHub.Download.snapshot_download/1snapshot_download()Done
HfHub.Download.download_stream/1-Done
HfHub.Download.resume_download/1-Done
CacheHfHub.Cache.cached?/1try_to_load_from_cache()Done
HfHub.Cache.cache_path/1-Done
HfHub.Cache.clear_cache/1scan_cache_dir() + deleteDone
HfHub.Cache.cache_stats/0scan_cache_dir()Done
HfHub.Cache.evict_lru/1delete_revisions()Done
HfHub.Cache.validate_integrity/0-Done
FSHfHub.FS.repo_path/2repo_folder_name()Done
HfHub.FS.file_path/4-Done
HfHub.FS.lock_file/2FileLockDone
ConfigHfHub.Config.endpoint/0ENDPOINTDone
HfHub.Config.cache_dir/0HF_HUB_CACHEDone

Roadmap

Priority: High

Essential for write operations and full Hub integration.

FeaturePython FunctionsNotes
Repository Management
Create repositorycreate_repo()POST /api/repos/create
Delete repositorydelete_repo()DELETE /api/repos/delete
Update repo settingsupdate_repo_settings()PUT /api/repos/{type}/{id}/settings
Move/rename repomove_repo()POST /api/repos/move
File Uploads
Upload single fileupload_file()Multipart upload or LFS
Upload folderupload_folder()Batch upload with commit
Create commitcreate_commit()POST /api/{type}/{id}/commit
Preupload LFSpreupload_lfs_files()LFS protocol implementation
Delete filedelete_file()Via commit operation
Delete folderdelete_folder()Via commit operation

Priority: Medium

Extended read operations and space management.

FeaturePython FunctionsNotes
Repository Info
Check repo existsrepo_exists()HEAD request
Check revision existsrevision_exists()HEAD request
Check file existsfile_exists()HEAD request
List repo refslist_repo_refs()Branches and tags
List repo commitslist_repo_commits()Commit history
Get paths infoget_paths_info()File metadata
Branching & Tagging
Create branchcreate_branch()POST /api/{type}/{id}/branch
Delete branchdelete_branch()DELETE /api/{type}/{id}/branch
Create tagcreate_tag()POST /api/{type}/{id}/tag
Delete tagdelete_tag()DELETE /api/{type}/{id}/tag
Spaces API
List spaceslist_spaces()GET /api/spaces
Get space runtimeget_space_runtime()Runtime status
Pause spacepause_space()POST /api/spaces/{id}/pause
Restart spacerestart_space()POST /api/spaces/{id}/restart
Duplicate spaceduplicate_space()POST /api/spaces/{id}/duplicate
Request hardwarerequest_space_hardware()GPU allocation
Set sleep timeset_space_sleep_time()Auto-sleep config
Space secretsadd/delete_space_secret()Environment variables
Space variablesadd/delete_space_variable()Public config

Priority: Low

Social features, discussions, and advanced functionality.

FeaturePython FunctionsNotes
Discussions & PRs
List discussionsget_repo_discussions()GET /api/{type}/{id}/discussions
Get discussion detailsget_discussion_details()Single discussion
Create discussioncreate_discussion()New discussion thread
Create pull requestcreate_pull_request()PR from branch
Comment on discussioncomment_discussion()Add comment
Merge pull requestmerge_pull_request()Merge PR
Change statuschange_discussion_status()Open/close
Collections
Get collectionget_collection()Collection metadata
Create collectioncreate_collection()New collection
Update collectionupdate_collection_metadata()Edit collection
Delete collectiondelete_collection()Remove collection
Add/remove itemsadd/delete_collection_item()Manage items
Webhooks
List webhookslist_webhooks()GET /api/webhooks
Create webhookcreate_webhook()POST /api/webhooks
Update webhookupdate_webhook()PATCH /api/webhooks/{id}
Delete webhookdelete_webhook()DELETE /api/webhooks/{id}
Enable/disableenable/disable_webhook()Toggle state
Social
Like repolike()POST /api/{type}/{id}/like
Unlike repounlike()DELETE /api/{type}/{id}/like
List liked reposlist_liked_repos()User's likes
List repo likerslist_repo_likers()Who liked a repo
User/Org Info
Get user overviewget_user_overview()User profile
Get org overviewget_organization_overview()Org profile
List followerslist_user_followers()Follower list
List followinglist_user_following()Following list
Inference
Inference endpointscreate/delete_inference_endpoint()Managed inference
Inference APIDirect API callsServerless inference
Misc
Get model/dataset tagsget_model_tags(), get_dataset_tags()Tag taxonomy
Paper infopaper_info()ArXiv paper metadata
Safetensors metadataget_safetensors_metadata()Tensor info

Implementation Order

Recommended order for implementing remaining features:

Phase 1: Write Operations (High Priority)
 create_repo / delete_repo
 upload_file (simple multipart)
 create_commit
 upload_folder

Phase 2: Repository Management (Medium Priority)
 repo_exists / file_exists
 list_repo_tree
 create_branch / delete_branch
 create_tag / delete_tag

Phase 3: Spaces (Medium Priority)
 list_spaces
 pause_space / restart_space
 Space secrets/variables

Phase 4: Social & Discussions (Low Priority)
 Discussions API
 Collections API
 Like/unlike, followers

For context on how hf_hub_ex fits into the broader ecosystem:

Python LibraryStarsDepends on huggingface_hubElixir Port Status
transformers154kYesNot started
diffusers32kYesNot started
datasets21kYesPlanned (crucible_datasets)
peft20kYesNot started
trl17kYesNot started
accelerate9kYesNot started
evaluate2kYesPlanned
tokenizers9kNo (Rust)Could use NIF
safetensors3kNo (Rust)Could use NIF
  1. hf_hub_ex (this library) - Hub API client
  2. datasets port - Dataset loading, integrates with crucible_datasets
  3. evaluate port - Metrics (BLEU, ROUGE, F1)
  4. tokenizers NIF - Rust bindings for fast tokenization
  5. safetensors NIF - Rust bindings for tensor loading

API Compatibility Notes

Endpoint Versions

  • /api/whoami-v2 - Required for modern tokens (not /api/whoami)
  • Download URLs require type prefix: datasets/{repo}, spaces/{repo}

Token Types

HuggingFace supports multiple token types:

  • Fine-grained tokens - Scoped permissions (recommended)
  • Write tokens - Full write access
  • Read tokens - Read-only access

Classic tokens deprecated December 2025. Use fine-grained tokens.

Rate Limits

  • /api/whoami-v2 is heavily rate-limited for security
  • Use cache: true option when calling repeatedly
  • File downloads have no practical limits

Contributing

Priority areas for contribution:

  1. Repository management (create/delete)
  2. File upload implementation
  3. Test coverage for existing features