Skip to main content

Module client

Module client 

Source
Expand description

HuggingFace Hub Client

Production-hardened client addressing review findings:

  • Rate limit handling (429 with exponential backoff)
  • SafeTensors enforcement (–safe-only default)
  • Model card auto-generation
  • Differential uploads (content-addressable)

Structs§

FileHash
File hash for content-addressable storage
ModelCardMetadata
Model card metadata
RateLimitConfig
Rate limit configuration
RateLimitState
Rate limit state for tracking backoff
SecretDetection
Secret detection result
UploadManifest
Manifest of files for differential upload

Enums§

FileSafety
File safety classification
SafetyPolicy
Safety policy for model downloads
SecretType
Detected secret type

Functions§

check_download_allowed
Check if download should be allowed based on policy
check_push_allowed
Check if push should be blocked due to secrets
classify_file_safety
Classify file safety based on extension
generate_model_card
Generate model card content
scan_for_secrets