A newer version of the Gradio SDK is available:
5.42.0
metadata
title: huggingface-small-agent-test
app_file: app.py
sdk: gradio
sdk_version: 5.34.2
HuggingFace Smol-Agent Chatbot
A simple chatbot implementation using HuggingFace's smol-agent.
Setup
- Clone this repository
- Create a
.env
file based on.env.example
:cp .env.example .env
- Add your HuggingFace API token to the
.env
file
Usage
Install dependencies
uv pip install .
Run the CLI chatbot
python chatbot.py
Run the API server
python api.py
The API will be available at http://localhost:8000
API Endpoints
POST /chat: Send a message to the chatbot
- Request:
{"message": "Hello, how are you?"}
- Response:
{"response": "I'm doing well, thank you for asking!"}
- Request:
GET /health: Check if the API is running
- Response:
{"status": "ok"}
- Response: