hf-model-inference
Guidance for deploying HuggingFace models as inference APIs/services. This skill applies when tasks involve downloading pre-trained models from HuggingFace Hub, creating REST APIs for model inference, building Flask/FastAPI services around ML models, or setting up sentiment analysis, text classification, or other NLP inference endpoints.
npx skills add majiayu000/claude-skill-registry --skill hf-model-inference --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# HuggingFace Model Inference ## Overview This skill provides guidance for deploying HuggingFace Transformers models as inference services. Common use cases include creating REST APIs for sentiment analysis, text classification, named entity recognition, and other NLP tasks using pre-trained models from the HuggingFace Hub. ## Workflow ### Phase 1: Environment Setup 1. **Create project directory structure** - Establish a dedicated directory for the inference service - Plan for model storage (models can be large, ensure adequate disk space) 2. **Install dependencies** - Core packages: `transformers`, `torch` (or `tensorflow`), `flask`/`fastapi` - Check package manager availability (`pip`, `uv`, `conda`) before installing - Example: `pip install transformers torch flask` 3. **Download the model** - Use `transformers` library to download and cache the model - Consider downloading during service startup vs. as a separate step - Verify model download completed successfully before proceeding ### Phase 2: API Implementation 1. **Choose the inference approach** - **Pipeline API** (simpler): `pipeline("sentiment-analysis", model="model-name")` - **Direct model loading** (more control): `Aut
- Overview
- Workflow
- Phase 1: Environment Setup
- Phase 2: API Implementation
- Phase 3: Error Handling
- Phase 4: Testing and Verification
- Phase 5: Cleanup
- Common Pitfalls
- 1. File Write Truncation
- 2. Incomplete Error Testing
- 3. Premature Success Declaration
- 4. Leftover Artifacts
- 5. Missing Input Validation
- Efficient Workflow Practices
Test with verbose output including status code
curl -w "\nHTTP Status: %{http_code}\n" -X POST http://localhost:5000/endpoint \What does the hf-model-inference skill do?
Guidance for deploying HuggingFace models as inference APIs/services. This skill applies when tasks involve downloading pre-trained models from HuggingFace Hub, creating REST APIs for model inference, building Flask/FastAPI services around ML models, or setting up sentiment analysis, text classification, or other NLP inference endpoints.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill hf-model-inference --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
