Skip to main content

Make GPU infrastructure programmable: provision GPUs, deploy open-source LLMs, serve OpenAI-compatible inference.

Project description

open-lease

Make GPU infrastructure programmable. Provision GPUs, deploy open-source LLMs, manage their lifecycle with a reconcile loop, and serve inference through an OpenAI-compatible API. One orchestration core, thin interfaces over it. RunPod is Provider #1.

The product is the orchestration layer, not the provider: two seams (Provider, Runtime), one facade (Orchestrator), one vocabulary (DeploymentState), one contract (models.py). A deployment is driven by a reconcile loop comparing desired vs observed state, so interruption and crash recovery are free, and the cost-safety invariant (no orphaned pods burning money) holds by construction.

Status: beta. The engine is validated against real RunPod (deploy, kill-and-recover, crash-resume, orphan sweep, concurrent deploys, runtime-crash cap). Not yet on PyPI, single provider, and the §18 24h soak remains. See What's not done.

Quickstart

The base install is the engine, CLI, and the OpenAI proxy. The REST API and MCP server are optional extras (open-lease[api], open-lease[mcp], or open-lease[all]) so the core stays lean.

# install from source (not on PyPI yet)
git clone https://github.com/mfbaig35r/open-lease && cd open-lease
uv sync                    # base: CLI + proxy. Add: --extra all  (REST API + MCP)

# credentials (see docs/configuration.md)
cp .env.example .env      # then set RUNPOD_API_KEY (and optionally HF_TOKEN)

gpu models                                  # the model catalog
gpu availability qwen3-0.6b                 # which data centers can run it right now
gpu deploy qwen3-0.6b --wait                # provision + wait for READY
gpu status                                  # id, state, endpoint, uptime, accrued $
gpu stop <id>                               # tear down; verify with `gpu status`

First deploy of a model is download-bound: the vLLM image and the weights are pulled onto an ephemeral disk, so a small model is ready in a few minutes and a large one takes longer. An opt-in model cache (cache_volume_enabled) makes warm redeploys fast. gpu status shows a percent or an elapsed/budget ETA so a cold start never looks stuck.

Talk to a deployed model

gpu proxy                                   # OpenAI-compatible proxy on :8080 (another terminal)
curl localhost:8080/v1/chat/completions \
  -H 'content-type: application/json' \
  -d '{"model":"qwen3-0.6b","messages":[{"role":"user","content":"hi"}]}'

The proxy routes by the request model field (catalog id or HF repo) to the matching READY deployment. Or hit deployment.endpoint_url from gpu status directly.

Run it in the background

gpu up            # start the daemon (reconcile/health/orphan sweep) and proxy, detached
gpu deploy qwen3-0.6b     # non-blocking; the daemon drives it to READY
gpu down          # stop both

How it works

  • Core (core/): orchestrator.py (the §7.1 facade), reconciler.py (the reconcile loop), health.py, costs.py, catalog.py, daemon.py.
  • Provider seam (providers/): provisions compute, knows nothing about LLMs. RunPod + an in-memory mock; new providers are an ABC + a dict entry, verified by one contract suite.
  • Runtime seam (runtimes/): serves a model on compute, knows nothing about providers. vLLM.
  • Interfaces: the gpu CLI, a REST API (gpu serve, routes mirroring the Orchestrator, the OpenAI proxy mounted at /v1/*, auto-docs at /docs), and an MCP server (gpu-mcp, agent-facing tools over the same core). A Swamp extension is specified for later and consumes the REST API.

See docs/architecture.md for the full picture, and requirements/gpu-orchestrator-requirements.md for the authoritative spec.

Docs

What's not done

  • Not published to PyPI (install from source).
  • RunPod is the only real provider; the seam is proven but no second provider yet.
  • The catalog is small: qwen3-0.6b / qwen3-8b / qwen3-32b are validated on real hardware; llama-3.1-8b is unvalidated (Meta gating, HF access pending).
  • Gauntlet §18: the 24h soak is not yet run. OOM/terminal-failed is closed (a runtime-crash cap drives a persistently-failing deploy to terminal FAILED; covered by an offline test).
  • The warm-cache speedup is proven mechanically but its timing is capacity-pending.

Development

uv sync --extra dev
uv run python -m pytest tests/ -q
uv run ruff check src/ tests/ && uv run ruff format --check src/ tests/

The gpu CLI and gpu_orchestrator import package keep their names for now; the distribution is open-lease. See CONTRIBUTING.md for the dev setup, architecture constraints, and how to add a provider; build order and non-negotiable rules are in CLAUDE.md.

License

Apache-2.0. See LICENSE.

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

open_lease-0.1.0.tar.gz (96.5 kB view details)

Uploaded Source

Built Distribution

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

open_lease-0.1.0-py3-none-any.whl (77.0 kB view details)

Uploaded Python 3

File details

Details for the file open_lease-0.1.0.tar.gz.

File metadata

  • Download URL: open_lease-0.1.0.tar.gz
  • Upload date:
  • Size: 96.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for open_lease-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2572c406db12adb5a1bf267844e874ea94239722b7341b2607034e2f1a2029bb
MD5 96bef6fa8c444ab79a68c3d5c0e1b502
BLAKE2b-256 dc575aa3d9eab3e9d59bfb3883d507194a044b48fc508b1276402a337a1a17a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_lease-0.1.0.tar.gz:

Publisher: publish.yml on mfbaig35r/open-lease

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

File details

Details for the file open_lease-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: open_lease-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 77.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for open_lease-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 014ad61985ba60037d6d28aa283555b0df355d9e9b7a4729a5d3af3f5010b138
MD5 3c7bca1518e39c4f5d7ef0b39a34d820
BLAKE2b-256 8e172b1d42fbf99861f1a5bb94dfbfe14a83cb03e14f23c7ceb1de5ca5cdb0ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_lease-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mfbaig35r/open-lease

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