[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-765":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":29,"discoverSource":30},765,"pyre-code","whwangovo\u002Fpyre-code","whwangovo","A self-hosted ML coding practice platform. 68 problems from ReLU to flow matching — attention, training, RLHF, diffusion, and more. Instant feedback in the browser.",null,"Python",1134,103,2,4,0,12,27,126,36,19.05,"Other",false,"main",true,[],"2026-06-12 02:00:18","[English](.\u002FREADME.md) | [中文](.\u002FREADME_CN.md)\n\n\u003Cp align=\"center\">\n  \u003Ch1 align=\"center\">🔥 Pyre Code\u003C\u002Fh1>\n  \u003Cp align=\"center\">\n    Implement the internals of modern AI systems from scratch — Transformers, vLLM, TRL, and beyond.\n  \u003C\u002Fp>\n  \u003Cp align=\"center\">\n    \u003Cem>Read the paper, then write the code. No GPU required.\u003C\u002Fem>\n  \u003C\u002Fp>\n  \u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#whwangovo\u002Fpyre-code&Date\">\n      \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fwhwangovo\u002Fpyre-code?style=social\" alt=\"GitHub stars\" \u002F>\n    \u003C\u002Fa>\n  \u003C\u002Fp>\n\u003C\u002Fp>\n\n---\n\n## 🧠 What is Pyre Code?\n\n76 problems. You write the implementation, a local grading service runs the tests, you see what broke. That's it.\n\nThe problems cover what's actually inside Transformers, vLLM, TRL, diffusion models, and GNNs — attention variants, training tricks, inference kernels, alignment algorithms, graph neural networks. No GPU needed.\n\n### Who is this for?\n\n- **Preparing for ML interviews** — practice implementing core components under test, not just reading about them\n- **Learning by building** — if you learn best by writing code rather than watching lectures, this is your gym\n- **Deepening your understanding** — you've used `nn.MultiheadAttention`, now write it yourself\n\n### Features\n\n- **Browser editor** — Monaco with Python syntax highlighting, no IDE setup\n- **Instant feedback** — submit and see pass\u002Ffail per test case in seconds\n- **Reference solutions** — compare after your own attempt\n- **Progress tracking** — solved count and attempt history, persisted across sessions\n- **AI Help** — optional AI-powered hints via any OpenAI-compatible API (configure in `.env` or per-user in the UI)\n- **Fully local** — nothing leaves your machine (unless you opt into AI Help)\n\n### Tech Stack\n\n| Layer        | Technology                                                                           |\n| ------------ | ------------------------------------------------------------------------------------ |\n| Frontend     | Next.js + Monaco Editor + Tailwind CSS                                               |\n| Backend      | FastAPI grading service                                                              |\n| Judge Engine | [torch_judge](https:\u002F\u002Fgithub.com\u002Fduoan\u002FTorchCode) — executes and validates submissions |\n| Storage      | SQLite (progress tracking)                                                           |\n\n---\n\n## 📢 News\n\n- **[2026\u002F04\u002F20]** New GNN learning path — 8 problems covering GCN, GAT, GIN, MPNN, GraphSAGE, link prediction, and graph autoencoders. 🔥\n- **[2026\u002F04\u002F20]** New UI redesign with OKLch color system, dark mode, and Geist typography — classic design still available via toggle. 🔥\n- **[2026\u002F04\u002F13]** Submission history — review all your past attempts per problem.\n- **[2026\u002F04\u002F10]** AI Help — optional AI-powered hints via any OpenAI-compatible API. 🔥\n- **[2026\u002F04\u002F10]** Print output capture — `print()` statements now show in test results.\n- **[2026\u002F04\u002F09]** 68 problems covering Transformers, vLLM, TRL, diffusion models, and more. 🔥\n- **[2026\u002F04\u002F09]** Initial release of Pyre Code 🎉\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Python 3.11+\n- Node.js 18+\n\n### Installation\n\n**Option A — one-liner (recommended)**\n\nmacOS \u002F Linux:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fwhwangovo\u002Fpyre-code.git\ncd pyre-code\n.\u002Fsetup.sh\nnpm run dev\n```\n\nWindows (PowerShell):\n\n```powershell\ngit clone https:\u002F\u002Fgithub.com\u002Fwhwangovo\u002Fpyre-code.git\ncd pyre-code\n.\\setup.ps1\nnpm run dev\n```\n\nWindows (CMD):\n\n```cmd\ngit clone https:\u002F\u002Fgithub.com\u002Fwhwangovo\u002Fpyre-code.git\ncd pyre-code\nsetup.bat\nnpm run dev\n```\n\nThe setup script automatically creates a `.venv` Python environment (prefers `uv`, falls back to `python -m venv`), installs all dependencies, then prints the start command.\n\nWhen `.venv` exists, `npm run dev` prefers that project-local Python automatically. If `.venv` is missing, it falls back to the current shell's `python`.\n\n**Option B — conda**\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fwhwangovo\u002Fpyre-code.git\ncd pyre-code\nconda create -n pyre python=3.11 -y && conda activate pyre\npip install -e \".[dev]\"\nnpm install\nnpm run dev   # run with conda env activated\n```\n\n**Option C — manual (venv)**\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fwhwangovo\u002Fpyre-code.git\ncd pyre-code\n\n# create a Python env — pick one:\nuv venv --python 3.11 .venv && source .venv\u002Fbin\u002Factivate && uv pip install -e \".[dev]\"\n# or: python3 -m venv .venv && source .venv\u002Fbin\u002Factivate && pip install -e \".[dev]\"\n# Windows: python -m venv .venv && .venv\\Scripts\\activate && pip install -e \".[dev]\"\n\nnpm install\nnpm run dev\n```\n\nEither way, once running:\n\n- **Grading service** → `http:\u002F\u002Flocalhost:8000`\n- **Web app** → `http:\u002F\u002Flocalhost:3000`\n\n**Option D — Docker**\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fwhwangovo\u002Fpyre-code.git\ncd pyre-code\ndocker compose up --build\n```\n\nOpen `http:\u002F\u002Flocalhost:3000`. Progress is persisted in a Docker volume. Run `docker compose down -v` to reset.\n\n### AI Help (optional)\n\nTo enable server-side AI hints, copy `web\u002F.env.example` to `web\u002F.env` and fill in:\n\n```bash\nAI_HELP_BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\nAI_HELP_API_KEY=sk-...\nAI_HELP_MODEL=gpt-4o-mini\n```\n\nAny OpenAI-compatible endpoint works (OpenAI, Anthropic via proxy, Ollama, etc.). Users can also configure their own API key in the UI if no server-side config is set.\n\n---\n\n## 📋 Problem Set\n\n76 problems organized by category:\n\n| Category | Problems |\n|---|---|\n| **Fundamentals** | ReLU, Softmax, GELU, SwiGLU, Dropout, Embedding, Linear, Kaiming Init, Linear Regression |\n| **Normalization** | LayerNorm, BatchNorm, RMSNorm |\n| **Attention** | Scaled Dot-Product, Multi-Head, Causal, Cross, GQA, Sliding Window, Linear, Flash, Differential, MLA |\n| **Position Encoding** | Sinusoidal PE, RoPE, ALiBi, NTK-aware RoPE |\n| **Architecture** | SwiGLU MLP, GPT-2 Block, ViT Patch, ViT Block, Conv2D, Max Pool, Depthwise Conv, MoE, MoE Load Balance |\n| **Training** | Adam, Cosine LR, Gradient Clipping, Gradient Accumulation, Mixed Precision, Activation Checkpointing |\n| **Distributed** | Tensor Parallel, FSDP, Ring Attention |\n| **Inference** | KV Cache, Top-k Sampling, Beam Search, Speculative Decoding, BPE, INT8 Quantization, Paged Attention |\n| **Loss & Alignment** | Cross Entropy, Label Smoothing, Focal Loss, Contrastive Loss, DPO, GRPO, PPO, Reward Model |\n| **Diffusion & DiT** | Noise Schedule, DDIM Step, Flow Matching, adaLN-Zero |\n| **Adaptation** | LoRA, QLoRA |\n| **Reasoning** | MCTS, Multi-Token Prediction |\n| **SSM** | Mamba SSM |\n| **Graph Neural Networks** | GCN, Graph Readout, GAT, GIN, MPNN, GraphSAGE, Link Prediction, Graph Autoencoder |\n\n### Learning Paths\n\nPick one based on what you're working toward:\n\n| Path | Problems | Description |\n|---|---|---|\n| **Transformer Internals** | 12 | Activations → Normalization → Attention → GPT-2 Block |\n| **Attention & Position Encoding** | 13 | Every attention variant + RoPE, ALiBi, NTK-RoPE |\n| **Train a GPT from Scratch** | 15 | Embeddings → architecture → loss → optimizer → training tricks |\n| **Inference & Distributed Training** | 9 | KV cache, quantization, sampling, tensor parallel, FSDP |\n| **Alignment & Agent Reasoning** | 6 | Reward model → DPO → GRPO → PPO → MCTS |\n| **Vision Transformer Pipeline** | 7 | Conv → patch embedding → ViT block |\n| **Diffusion Models & DiT** | 5 | Noise schedule → DDIM → flow matching → adaLN-Zero |\n| **LLM Frontier Architectures** | 7 | GQA, Differential Attention, MLA, MoE, Multi-Token Prediction |\n| **Graph Neural Networks** | 8 | GCN → GAT → GIN → MPNN → GraphSAGE → Link Prediction → GAE |\n\n```\nNot sure where to start?\n\nFundamentals ──→ Transformer Internals ──→ Train a GPT from Scratch\n                       │                          │\n                       ▼                          ▼\n              Attention & Position       Inference & Distributed\n                       │                          │\n                       ▼                          ▼\n              LLM Frontier Archs         Alignment & Reasoning\n                       │\n               ┌───────┼───────┐\n               ▼       ▼       ▼\n     Vision Trans.  Diffusion  Graph Neural Networks\n```\n\n---\n\n## ⚙️ Configuration\n\n| Variable                | Default                   | Description                           |\n| ----------------------- | ------------------------- | ------------------------------------- |\n| `GRADING_SERVICE_URL` | `http:\u002F\u002Flocalhost:8000` | Grading service URL                   |\n| `DB_PATH`             | `.\u002Fdata\u002Fpyre.db`   | SQLite database for progress tracking |\n\nSet in `web\u002F.env.local` to override.\n\n---\n\n## 📁 Project Structure\n\n```\npyre\u002F\n├── web\u002F                  # Next.js frontend\n│   ├── src\u002Fapp\u002F          # Pages and API routes\n│   ├── src\u002Fcomponents\u002F   # UI components\n│   └── src\u002Flib\u002F          # Utilities, problem data\n├── grading_service\u002F      # FastAPI backend\n├── torch_judge\u002F          # Judge engine (problem definitions + test runner)\n└── package.json          # Dev scripts (runs frontend + backend concurrently)\n```\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Here are some ways you can help:\n\n- **Submit a new problem** — open a PR with the problem definition and test cases in `torch_judge\u002F`\n- **Report a bug** — [open an issue](https:\u002F\u002Fgithub.com\u002Fwhwangovo\u002Fpyre-code\u002Fissues) with steps to reproduce\n- **Fix a bug** — fork, fix, and submit a PR\n- **Improve docs** — typos, clarifications, translations\n\nPlease open an issue first for larger changes so we can discuss the approach.\n\n---\n\n## ⭐ Star History\n\n![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fwhwangovo\u002Fpyre-code?style=social)\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=whwangovo\u002Fpyre-code&type=Date)](https:\u002F\u002Fstar-history.com\u002F#whwangovo\u002Fpyre-code&Date)\n\n---\n\n## 🙏 Acknowledgements\n\nProblem set and judge engine based on [TorchCode](https:\u002F\u002Fgithub.com\u002Fduoan\u002FTorchCode) by [duoan](https:\u002F\u002Fgithub.com\u002Fduoan), licensed under MIT.\n\n---\n\n## 📄 License\n\nDistributed under the MIT License. See [LICENSE](LICENSE) for more information.\n","Pyre Code 是一个自托管的机器学习编程实践平台，提供68个从ReLU到流匹配等主题的问题，涵盖注意力机制、训练技巧、强化学习、扩散模型等内容。用户可以在浏览器中直接编写代码，并即时获得反馈，无需GPU支持。其核心技术包括前端采用Next.js和Monaco编辑器，后端使用FastAPI进行评分服务，以及基于torch_judge引擎执行和验证提交。此外，它还支持进度跟踪、AI辅助提示等功能。该平台适合准备机器学习面试、希望通过实际编码加深理解的学习者，以及任何希望在实践中提升自己对现代AI系统内部工作原理认识的人士。","2026-06-11 02:39:11","CREATED_QUERY"]