- Status: complete
- Started: 2026-01-22
- Actions taken:
- 初始化空项目目录勘察(确认无既有代码/无 git)
- 读取并应用 planning-with-files / brainstorming 等本地技能说明
- 创建落盘规划文件:
task_plan.md、findings.md、progress.md
- Files created/modified:
task_plan.md(created)findings.md(created)progress.md(created)
- Status: in_progress
- Actions taken:
- 选择默认技术路线:字节级 tokenizer + 从零训练迷你 GPT + FastAPI(SSE) + React+TS Web UI
- 准备创建项目骨架与代码模块
- Files created/modified:
task_plan.md(updated)
- Status: complete
- Actions taken:
- 新增 Python 侧:
minillm包(tokenizer/model/train/serve) - 新增 Web 侧:Vite + React + TS 聊天 UI(支持 SSE 流式)
- 新增 Docker:
docker compose一键启动 API + Web(静态站)
- 新增 Python 侧:
- Files created/modified:
python/minillm/*(created)python/requirements.txt(created)web/*(created)docker/*(created)docker-compose.yml(created)README.md(updated)
- Status: complete
- Actions taken:
- 创建 venv 并安装依赖(含 torch)
- 生成样例数据集并完成 smoke 训练
- 启动 FastAPI 服务并用 curl 验证 /health 与 SSE
- Web 侧通过 TypeScript 严格检查与 Vite build
- Files created/modified:
python/.venv/(local)python/data/sample.jsonl(generated)python/checkpoints/smoke/(generated)
- Status: complete
- Actions taken:
- 新增
minillm_lora:用 Qwen2.5-0.5B-Instruct 做 LoRA SFT(Trainer + PEFT) - 用 offset_mapping 构造 labels(只监督 assistant 输出)
- 完成 LoRA smoke 训练并启动 LoRA API 服务验证(含 SSE)
- 新增
- Files created/modified:
python/minillm_lora/*(created)python/checkpoints_lora/smoke/(generated)
| Test | Input | Expected | Actual | Status |
|---|---|---|---|---|
| Generate dataset | python -m minillm.data --out data/sample.jsonl |
file created | ok | ✓ |
| Smoke train | python -m minillm.train ... --max-steps 5 |
checkpoint created | ok | ✓ |
| API health | curl http://127.0.0.1:8001/health |
{"status":"ok"} |
ok | ✓ |
| API completion | POST /v1/chat/completions |
JSON response | ok | ✓ |
| Web build | pnpm build |
build success | ok | ✓ |
| LoRA smoke train | python -m minillm_lora.train ... --max-steps 1 |
adapter saved | ok | ✓ |
| LoRA API health | curl http://127.0.0.1:8002/health |
{"status":"ok"} |
ok | ✓ |
| LoRA API completion | POST /v1/chat/completions stream=false |
coherent text | ok | ✓ |
| LoRA API streaming | POST /v1/chat/completions stream=true |
SSE deltas | ok | ✓ |
| Timestamp | Error | Attempt | Resolution |
|---|---|---|---|
| 2026-01-22 | Docker build: cannot connect to docker.sock | 1 | 本环境未启动 Docker daemon;已提供 Dockerfile/compose,需启动 Docker 后运行 docker compose up --build |
| Question | Answer |
|---|---|
| Where am I? | Phase 1 |
| Where am I going? | Phase 2-5 |
| What's the goal? | 训练迷你GPT并部署成Web可用聊天应用 |
| What have I learned? | See findings.md |
| What have I done? | See above |