Self-hosted · MIT · OpenAI-compatible

Every spare GPU in the house.
One endpoint.

LapisLLM turns the old gaming PC, the work laptop and the Mac on the desk into one model-serving fleet. Each machine runs a small agent; one master routes every /v1 request to whichever machine is serving that model.

  • Windows 11
  • Linux
  • Apple Silicon
  • llama.cpp
  • vLLM
  • MLX
Before / after

Three machines shouldn't mean three projects.

Without a control plane every box gets its own runtime, its own flags and its own port, and every client has to remember which is which.

gaming-pc · PowerShell
PS> llama-server -m llama-8b.gguf --port 8081 -ngl 99
listening on http://0.0.0.0:8081
linux-box · bash
$ vllm serve Qwen/Qwen2.5-32B-AWQ --port 8081
OSError: [Errno 98] Address already in use
macbook · zsh
% mlx_lm.server --model mlx-community/gemma-2-9b --port 8082
which port was the coder model on again?
With LapisLLM
$ curl http://lapis.local:8080/v1/chat/completions \
    -H "Authorization: Bearer $LAPIS_KEY" \
    -d '{"model": "qwen2.5-32b-instruct", ...}'

# → routed to linux-box (RTX 3090) · streamed back
  • One base URL, one API key per person or app
  • Pick a model by name, never by machine
  • Memory checked before anything starts
Will it run?

Size a model before you download 20 GB.

The same memory formula the master uses for admission. Weights, KV cache for your context window, and runtime overhead, checked against the machine you pick.

Machine
Needs 0 GiB –
Weights
–
KV cache
–
Overhead
–
Machine
–

Rules of thumb for one context window with grouped-query attention. Real usage varies with runtime, batch size and flash-attention. AMD and CPU-only nodes are on the roadmap.

How it works

Three steps per machine. Then forget which machine is which.

  1. 1

    Run the agent

    Install the package and point the agent at your master. It detects the GPU or unified memory and prints a fingerprint.

    $ pip install lapis-llm
    $ lapis agent --master http://lapis.local:8080
  2. 2

    Approve the fingerprint

    The machine shows up as pending on the Nodes page. Compare fingerprints, approve, and it receives its node secret.

    fingerprint
    4B:55:2F:49:BA:50:40:20
    F7:C3:57:C4:AE:95:F4:50
  3. 3

    Place a model

    Add a model by size and runtime. Admission checks memory on every node; placement picks the tightest fit and explains every refusal.

    ✓ gaming-pc  needs 5.79, 6.40 free
    ✗ macbook    runtime not offered
    ✓ spark      121.00 free
Clients
VS Code agents
Python / Node scripts
Chat UIs
Master
LapisLLM master
  • OpenAI-compatible router
  • Registry & placement
  • Memory admission
  • Admin API · console · /metrics
Agents
gaming-pc · llama.cpp
linux-box · vLLM
macbook · MLX
spark · vLLM
One endpoint

If it speaks OpenAI, it already works.

Chat completions, completions and embeddings, streaming included. Clients choose a model by name; the router finds the machine. GET /v1/models lists everything running across the fleet.

  • Scoped API keys, hashed at rest, shown once
  • X-Lapis-Node header tells you who answered
  • Prometheus metrics on /metrics
from openai import OpenAI

client = OpenAI(
    base_url="http://lapis.local:8080/v1",
    api_key="lap_...",
)
stream = client.chat.completions.create(
    model="qwen2.5-coder-14b",  # served by studio-pc
    messages=[{"role": "user", "content": "Write a haiku about GPUs"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
Features

Small enough to understand. Complete enough to trust.

FAQ

Questions people ask first

Is this a Kubernetes replacement?

No. LapisLLM is deliberately small: a control plane for a handful of machines you own. No scheduler, no cluster networking, no hosted service.

Do I need a GPU to try it?

No. lapis demo starts a master and five simulated nodes on one laptop, and this website runs the same simulation in your browser.

Which runtimes are supported?

llama.cpp (llama-server) on Windows, Linux and macOS, vLLM on Linux, and MLX (mlx_lm.server) on Apple Silicon. The agent launches them as child processes and proxies requests.

Can a model span two GPUs?

Not yet. Admission checks each card on its own, so a 10 GiB model will not be placed on two 8 GiB cards. Tensor-parallel placement is on the roadmap.

Is it safe to expose to the internet?

Run it on a trusted LAN or behind a TLS reverse proxy. Admin sessions are signed, keys are hashed, and agents only accept calls carrying their node secret. mTLS between master and agents is planned.

Try it on your laptop first.

A master, five simulated machines and live traffic. No GPU required.

$ git clone https://github.com/Rakshitha-Ireddi/lapis-llm
$ cd lapis-llm/server && pip install -e .
$ lapis demo
  console: http://localhost:8080/console.html