huggingface-hub-skill_skill

This skill helps you work with Hugging Face Hub APIs and SDKs to manage models, datasets, spaces, and automation efficiently.

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill gary149/huggingface-hub-skill --skill huggingface-hub-skill

  • SKILL.md7.9 KB

Overview

This skill provides expert guidance for developing with the Hugging Face Hub ecosystem, covering HTTP/curl APIs, Python and JavaScript SDKs, Spaces apps (Gradio, Docker), model formats, datasets, automation, and security. It helps you upload/download repositories, run inference, configure Spaces, and automate workflows with practical examples and patterns. Use it when integrating Hub features into apps, CI/CD, or production pipelines.

How this skill works

The skill explains concrete API calls (curl and HTTP), SDK usage (huggingface_hub in Python and @huggingface/hub in JavaScript), and inference via InferenceClient. It shows repository operations (hf_hub_download, upload_file, snapshot_download), Space configuration (YAML and app files), dataset access (pandas, Polars, DuckDB), and formats like GGUF and PEFT/LoRA. It also covers automation (webhooks, Jobs), security (tokens, OAuth, scoping), and deployment considerations for reproducibility and resource selection.

When to use it

  • You need to upload or download models, weights, or datasets programmatically.
  • You want to call Hugging Face inference endpoints from server or curl.
  • You are building or configuring a Space (Gradio or Docker) for deployment.
  • You must load large datasets efficiently with Parquet via pandas/Polars/DuckDB.
  • You plan LoRA/PEFT workflows, GGUF conversion, or model quantization.
  • You need automation: webhooks, scheduled Jobs, or CI/CD integration.

Best practices

  • Store HF tokens in environment variables and use fine-grained tokens for production.
  • Prefer .safetensors for model weights and pin SDK versions in Spaces.
  • Add thorough model and dataset cards documenting use, limitations, and data sources.
  • Preload heavy models with preload_from_hub to reduce Space startup time.
  • Choose hardware to match workload (avoid OOM by selecting appropriate GPU/CPU).
  • Use Parquet for large dataset storage and query via DuckDB for interactive analysis.

Example use cases

  • Use hf_hub_download to fetch a specific model file for local inference in a script.
  • Create a Gradio Space that loads a pretrained transformer and serves a chat interface.
  • Invoke the InferenceClient with curl for chat completions or image generation in CI.
  • Deploy a LoRA adapter: find, load, merge, and upload the adapted model to the Hub.
  • Trigger retraining with a webhook that launches a Job or GitHub Actions workflow.

FAQ

Set HF_TOKEN as an environment variable, use fine-grained tokens, and avoid committing tokens to source control.

Which format should I use for model weights?

Use .safetensors where possible for safety and speed; document the format in the model card.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational