🐍 Python Concept Tutor Chatbot
AI-powered Python tutor using free open-source HuggingFace models — no paid API needed!
📌 Overview
PyBot is an interactive Python tutoring chatbot powered by free open-source LLMs via the HuggingFace Inference API. No local GPU, no paid subscription — just a free HuggingFace account.
✨ Features
- 💬 AI Chat Tutor — Powered by Mistral, Llama, Phi-3, Zephyr, or Falcon
- 🤖 Model Selector — Switch between 5 open-source models in the sidebar
- 📚 24 Topic Browser — Beginner → Intermediate → Advanced Python topics
- 🧠 Quick Quiz — 6 questions with instant feedback and explanations
- 📖 Learning Path Tracker — Visual progress through the curriculum
- 🏆 Progress Bar — Track how many topics you've completed
🤖 Supported Models (all free)
| Model | Size | Best For |
|---|---|---|
| Mistral 7B Instruct v0.2 ⭐ | 7B | Best overall quality, recommended |
| Zephyr 7B Beta | 7B | Clear, structured responses |
| Llama 3.2 3B Instruct | 3B | Fast responses |
| Phi-3 Mini 4K Instruct | 3.8B | Compact, efficient |
| Falcon 7B Instruct | 7B | Alternative option |
🚀 Quick Start
1. Clone the repository
git clone https://github.com/pragatiusstudies/python-tutor-chatbot.git
cd python-tutor-chatbot2. Install dependencies
pip install -r requirements.txt
3. Get a FREE HuggingFace token
- Sign up at huggingface.co (free)
- Go to Settings → Tokens
- Click New token → select Read access → copy the token
4. Run the app
Open http://localhost:8501, paste your token in the sidebar, and start learning!
📁 Project Structure
python-tutor-chatbot/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies (only 2!)
└── README.md # Documentation
📦 Requirements
streamlit>=1.28.0
requests>=2.31.0
Only 2 dependencies — no heavyweight ML libraries needed!
💡 How It Works
User Question
↓
HuggingFace Inference API (cloud, free)
↓
Open-source LLM (Mistral / Llama / Phi-3 etc.)
↓
Structured Python lesson with explanation + code + quiz
No model downloads. No GPU. Runs entirely in the cloud.
📚 Topics Covered
Beginner: Variables, Strings, Lists, Dictionaries, Loops, Conditionals, Functions, Tuples & Sets
Intermediate: List Comprehensions, Lambdas, File I/O, Exception Handling, Modules, OOP, Decorators, Generators
Advanced: Context Managers, Metaclasses, Async/Await, Descriptors, Memory Management, Type Hints, Design Patterns, Performance
🤝 Contributing
PRs welcome! Ideas:
- Add more quiz questions
- Add code execution sandbox
- Add multi-turn conversation memory
👩💻 Author
Pragati Dharmale | CS Faculty, San Jose City College
📄 License
MIT License