MegaContext Lifecycle

This note provides a quick “you are here” map for the nanochat implementation. Use it to orient yourself, then jump to the detailed runbooks called out below. To avoid duplication, all commands and deep checklists live in Training & Operations and Base Runtime.


Flow Summary

StageWhat to doCanonical doc
1. Environment prepInstall uv/Python, activate venv, export WANDB/HF tokens, set NANOCHAT_BASE_DIRTraining & Operations
2. Training runPick run10.sh / speedrun.sh / run1000.sh, set WANDB_RUN, monitor telemetryTraining & Operations
3. Mid-run hygieneWatch ΔNLL/swap/residency, resume downloads, rebuild tokenizer if neededTraining & Operations
4. Post-run validationFollow the validation checklist (eval parity, report, checkpoints, chat smoke)Training & Operations
5. Runtime / demosRun scripts.chat_cli, scripts.chat_eval, scripts.chat_web on finished checkpointsBase Runtime
6. Hand-offLog results, update TODO.md, add WANDB links/checkpoint paths to PRD Progress TrackerTraining & Operations

Keep this table handy for quick orientation; follow the linked sections for the authoritative commands and troubleshooting guidance.