A simple distributed task execution system for GPU servers
Project description
PyLet
A simple distributed task execution system for GPU servers. Like Ray/K8s but much simpler.
Install
pip install pylet
For development:
git clone https://github.com/ServerlessLLM/pylet.git
cd pylet
pip install -e ".[dev]"
Quick Start
CLI
# Terminal 1: Start head node
pylet start
# Terminal 2: Start worker node with GPUs
pylet start --head localhost:8000 --gpu-units 4
# Terminal 3: Submit an instance
pylet submit 'vllm serve Qwen/Qwen2.5-1.5B-Instruct --port $PORT' \
--gpu-units 1 --name my-vllm
# Check status
pylet get-instance --name my-vllm
# Get endpoint for inference
pylet get-endpoint --name my-vllm
# Output: 192.168.1.10:15600
# View logs
pylet logs <instance-id>
# Cancel
pylet cancel <instance-id>
Python API
import pylet
# Connect to head node
pylet.init() # or pylet.init("http://head:8000")
# Submit an instance
instance = pylet.submit(
"vllm serve Qwen/Qwen2.5-1.5B-Instruct --port $PORT",
name="my-vllm",
gpu=1,
memory=4096,
)
# Wait for it to start
instance.wait_running()
print(f"Endpoint: {instance.endpoint}")
# Get logs
print(instance.logs())
# Cancel when done
instance.cancel()
instance.wait()
For local testing:
import pylet
with pylet.local_cluster(workers=2, gpu_per_worker=1) as cluster:
instance = pylet.submit("nvidia-smi", gpu=1)
instance.wait()
print(instance.logs())
Async API available via import pylet.aio as pylet.
See examples/README.md for more detailed examples including vLLM and SGLang.
Commands
| Command | Description |
|---|---|
pylet start |
Start head node |
pylet start --head <ip:port> --gpu-units N |
Start worker with N GPUs |
pylet submit <cmd> --gpu-units N --name <name> |
Submit instance |
pylet get-instance --name <name> |
Get instance status |
pylet get-endpoint --name <name> |
Get instance endpoint (host:port) |
pylet logs <id> |
View instance logs |
pylet logs <id> --follow |
Follow logs in real-time |
pylet cancel <id> |
Cancel instance |
pylet list-workers |
List registered workers |
Key Features
- Simple: No containers, no complex configs. Just
pylet startandpylet submit. - GPU-aware: Automatic GPU allocation via
CUDA_VISIBLE_DEVICES. - Service discovery: Instances get a
PORTenv var; endpoint available viaget-endpoint. - Real-time logs: Stream logs from running instances.
- Graceful shutdown: SIGTERM with configurable grace period before SIGKILL.
Requirements
- Python 3.9+
- Linux (tested on Ubuntu)
License
Apache 2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylet-0.2.0.tar.gz.
File metadata
- Download URL: pylet-0.2.0.tar.gz
- Upload date:
- Size: 60.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
844fd2c2f27872245b1db6c683371e62c77ae381b1685f0b6c0d0ab102ee216c
|
|
| MD5 |
80cc40aa4886f31113bbdc769ac0e3bf
|
|
| BLAKE2b-256 |
5b2f3047d2b973249d7993e70ee0f8fdb23f1d98baa40bcfb3dc95c295cf0bd6
|
Provenance
The following attestation bundles were made for pylet-0.2.0.tar.gz:
Publisher:
release.yml on ServerlessLLM/pylet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylet-0.2.0.tar.gz -
Subject digest:
844fd2c2f27872245b1db6c683371e62c77ae381b1685f0b6c0d0ab102ee216c - Sigstore transparency entry: 778979018
- Sigstore integration time:
-
Permalink:
ServerlessLLM/pylet@a5827087aef4a1c7a0e8d6c9e4726b6297d38f21 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ServerlessLLM
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a5827087aef4a1c7a0e8d6c9e4726b6297d38f21 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylet-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pylet-0.2.0-py3-none-any.whl
- Upload date:
- Size: 47.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edf287a9dd152a341a5dc483471267cf36f6b44d3e0502c5493113a38b30abb6
|
|
| MD5 |
e57ecee85df84e6a4c04a9882a116df4
|
|
| BLAKE2b-256 |
daf9d398ea197e3d0ae4739938be10cd22323c579f8bf387efa3de16e3e033b7
|
Provenance
The following attestation bundles were made for pylet-0.2.0-py3-none-any.whl:
Publisher:
release.yml on ServerlessLLM/pylet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylet-0.2.0-py3-none-any.whl -
Subject digest:
edf287a9dd152a341a5dc483471267cf36f6b44d3e0502c5493113a38b30abb6 - Sigstore transparency entry: 778979019
- Sigstore integration time:
-
Permalink:
ServerlessLLM/pylet@a5827087aef4a1c7a0e8d6c9e4726b6297d38f21 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ServerlessLLM
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a5827087aef4a1c7a0e8d6c9e4726b6297d38f21 -
Trigger Event:
push
-
Statement type: