berth
Berth is a lightweight GPU resource manager written in Go. It controls which applications get access to your GPU, when they get it, and how that access is hande
What is berth?
Berth is a lightweight GPU resource manager written in Go. It controls which applications get access to your GPU, when they get it, and how that access is handed off.
Overview of berth
What it is
Berth is a Go binary that manages GPU memory by making programs take turns using the card. It prevents out-of-memory crashes by leasing the GPU to one engine at a time. No cloud account or additional installation is required.
Key features
- Shares one GPU between chat models, image pipelines, voice engines, games, and other GPU apps by leasing the card instead of grabbing it.
- Supports priorities: hold, foreground, interactive, batch. A lower-priority request waits and receives a reason naming the holder.
- Handles ComfyUI at job boundaries, waiting for the running image job to finish before handoff.
- Allows a minimum turn duration (e.g.,
min_turn = 5m) to keep an engine on the card for a set time. - Works with Docker or Podman containers via
berth run --container. - Survives daemon restarts; running engines stay up and re-attach.
- Provides a gateway (
berth gateway) with an OpenAI-compatible API and ComfyUI workflow proxy. - Detects stowaways: processes holding VRAM without a lease, reporting their PID and memory.
Use cases
- Running multiple AI engines (e.g., llama.cpp, ComfyUI, Ollama, vLLM) on a single GPU without crashes.
- Playing games while AI engines are idle; Berth drains AI engines when a game is launched.
- Managing VRAM across creative apps (Blender, DaVinci Resolve, OBS) and AI workloads.
- Sharing a GPU among multiple users or services with priority queuing.
Getting started
sh berth daemon & # one broker per card berth run --as llama -- llama-server -m model.gguf # this engine now takes turns berth status # who holds the card, who waits, and why For more commands (e.g., berth wire llama-swap, berth stop, berth pull), see the repository README.
License and pricing
Licensed under Apache-2.0. Open source, no pricing stated.
Based on the project's public README and repository metadata.