A C++20 server for GPU text generation and CPU speech.
Quick start · Run real models · Architecture · Benchmarks · 简体中文
On Ubuntu 24.04, either natively or in WSL2, use the CPU test backend to try the streaming API without downloading model weights.
sudo apt-get update
sudo apt-get install -y git curl python3 build-essential cmake libboost-dev nlohmann-json3-dev
git clone https://github.com/Vitolearns/KVHarbor.git
cd KVHarbor
cmake -S serving -B build-serving-cpu -DCMAKE_BUILD_TYPE=Release
cmake --build build-serving-cpu --parallel 2
./build-serving-cpu/kvharbor-server --test-backend --port 18080Send a request from a second terminal.
curl -fsSN http://127.0.0.1:18080/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"messages":[{"role":"user","content":"Hello"}],"stream":true,"max_tokens":4}'Look for four content chunks followed by data: [DONE]. Press Ctrl+C in the
server terminal to stop it.
| Task | Engine | Run it |
|---|---|---|
| Text from GGUF | llama.cpp on GPU | Qwen3.8-27B |
| Text from a TensorRT engine | TensorRT Edge-LLM on GPU | Qwen3.5-0.8B |
| Transcribe audio or synthesize speech | sherpa-onnx on CPU | Qwen3-ASR and Kokoro |
Interactive demo with switchable LLM and speech
RTX 5090 Laptop GPU, Qwen3.8-27B Q4_K_M.
| Experiment | Result and scope |
|---|---|
| Serving capacity | 1,152 arrivals. At 0.4 req/s, all three repeats reached 95% SLO compliance. |
| Single-row logits | CUDA workspace 507 → 124 MiB, with 5 ms higher median HTTP completion. |
| Greedy sampling | Median sampling 461 → 108 µs/token, with 0.55% lower median HTTP completion. |
More experiments cover prefill/decode scheduling and Q4_K shape dispatch.
API and payloads · Source and tests
Contributions covered by this repository's license use PolyForm Noncommercial 1.0.0. See NOTICE for inherited code, third-party dependencies and model terms.