How kernelcero/bit-python-tutor works
Bit is a local, terminal-based Python mentor. A student enters a question or save command; the terminal delegates to PythonTutor, which can enrich questions with referenced Python files, sends tutoring context to Ollama, and persists conversation history. The save path extracts Python code from the latest response into exercise files. README capabilities such as line-by-line explanations and challenges are implemented through the model prompt. The graph reflects the two sampled runtime files; it does not infer undocumented flows from requirements.
Main entry points: tutor_logic.py Python tutor · main.py Terminal interface
Components 8
Terminal session
- Terminal interface
main.py
Mentoring runtime
- Python tutor
tutor_logic.py - Code context
tutor_logic.py - Teaching prompt
tutor_logic.py
Local learning data
- Conversation history
tutor_logic.py - Saved exercises
tutor_logic.py
AI engine
- Ollama model
Other components
- Student
Connections 9
- Student → Terminal interface: enters question
main.py - Terminal interface → Python tutor: sends message
main.py - Python tutor → Code context: reads Python files
tutor_logic.py - Python tutor → Conversation history: loads and saves
tutor_logic.py - Python tutor → Teaching prompt: sets instructions
tutor_logic.py - Python tutor → Ollama model: requests response
tutor_logic.py - Python tutor → Saved exercises: writes extracted code
tutor_logic.py - Python tutor → Terminal interface: returns response
main.py - Terminal interface → Student: displays answer
main.py