Skip to main content

A simple distributed task execution system for GPU servers

Project description

PyLet

PyPI version Python versions License

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 start and pylet submit.
  • GPU-aware: Automatic GPU allocation via CUDA_VISIBLE_DEVICES.
  • Service discovery: Instances get a PORT env var; endpoint available via get-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

pylet-0.3.0.tar.gz (74.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylet-0.3.0-py3-none-any.whl (56.7 kB view details)

Uploaded Python 3

File details

Details for the file pylet-0.3.0.tar.gz.

File metadata

  • Download URL: pylet-0.3.0.tar.gz
  • Upload date:
  • Size: 74.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylet-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d17e4e19e9a3239f9a6c7d8d0c3750c49d46d2028cf39430611b69df3bef8fa1
MD5 541eca13ffe05e3af7500c154aaa3526
BLAKE2b-256 2786e3fcedcb94636963875b94dadecac794cfc50ec1147d7ddcd0bb1a0a3f5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylet-0.3.0.tar.gz:

Publisher: release.yml on ServerlessLLM/pylet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylet-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pylet-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 56.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylet-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88602f89f3307a999740959fe2d49754ad04dee7d3591ae9ccfb7fbd5f4f5e50
MD5 6d5c2ade50b91034b27b870b37a2ab20
BLAKE2b-256 f66623686360de8c65c95cbaeaf26dda68a61904f7b4cc0910ddce62078aa547

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylet-0.3.0-py3-none-any.whl:

Publisher: release.yml on ServerlessLLM/pylet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page