# Lucebox

> Speculative-decoding inference tuned for one consumer GPU at a time

- Category: Models & Inference / Serving & Deployment
- Language: C++
- Licence: Apache-2.0
- Repository: https://github.com/Luce-Org/lucebox
- Website: https://www.lucebox.com
- Canonical page: https://ai-tldr.dev/tools/lucebox/
- Updated: 2026-04-20

## In short

Lucebox is an LLM inference server aimed at the hardware most people actually own: a single consumer card, or a box with a mismatched pair of them. It sits in the Serving & Deployment category of the Models & Inference tools and is open-source, written in C++ and licensed Apache-2.0.

## Overview

Lucebox is an LLM inference server aimed at the hardware most people actually own: a single consumer card, or a box with a mismatched pair of them. Rather than assuming a datacentre GPU and scaling down, it starts from specific cards — RTX 3090 and 4090 on the NVIDIA side, Radeon R9700 and Strix Halo on the AMD side — and hand-tunes kernels for each, which is why its build flags name GPU architectures directly.

The performance story is speculative execution applied to both halves of inference: speculative prefill as well as speculative decoding, layered on top of paged attention and continuous batching so throughput does not collapse under concurrent requests. Several optimisation paths ship under their own names — DFlash2, PFlash, KVFlash, Spark and a megakernel implementation — and which one applies depends on the model and card.

Heterogeneous setups are a first-class case rather than an afterthought: CUDA and ROCm backends can be built from the same tree, so an NVIDIA and an AMD card in one machine are both usable. The project is written in C++ with Python tooling around it, Apache-2.0 licensed, and built from source with CMake and Ninja.

## What it does

- Speculative prefill and speculative decoding, not just speculative decode
- Hand-written kernels targeted at specific consumer GPUs (RTX 3090/4090, Radeon R9700, Strix Halo)
- Heterogeneous NVIDIA CUDA + AMD ROCm support from one source tree
- Paged attention with continuous batching for concurrent requests
- Multiple optimisation paths — DFlash2, PFlash, KVFlash, Spark and a megakernel implementation
- Apache-2.0, built from source with CMake and Ninja

## Getting started

Lucebox is built from source. The build selects a GPU backend and architecture explicitly — the snippet below is the ROCm 7.2+ / RDNA4 path from the README; the CUDA path uses the equivalent NVIDIA flags.

1. Clone with submodules

   The kernels live in submodules, so a plain clone is not enough.

```bash
git clone --recurse-submodules https://github.com/Luce-Org/lucebox.git
cd lucebox
```

2. Configure the build for your GPU

   Set the backend (hip here) and the architecture of the card you are targeting; gfx1201 is RDNA4.

```bash
cmake -S server -B server/build-hip -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_HIP_COMPILER=/opt/rocm/lib/llvm/bin/clang++ \
  -DDFLASH27B_GPU_BACKEND=hip \
  -DDFLASH27B_HIP_ARCHITECTURES=gfx1201
```

3. Build the server

   Compiles the inference server binary against the backend you configured.

```bash
cmake --build server/build-hip --target dflash_server -j"$(nproc)"
```

4. Read the setup and benchmark guides

   The repository carries per-card setup notes, API documentation, an architecture write-up and benchmark methodology — worth reading before tuning, since the right optimisation path depends on the model and the card.

## When to use it

- Get usable tokens per second out of a single RTX 3090 or 4090 instead of renting a datacentre GPU
- Serve a model from a machine with an NVIDIA and an AMD card without running two stacks
- Squeeze a local coding or chat assistant into consumer hardware where speculative decoding pays off most
- Compare speculative prefill/decode against a general-purpose server like vLLM or SGLang on your own card

## Version history

- 2026-04-20: LuceBox Hub reached the Hacker News front page with hand-tuned CUDA kernels benchmarked at 207 tokens per second on Qwen3.5-27B on an RTX 3090 via DFlash speculative decoding. The project has since been renamed to Lucebox.
