A simple conversational chatbot built with Python and the HuggingFace Inference API. It supports multi-turn conversations, meaning it remembers the context of your chat as you talk.
- Multi-turn conversation with memory
- Powered by HuggingFace Inference API
- Easy to configure with any supported chat model
- Lightweight — runs entirely in a Jupyter Notebook
- Python 3.8+
- Jupyter Notebook or JupyterLab
- A HuggingFace account and API token
git clone https://github.com/priya-dharshini-qa/hf-chatbot.git
cd hf-chatbotpip install huggingface_hubGet your token from huggingface.co/settings/tokens.
Windows:
set HF_TOKEN=your_token_hereMac/Linux:
export HF_TOKEN=your_token_here
⚠️ Never hardcode your token in the notebook or commit it to GitHub.
Open chatbot.ipynb in Jupyter and run the cells from top to bottom.
Once running, type your message at the You: prompt. The bot will respond and remember the conversation history. Type quit or exit to stop.
You: Hello!
Bot: Hi there! How can I help you today?
You: quit
Goodbye!
hf-chatbot/
├── chatbot.ipynb # Main notebook
├── .gitignore # Excludes secrets and cache files
└── README.md # Project documentation
MIT License — free to use and modify.
