pyre-code-ml-practice
БесплатноБез исполняемых скриптовНе проверенSelf-hosted ML coding practice platform with 68 problems covering Transformers, diffusion, RLHF, and more — instant browser feedback, no GPU required.
от reason-machines★ 99 звёзд на GitHubОб этом скилле
Pyre Code ML Practice Platform
Skill by ara.so — Daily 2026 Skills collection.
Pyre Code is a self-hosted ML coding practice platform with 68 problems ranging from ReLU to flow matching. Users implement internals of modern AI systems (Transformers, vLLM, TRL, diffusion models) in a browser editor with instant pass/fail feedback, no GPU required.
Installation
Option A — One-liner (recommended)
git clone https://github.com/whwangovo/pyre-code.git
cd pyre-code
./setup.sh
npm run dev
setup.sh creates a .venv (prefers uv, falls back to python3 -m venv), installs all Python deps, then prints the start command.
Option B — Conda
git clone https://github.com/whwangovo/pyre-code.git
cd pyre-code
conda create -n pyre python=3.11 -y && conda activate pyre
pip install -e ".[dev]"
npm install
npm run dev
Option C — Docker
git clone https://github.com/whwangovo/pyre-code.git
cd pyre-code
docker compose up --build
Progress persists in a Docker volume. Reset with docker compose down -v.
After installation
- Grading service:
http://localhost:8000 - Web app:
http://localhost:3000
Project Structure
pyre/
├── web/ # Next.js frontend
│ ├── src/app/ # Pages and API routes
│ ├── src/components/ # UI components
│ └── src/lib/ # Utilities, problem data
├── grading_service/ # FastAPI backend (grading API)
├── torch_judge/ # Judge engine — problem definitions + test runner
│ ├── problems/ # Individual problem modules
│ └── runner.py # Test execution logic
├── setup.sh # Environment bootstrap script
├── package.json # Dev scripts (runs frontend + backend concurrently)
└── pyproject.toml # Python package config
Key Commands
# Start both frontend and backend concurrently
npm run dev
# Start only the grading service (FastAPI)
cd grading_service && uvicorn main:app --reload --port 8000
# Start only the frontend (Next.js)
cd web && npm run dev
# Run Python tests
pytest torch_judge/
# Install Python package in editable mode with dev deps
pip install -e ".[dev]"
# Docker: build and start
docker compose up --build
# Docker: stop and remove volumes (reset progress)
docker compose down -v
Configuration
Environment Variables
Create web/.env.local to override defaults:
# URL of the FastAPI grading service
GRADING_SERVICE_URL=http://localhost:8000
# SQLite database path for progress tracking
DB_PATH=./data/pyre.db
AI Help (Optional)
Copy web/.env.example to web/.env and configure:
AI_HELP_BASE_URL=https://api.openai.com/v1
AI_HELP_API_KEY=$OPENAI_API_KEY
AI_HELP_MODEL=gpt-4o-mini
Any OpenAI-compatible endpoint works: OpenAI, Anthropic via proxy, Ollama, etc. Users can also set their own key in the UI if no server-side config is present.
Problem Categories
| Category | Examples |
|---|---|
| Fundamentals | ReLU, Softmax, GELU, SwiGLU, Dropout, Embedding, Linear, Kaiming Init |
| Normalization | LayerNorm, BatchNorm, RMSNorm |
| Attention | Scaled Dot-Product, Multi-Head, Causal, GQA, Flash, Differential, MLA |
| Position Encoding | Sinusoidal PE, RoPE, ALiBi, NTK-aware RoPE |
| Architecture | GPT-2 Block, ViT Block, Conv2D, MoE, Depthwise Conv |
| Training | Adam, Cosine LR, Gradient Clipping, Mixed Precision, Activation Checkpointing |
| Distributed | Tensor Parallel, FSDP, Ring Attention |
| Inference | KV Cache, Top-k Sampling, Beam Search, Speculative Decoding, Paged Attention |
| Alignment | DPO, GRPO, PPO, Reward Model |
| Diffusion | Noise Schedule, DDIM Step, Flow Matching, adaLN-Zero |
| Adaptation | LoRA, QLoRA |
| Reasoning | MCTS, Multi-Token Prediction |
| SSM | Mamba SSM |
Adding a New Problem
Problems live in torch_judge/problems/. Each problem is a Python module with a standard structure:
# torch_judge/problems/my_new_problem.py
import torch
import torch.nn as nn
from typing import Any
PROBLEM_ID = "my_new_problem"
TITLE = "My New Problem: Implement Foo"
DIFFICULTY = "medium" # "easy" | "medium" | "hard"
CATEGORY = "Fundamentals"
DESCRIPTION = """
## My New Problem
Implement the `foo` function that does XYZ.
### Input
- `x` (Tensor): shape `(batch, dim)`
### Output
- Tensor of shape `(batch, dim)`
### Formula
$$\\text{foo}(x) = x^2 + 1$$
"""
STARTER_CODE = """
import torch
def foo(x: torch.Tensor) -> torch.Tensor:
# Your implementation here
pass
"""
REFERENCE_SOLUTION = """
import torch
def foo(x: torch.Tensor) -> torch.Tensor:
return x ** 2 + 1
"""
def make_test_cases() -> list[dict[str, Any]]:
\"\"\"Return a list of test cases, each with inputs and expected outputs.\"\"\"
cases = []
# Basic case
x = torch.tensor([[1.0, 2
Установить pyre-code-ml-practice в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pyre-code-ml-practice?
Self-hosted ML coding practice platform with 68 problems covering Transformers, diffusion, RLHF, and more — instant browser feedback, no GPU required.
Как установить скилл pyre-code-ml-practice?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pyre-code-ml-practice запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic