[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116528":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":16,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":8,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":13,"starSnapshotCount":13,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},116528,"KVHarbor","Vitolearns\u002FKVHarbor","Vitolearns",null,"Python",199,6,14,0,5,114,81,77.9,"Other",false,"main",true,[],"2026-11-23 16:43:31","2026-11-23 19:41:54","\u003Ch1 align=\"center\">KVHarbor\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#quick-start\">Quick start\u003C\u002Fa> · \u003Ca href=\"#run-real-models\">Run real models\u003C\u002Fa> · \u003Ca href=\"#architecture\">Architecture\u003C\u002Fa> · \u003Ca href=\"#benchmarks\">Benchmarks\u003C\u002Fa> · \u003Ca href=\"README.zh-CN.md\">简体中文\u003C\u002Fa>\n\u003C\u002Fp>\n\nKVHarbor runs text generation, speech recognition, and speech synthesis in one\nC++20 server. Choose **llama.cpp** or **TensorRT Edge-LLM** for GPU text\ngeneration. **Qwen3-ASR** and **Kokoro** run on the CPU, alongside text or on\ntheir own.\n\n## Quick start\n\nThis Ubuntu 24.04 example runs on Linux or WSL2 with a CPU test backend. You can try the streaming API before downloading model weights.\n\n```bash\nsudo apt-get update\nsudo apt-get install -y git curl python3 build-essential cmake libboost-dev nlohmann-json3-dev\ngit clone https:\u002F\u002Fgithub.com\u002FVitolearns\u002FKVHarbor.git\ncd KVHarbor\ncmake -S serving -B build-serving-cpu -DCMAKE_BUILD_TYPE=Release\ncmake --build build-serving-cpu --parallel 2\n.\u002Fbuild-serving-cpu\u002Fkvharbor-server --test-backend --port 18082\n```\n\nWith the server running, send a request from another terminal.\n\n```bash\ncurl -fsSN http:\u002F\u002F127.0.0.1:18082\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"max_tokens\":4}'\n```\n\nThe stream sends four content chunks and ends with `data: [DONE]`. Stop the server with Ctrl+C.\n\n## Run real models\n\n\u003Ca name=\"cuda-text-generation\">\u003C\u002Fa>\n\u003Ca name=\"tensorrt-edge-llm-text-generation\">\u003C\u002Fa>\n\u003Ca name=\"enable-speech\">\u003C\u002Fa>\n\n| Workload | Engine | Setup |\n| --- | --- | --- |\n| Text generation from GGUF | llama.cpp on GPU | [Run Qwen3.8-27B](docs\u002Fserving.md#cuda-text-generation) |\n| Text generation from a TensorRT engine | TensorRT Edge-LLM on GPU | [Run Qwen3.5-0.8B](docs\u002Fserving.md#tensorrt-edge-llm-text-generation) |\n| Transcription and speech synthesis | sherpa-onnx on CPU | [Run Qwen3-ASR and Kokoro](docs\u002Fserving.md#enable-speech) |\n\n## Architecture\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"assets\u002Freadme\u002Farchitecture-dark.svg\">\n  \u003Cimg src=\"assets\u002Freadme\u002Farchitecture-light.svg\" width=\"960\" alt=\"HTTP ingress, separate task queues, runtime adapters, engines, and response formats\">\n\u003C\u002Fpicture>\n\nText, recognition, and synthesis have separate queues and worker slots. A\ndisconnect cancels the request and wakes any worker blocked on output. For a\nrunning request, the slot becomes available again after the native call has\nfinished. [Request lifecycle and engine notes](docs\u002Fserving.md#implementation-notes)\n\n## Benchmarks\n\nThese runs used Qwen3.8-27B Q4_K_M on an RTX 5090 Laptop GPU.\n\n- The [serving load test](docs\u002Fexperiments\u002Fserving-acceptance.md) recorded 1,152\n  arrivals across three rates and checked overload and recovery separately.\n- [Reserving one logits row](docs\u002Fexperiments\u002Fperf-003-gpu.md) cut the CUDA\n  workspace from 507 to 124 MiB and added about 5 ms to median HTTP completion.\n\nSee also [prefill\u002Fdecode interleaving](docs\u002Fexperiments\u002Fprefill-decode.md) and\n[greedy sampling](docs\u002Fexperiments\u002Fperf-002-sampling.md).\n\n## API\n\n| Task | Endpoint | Payload and response |\n| --- | --- | --- |\n| Text | `POST \u002Fv1\u002Fchat\u002Fcompletions`, `POST \u002Fv1\u002Fcompletions` | JSON request with `stream: true` and `temperature: 0`. Successful responses use SSE. |\n| Speech recognition | `POST \u002Fv1\u002Faudio\u002Ftranscriptions` | Mono PCM16 WAV request with JSON transcript |\n| Speech synthesis | `POST \u002Fv1\u002Faudio\u002Fspeech` | JSON request with raw PCM16 response and sample-rate header |\n| Service state | `GET \u002Fhealth`, `GET \u002Fstate`, `GET \u002Fmetrics`, `GET \u002Fv1\u002Fmodels` | Runtime health, task occupancy, Prometheus metrics and loaded models |\n\n## Development\n\nUse the quick-start build to check the service. For source entry points and\nbenchmark script checks, see [development notes](docs\u002Fserving.md#development).\n\n```bash\nctest --test-dir build-serving-cpu --output-on-failure\npython3 serving\u002Ftests\u002Ftest_http.py build-serving-cpu\u002Fkvharbor-server\n```\n\n## License\n\nContributions covered by this repository's license use\n[PolyForm Noncommercial 1.0.0](LICENSE). See [NOTICE](NOTICE.md) for inherited\ncode, third-party dependencies and model terms.\n","KVHarbor 是一个面向多模态 AI 推理服务的轻量级 C++20 服务器，统一支持文本生成、语音识别（ASR）和语音合成（TTS）。其核心特点是支持异构后端：GPU 上可选 llama.cpp 或 TensorRT Edge-LLM 运行 GGUF\u002FTensorRT 格式大模型，CPU 上集成 sherpa-onnx 运行 Qwen3-ASR 和 Kokoro 实现低依赖语音处理；各任务拥有独立队列与资源隔离，支持流式 HTTP API 和连接中断自动清理。适用于边缘部署、本地 AI 服务网关、多模态 API 聚合等对资源敏感且需混合引擎调度的场景。",2,"2026-11-24 04:53:46","CREATED_QUERY"]