All notable changes to PyLet will be documented in this file.
-
Instance Deletion: Full deletion support for instances
instance.cancel(delete=True)to cancel and delete in one callpylet delete-instance <id>CLI command- Removes instance from database entirely
-
Worker Deletion: Delete OFFLINE workers from the cluster
pylet delete-worker <id>CLI command- Only works for workers in OFFLINE status
-
Graceful Worker Shutdown: Workers now notify head node on shutdown
- Proper cleanup on Ctrl+C signal
- Worker exits cleanly without orphaned state
-
Configurable Ports: Instance port range derived from worker HTTP port
- More flexible port allocation for services
- Worker HTTP port correctly stored and used for log retrieval
- Worker exits properly on Ctrl+C signal
- Auto-generated instance name aligned with original behavior
- Architecture Documentation: Comprehensive system architecture docs in
docs/architecture.md- System overview with ASCII diagrams
- Instance lifecycle and worker status transitions
- Core components breakdown (Head Node, Worker Node, Client Libraries)
- Key design patterns (Long-Poll Heartbeat, Generation-Based Change Detection, Attempt-Based Fencing)
- Contributing Guidelines: Added
CONTRIBUTING.mdwith development workflow - Updated API and CLI reference documentation
- Added development tooling: ruff, mypy, pre-commit
- Applied consistent code formatting with black and ruff
- Type annotation modernization across codebase
venvparameter: Activate a pre-existing Python virtualenv for instance execution- CLI:
pylet submit "python train.py" --venv /path/to/venv - Python API:
pylet.submit("python train.py", venv="/path/to/venv") - Solves environment isolation between worker and instances
- Users are responsible for creating/maintaining venvs on shared filesystem
- CLI:
- Added
venvfield toInstanceSubmissionRequest,Instance, andDesiredInstanceschemas - Worker activates venv via
source {venv}/bin/activate && {command} - Path validation: must be absolute path, no
..allowed - 46 new tests for comprehensive coverage
- Advanced GPU Allocation: Storage-aware GPU scheduling for inference instances
gpu_indicesin instance response (expose physical GPU assignment)target_workerparameter (explicit node placement)gpu_indicesin submission (request specific GPUs)exclusiveflag (non-exclusive GPU allocation for shared daemons)labels+ filtering (custom metadata, e.g.,model_id)envparameter in submission (custom environment variables)available_gpu_indicesin worker response (which specific GPUs are free)
- TOML Configuration File Support: Load settings from
pylet.tomlor~/.config/pylet/config.toml
PyLet is a simple distributed task execution system for GPU servers. Like Ray/K8s but much simpler.
- Head/Worker Architecture: Distributed system with a head node for coordination and worker nodes for execution
- GPU-aware Scheduling: Automatic GPU allocation via
CUDA_VISIBLE_DEVICESenvironment variable - Service Discovery: Instances receive a
PORTenvironment variable; endpoints discoverable viaget-endpointcommand - Real-time Logs: Stream logs from running instances with
pylet logs --follow - Graceful Shutdown: SIGTERM with configurable grace period before SIGKILL
- SQLite Persistence: State survives head node restarts (WAL mode for performance)
- Long-poll Heartbeats: Efficient worker-controller communication with generation-based protocol
- Attempt-based Fencing: Correctness guarantees for instance execution
pylet start- Start head nodepylet start --head <ip:port> --gpu-units N- Start worker with N GPUspylet submit <cmd> --gpu-units N --name <name>- Submit instancepylet get-instance --name <name>- Get instance statuspylet get-endpoint --name <name>- Get instance endpoint (host:port)pylet logs <id>- View instance logspylet logs <id> --follow- Follow logs in real-timepylet cancel <id>- Cancel instancepylet list-workers- List registered workers
- Python 3.9, 3.10, 3.11, 3.12, 3.13
- FastAPI for REST API
- Pydantic v2 for data validation
- aiosqlite for async database access
- httpx for async HTTP client
- aiohttp for worker HTTP server
- Click for CLI