hf-model-inference

Deploy HuggingFace models as Flask or FastAPI inference APIs.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/Zurybr/lefarma-skills --skill hf-model-inference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hf-model-inference
Source: https://github.com/Zurybr/lefarma-skills/tree/main/letta/benchmarks/trajectory-only/hf-model-inference
Command: npx skills add https://github.com/Zurybr/lefarma-skills --skill hf-model-inference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, torch, flask, fastapi, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a streamlined process for deploying pre-trained HuggingFace models as accessible inference services, enabling quick integration of NLP capabilities into applications.

Core Features & Use Cases

  • Model Deployment: Guides users through setting up Flask/FastAPI services for HuggingFace models.
  • Inference Endpoints: Facilitates the creation of REST APIs for tasks like sentiment analysis and text classification.
  • Use Case: You need to build a real-time sentiment analysis feature for user reviews. This skill helps you deploy a HuggingFace sentiment model as a service that your application can query.

Quick Start

Follow the steps in this skill to deploy a HuggingFace model as a Flask inference API.

Frequently Asked Questions about hf-model-inference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a HuggingFace model as an inference API?

To deploy a HuggingFace model as an inference API, you set up a Python service using FastAPI or Flask, download pre-trained transformers, and create RESTful endpoints for NLP tasks like sentiment analysis.

Can I use FastAPI and Flask to serve HuggingFace transformers?

Yes, you can use FastAPI and Flask to serve HuggingFace transformers. This Skill guides you through creating RESTful endpoints and implementing robust error handling during service operation for both frameworks.

What's the best way to create a sentiment analysis API using a pre-trained NLP model?

The best way to create a sentiment analysis API is downloading a pre-trained HuggingFace model and wrapping it in a Flask or FastAPI service to expose real-time inference endpoints for your applications.

Do I need PyTorch and Transformers to build a HuggingFace inference service?

Yes, you need PyTorch and Transformers to build a HuggingFace inference service. These dependencies handle downloading pre-trained models and executing NLP tasks like text classification within your API.

How do I handle errors when running a HuggingFace model inference service?

To handle errors when running a HuggingFace model inference service, implement robust error handling during service operation to manage exceptions during model loading and endpoint requests in FastAPI or Flask.