Skip to content

AI Coding Teacher

An interactive Streamlit app that acts as an AI coding mentor. It adapts to user skill level, analyzes questions, streams step-by-step explanations with examples, auto-continues long answers. Powered by the GPT-5 model through the AIML API.

Core trick

Streamlit app auto-continues replies that hit the token limit and summarizes older turns to preserve context.

Tags

Description

$26
Subhan-2004/AI-Coding-Teacher★ 00 forksPythonMITCreated Aug 20, 2025 · last push Aug 22, 2025

README excerpt

# AI Coding Teacher

An interactive Streamlit app that acts as a patient, Socratic AI mentor for learning programming. It adapts depth by level, explains pasted code, suggests improvements, generates exercises, tracks topical progress, summarizes long chats, streams responses, and auto‑continues when truncated.

---

## 🚀 Features

- Teaching modes: Beginner / Intermediate / Advanced (adaptive tone & depth)
- Code detection → explanation, issues, refactors, practice task
- Periodic conversation summarization to preserve context window
- Streaming responses with live typing effect
- Auto continuation when reply hits token limit
- Adjustable generation controls (temperature, top‑p, max output tokens, max continuations)
- Lightweight topic progress tracking
- Token budget estimation (optional `tiktoken`)
- Download full chat history as JSON
- Safe context management with buffer

---

## 🧱 Tech Stack

| Layer | Tools |
|-------|-------|
| UI | Streamlit |
| Model API | OpenAI‑compatible endpoint (`openai` Python client) |
| Language | Python 3.10+ |
| Optional | `tiktoken` for token counting |

---

## 📁 Project Structure
```
app.py          Main Streamlit application
utils.py        Chat history init + export helpers
requirements.txt Dependencies
progress.json   Created at runtime (topics)
screenshots/    (Add your images)
```
---

## 🔑 Environment Configuration

To run this app, you need an API key from "aimlapi.com".
Set your API key (choose one method):

Shell:
```bash
export

Team