AI-powered Python tutor using free open-source HuggingFace models — no paid API needed!
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.
- 💬 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
| 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 |
git clone https://github.com/pragatiusstudies/python-tutor-chatbot.git
cd python-tutor-chatbotpip install -r requirements.txt- Sign up at huggingface.co (free)
- Go to Settings → Tokens
- Click New token → select Read access → copy the token
streamlit run app.pyOpen http://localhost:8501, paste your token in the sidebar, and start learning!
python-tutor-chatbot/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies (only 2!)
└── README.md # Documentation
streamlit>=1.28.0
requests>=2.31.0
Only 2 dependencies — no heavyweight ML libraries needed!
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.
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
PRs welcome! Ideas:
- Add more quiz questions
- Add code execution sandbox
- Add multi-turn conversation memory
Pragati Dharmale | CS Faculty, San Jose City College
MIT License