Skip to main content

lupine Python package

CUDA on any host. The wheel bundles the LUPINE native client shims — CUDA driver API (libcuda / nvcuda.dll), CUDA runtime API (libcudart / cudart64_13.dll), and NVML — for Linux (x86_64, aarch64), macOS (universal2), and Windows (amd64, arm64), plus a small PyTorch adapter. No NVIDIA software, CUDA toolkit, or container runtime is needed on the client.

import lupine

with lupine.connect(host="gpu-host:14833") as session:
    import torch

    device = session.device()
    x = torch.arange(8, device=device, dtype=torch.float32)
    print((x * 2).cpu())  # tensor([0., 2., 4., 6., ...]) — computed remotely

How it works

torch / any CUDA binary ─▶ bundled shims ──RPC──▶ lupine server ─▶ GPU

lupine.connect() exports LUPINE_SERVER and preloads the bundled shims with global visibility before CUDA initializes, so:

  • PyTorch builds with CUDA keep their normal torch.device("cuda:N") dispatch; every CUDA call lands on the LUPINE shims.
  • Natively compiled CUDA code (nvcc/clang binaries) resolves the bundled shims directly — including on platforms where no NVIDIA runtime has ever shipped.
  • CPU-only PyTorch builds cannot gain a CUDA backend by linking (the backend is compiled out); use the shims directly via ctypes, or run such workloads in a container against the same server.

API

  • lupine.connect(host=..., port=...) — declare servers and load the native shims. host accepts one host or a list; LUPINE_SERVER (comma-separated) is the default. Returns a Session; usable with or without with.
  • session.devices() / session.device(i=0) — torch.device("cuda:N") objects from LUPINE's virtual topology across all servers.
  • lupine.load_native() / lupine.libdir() — load/inspect the bundled shims without torch.
  • LUPINE_LIBDIR — load shims from a custom directory (e.g. a newer build).
  • TRITON_LIBCUDA_PATH — defaults to the bundled Linux shim directory so torch.compile can link Triton's launcher; an explicit value is preserved.
  • LUPINE_DISABLE_LOCAL=0 — include local GPUs (when present) in the topology ahead of the remote ones.

The package depends on nothing but the standard library.

Automatic bootstrap

Install the opt-in extra to make ordinary Python processes default to the hosted LUPINE demo without calling the LUPINE API:

pip install "lupine[auto]"
python existing_torch_program.py

The companion package installs a Python startup hook that sets LUPINE_SERVER=demo.lupinemachines.com:14833 only when the application has not configured a server, then preloads the bundled native shims before the application imports PyTorch. An explicit LUPINE_SERVER always wins. Set LUPINE_AUTO=0 to disable the hook for one process.

The hook does not change LUPINE_DISABLE_LOCAL. As with the explicit API, PyTorch must have a compiled CUDA backend; a CPU-only PyTorch build cannot gain one at runtime.

Layout

lupine/
  __init__.py    Session / connect() adapter
  _native.py     platform shim discovery + preloading
  _libs/         (in wheels) per-platform native shims

build.py stage <tag> <dir> assembles lupine/_libs/<tag>/ from build outputs (CI does this for every platform); build.py build builds the wheel. CI builds the native shims from the repository root and python/cudart.

Metadata

Release files for lupine 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lupine 2.0.1
File Interpreter ABI Platform
lupine-2.0.1-py3-none-any.whl Python 3 none any Details

Release files / lupine-2.0.1-py3-none-any.whl

Download URL lupine-2.0.1-py3-none-any.whl
Size 13.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
df5d85d3d372478e77c1fd2a2f83e46dd7dbde9f9b9e525a9f6a246a1f366681
BLAKE2b-256 checksum
How to use checksums
c9555074b9de695db4b41e3579663ef63ab4b029703aac7d886721e74f11ee4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.3

1 release file

2.0.2

1 release file

This release

2.0.1 This release

1 release file

2.0.0

1 release file

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page