[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112750":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":12,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":13,"forks30d":13,"starsTrendScore":17,"compositeScore":18,"rankGlobal":8,"rankLanguage":8,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":8,"pushedAt":24,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":13,"starSnapshotCount":13,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},112750,"deepseek-ultrafast","basetenlabs\u002Fdeepseek-ultrafast","basetenlabs",null,"Rust",495,40,1,0,3,52,429,11,77.84,"Other",false,"main",true,[],"2026-11-18 09:10:33","2026-11-23 12:40:51","# DeepSeek Ultrafast\n\nAn ultra-fast inference engine for **DeepSeek-V4.1-Flash** for `sm_100a` and `sm_103a`. It supports 1M context length and multi-server KV cache sharing.\n\n## Performance\n\n| | 4 x GB300 (TP4) | 8 x B300 (TP8) |\n|---|---|---|\n| **Decode** (coding) | **1,740 tokens\u002Fs** | **2,060 tokens\u002Fs** |\n| **Step time** | **3.30 ms** | **2.71 ms** |\n| **Acceptance length** | **5.6 tokens\u002Fstep** |\n| **Prefill** | **1,000,000 tokens in 13.2 s** (76,000 tokens\u002Fs) | **1,000,000 tokens in 11.7 s** (85,000 tokens\u002Fs) |\n\nDecode, step time and acceptance length are measured on *\"implement the tetris game. output HTML code directly - no explanation.\"* Each decode step drafts a block of tokens and verifies it; the acceptance length is the average number of tokens a step emits. Instructions for reproducing the results are at the bottom of this page.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Ftetris-demo.gif\" alt=\"Live demo: DeepSeek-V4.1-Flash streams a complete Tetris game in HTML while a speedometer shows the decode speed in tokens per second, then the finished game runs next to the generated code\" width=\"800\">\n  \u003Cbr>\n  \u003Cem>Streaming a complete Tetris game, with live decode speed, then playing it. Shown at real-time speed.\u003C\u002Fem>\n\u003C\u002Fp>\n\nDeepSeek-V4.1-Flash-Fast is available on [Baseten Model APIs](https:\u002F\u002Fwww.baseten.co\u002Fproducts\u002Fmodel-apis\u002F). More performance improvements and open source releases are coming.\n\n## Quickstart\n\n### Requirements\n\n- 4 GB300 (`sm_103a`), 4 or 8 B300 (`sm_103a`) or 4 or 8 B200 (`sm_100a`) GPUs\n- The CUDA 13 toolkit\n- [DeepSeek-V4.1-Flash](https:\u002F\u002Fhuggingface.co\u002Fdeepseek-ai\u002FDeepSeek-V4.1-Flash) in `models\u002F`\n- A Redis instance for multi-server KV cache coordination\n\n```sh\nsudo apt-get install -y build-essential pkg-config cmake clang libclang-dev \\\n    libibverbs-dev librdmacm-dev libopencv-dev redis-server curl ca-certificates\ncurl -sSf https:\u002F\u002Fsh.rustup.rs | sh -s -- -y --default-toolchain none && . \"$HOME\u002F.cargo\u002Fenv\"\n```\n\n### 1. Build\n\n```sh\nrustup toolchain install\nDSUF_SM=sm_103a cargo build --release -p deepseek-ultrafast-engine --bin run -p deepseek-ultrafast-server --bin serve\n```\n\n### 2. Start a local server\n\nThe server keeps each conversation's KV cache between turns. Redis records which replica owns\neach conversation's cache; locally it only needs to be running. The server finds the machine's\nRDMA ports itself:\n\n```sh\nredis-server --bind 127.0.0.1 --save '' --appendonly no --daemonize yes\n\nDSUF_REDIS_URL=redis:\u002F\u002F127.0.0.1:6379 target\u002Frelease\u002Fserve --ckpt models --gpus 0,1,2,3 --port 8000\n```\n\nOn an 8-GPU B300 machine, use all eight (`--gpus 0,1,2,3,4,5,6,7`; build with `DSUF_SM=sm_103a`).\n\nIt is ready when `curl localhost:8000\u002Freadyz` returns 200, about 20 seconds after start.\n\n### 3. Connect your harness\n\nUse your favorite OpenAI-compatible client. For example:\n\n```sh\nDEEPSEEK_BASE_URL=http:\u002F\u002Flocalhost:8000 DEEPSEEK_API_KEY=none \\\n    npx @deepseek-ai\u002Fdsh headless \"summarize this repo\"\n```\n\n## KV cache sharing in multi-server setups\n\nEvery server keeps recent conversations' KV caches in host memory. When a conversation's next turn\nlands on a different server, that server fetches the cache directly from the server that holds it,\nhost memory to host memory over RDMA, instead of recomputing the prompt. Redis records which server\nowns each conversation's cache and announces ownership changes.\n\nThanks to DeepSeek's extreme KV cache compression, the transfers are very fast and can be done on every request.\n\nThis setup removes the need for prefix-aware routing and enables better load balancing.\n\nSee [deploy\u002Fkubernetes.yaml](deploy\u002Fkubernetes.yaml) for an example multi-server deployment.\n\n## Reproduce the demo\n\nStream the Tetris answer from the server and report the decode speed:\n\n```sh\npython3 - \u003C\u003C'EOF'\nimport json, time, urllib.request\n\nbody = {\n    \"model\": \"deepseek-v4.1-flash\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"implement the tetris game. output HTML code directly - no explanation.\"}],\n    \"thinking\": {\"type\": \"disabled\"},\n    \"stream\": True,\n    \"stream_options\": {\"include_usage\": True},\n}\nreq = urllib.request.Request(\"http:\u002F\u002Flocalhost:8000\u002Fv1\u002Fchat\u002Fcompletions\", json.dumps(body).encode(),\n                             {\"Content-Type\": \"application\u002Fjson\"})\nstart, first, tokens = time.time(), None, 0\nwith urllib.request.urlopen(req) as stream:\n    for line in stream:\n        if not line.startswith(b\"data: {\"):\n            continue\n        chunk = json.loads(line[6:])\n        if chunk.get(\"usage\"):\n            tokens = chunk[\"usage\"][\"completion_tokens\"]\n        for choice in chunk[\"choices\"]:\n            if text := choice[\"delta\"].get(\"content\"):\n                first = first or time.time()\n                print(text, end=\"\", flush=True)\nend = time.time()\nprint(f\"\\n\\n{tokens} tokens at {tokens \u002F (end - first):,.0f} tokens\u002Fs (first token after {first - start:.2f} s)\")\nEOF\n```\n\nIt ends with a line like `5142 tokens at 1,717 tokens\u002Fs (first token after 0.04 s)`.\n\nWe see 1,700-1,770 tokens\u002Fs on 4xGB300 and 1,980-2,170 tokens\u002Fs on 8xB300 (`--gpus 0,1,2,3,4,5,6,7`).\n\nThe server's `request_end` log line reports each request's step time (`average_iteration_ms`) and acceptance length\n(`average_accept_length`). Over 30 runs we see 3.24-3.37 ms and 5.1-6.1 tokens\u002Fstep on 4xGB300, and 2.69-2.74 ms and\n5.3-6.1 tokens\u002Fstep on 8xB300.\n\n## Third-party libraries\n\n- [deepseek-recipe](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-recipe): prompt rendering and response parsing\n- [tokenizers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftokenizers): tokenization\n- [cuDNN](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcudnn) and [cuBLAS](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcublas): the vision encoder\n- [OpenCV](https:\u002F\u002Fopencv.org): image decoding\n- [Velo](https:\u002F\u002Fgithub.com\u002Fai-dynamo\u002Fvelo): KV transfer between replicas over RDMA\n\n## Acknowledgments\n\nThe kernels were optimized by coding agents that could read the source of\n[FlashInfer](https:\u002F\u002Fgithub.com\u002Fflashinfer-ai\u002Fflashinfer) and [SGLang](https:\u002F\u002Fgithub.com\u002Fsgl-project\u002Fsglang)\nwhile they worked.\n","DeepSeek Ultrafast 是一个专为 DeepSeek-V4.1-Flash 模型优化的高性能推理引擎，面向 NVIDIA Blackwell 架构 GPU（sm_100a\u002Fsm_103a）设计。核心功能包括超低延迟解码（最低 2.71 ms\u002Fstep）、百万级上下文支持（1M tokens）、多服务器间 KV 缓存共享（基于 Redis），以及高吞吐预填充（最高 85K tokens\u002Fs）。采用 Rust 实现，强调内存安全与并行效率，提供 OpenAI 兼容 API 接口。适用于需要低延迟、长上下文、高并发服务的生产级大模型部署场景，如实时代码生成、交互式 AI 应用和企业级模型 API 网关。",2,"2026-11-24 04:44:01","CREATED_QUERY"]