OpenJet's Qwen3.8-27B engine: CUDA inference on RTX GPUs

How OpenJet serves Qwen3.8-27B with its own CUDA engine: installation, the OpenAI and Anthropic-compatible HTTP API, RTX GPU requirements and llama.cpp benchmarks.

OpenJet serves a supported Qwen3.8-27B GGUF with its own CUDA engine, through a local HTTP API that speaks the OpenAI Chat Completions, OpenAI Responses and Anthropic Messages APIs. OpenJet setup installs it for your GPU; openjet serve then serves it to Claude Code, Codex, OpenCode, OpenClaw or your application.

This page includes the engine's installation, API and systems documentation from the upstream engine README. For a side-by-side decision guide, read OpenJet vs llama.cpp.

Read Benchmarking OpenJet on an RTX 3090 for the full methodology, published results, correctness checks and reproduction commands.

For the engineering story behind the results, read Inside OpenJet's engine: making speculative decoding pay.

A CUDA engine and server built for one model, Qwen3.8-27B. Each decode step runs in one kernel launch: the model's own MTP head drafts up to 7 tokens and the GPU checks them in the same pass. The server speaks OpenAI Chat Completions, OpenAI Responses and Anthropic Messages, so coding agents connect to it directly. OpenJet installs and starts it for you (openjet setup, then openjet or openjet serve); this page is for running, building or changing it yourself.

This directory holds qwen38-megakernel by Benjamin Cutler, at commit ed0d237. It began as this directory's engine and was developed further in that repository; OpenJet adopted it in November 2026 (credits). The engine OpenJet shipped before is kept in `legacy/` and serves what this one doesn't: Turing GPUs, UD-Q3_K_XL and cards with less than 24 GB.

Quick guide

Which engine OpenJet starts:

GPUModel fileEngine
RTX 30, 40 or 50-series with 24 GB or more (sm_86, sm_89, sm_120)unsloth Qwen3.8-27B Q4_K_M or UD-Q4_K_XLthis one
the samea Q4_K_M from lmstudio-community, mradermacher, Abiray or KikoCisthis one, semi compatible: it reads the file, but it isn't benchmarked
the sameunsloth UD-Q3_K_XLthe legacy engine's mixed-quant build (legacy/)
sm_86, sm_89 or sm_120 with 16 GBunsloth UD-Q3_K_XL (12.4 GiB on the GPU, about 48K context)the legacy engine's mixed-quant build
Turing with 24 GB or more (sm_75)Q4_K_Mthe legacy engine, experimental (Turing)
anything elseany other quantllama.cpp

_megakernel_variant in `src/llama_server.py` makes this choice from the GPU and the GGUF header.

Results

Speed

One conversation on one RTX 3090, unsloth Q4_K_M, 106,496-token context, q8_0 KV cache, thinking on, sampled (temperature 1.0, top_p 0.95, top_k 20), 1,024 tokens per reply. Short: 5 prompts of 77 to 3,088 tokens; long: one 98,092-token prompt. Each server started as OpenJet starts it.

llama.cpp b11982This engine
Decode, short prompts60.7 tok/s (20 requests)121.2 tok/s (40 requests)2.0x
Decode with 98K tokens in context36.6 tok/s (4 requests)95.9 tok/s (8 requests)2.6x
Read the 98K-token prompt, cold112 s76 s1.5x
  • llama.cpp: llama-server with MTP speculative decoding (2 drafts), flash attention and a q8_0 KV cache, measured

2026-10-29 by `bench/run_compare.sh`. This engine: 7 drafts, exact reuse, measured 2026-11-17 with the same harness (`bench/engine_compare.py`) and settings, as built by the engine workflow (engine.yml) from this source. One of the 5 short prompts (a source file) and the text of the long prompt differ between the two runs.

  • The 2026-11-17 run went in 4 interleaved rounds. This build's short-prompt decode averaged 135 and 139 tok/s in

the first two and about 106 in the last two; in the last round every engine in the session slowed, so other GPU load is likely there, but the third round is unexplained.

  • The release binary this source comes from (qwen38-megakernel v2026.11.11) ran in the same session: same-seed median

speed equal to this build's, and the same 12 of 12 replies to seeded requests.

Accuracy

Next-token distributions against llama.cpp generating one token at a time on the same weights, q8_0 KV cache. llama.cpp in its own batched mode, against the same reference, shows the noise floor.

Top token agreesMean KL divergence
Short context: 13 chunks of 2,048 tokens (7 code, 6 prose), scored from position 1,024; 13,299 positions
llama.cpp batched98.25%0.00225
this engine98.74%0.00162
After a 94K-token prompt: 1,980 positions
llama.cpp batched99.49%0.00111
this engine99.70%0.00093

Measured 2026-11-16 with the v2026.11.11 release binary, which gives the same replies as this build. The method is tools/llama_ref against qwen38_mk --kld (docs/BUILDING.md).

Use with OpenJet

openjet setup downloads this engine prebuilt for your GPU, or compiles it from a source checkout. OpenJet then starts server/mk_server.py with:

  • --kv q8 --exact-reuse -d 7: the q8_0 KV cache, cached conversations answering exactly as fresh ones, 7 drafts. A GPU

with fewer than 80 SMs refuses 7 drafts at load, and OpenJet starts it again with -d 4.

  • --park-mib 0 on machines with less than 32 GiB of RAM: parking other conversations pins up to 8 GiB of host

memory, which next to the model file's page cache runs a 16 GB machine out of memory.

  • MK_PF_CAP=1024 above 96K context: smaller prefill chunks, 0.34 GB less GPU memory.
  • With openjet setup --long-context, KV preset F (below).

pgrep -af mk_server.py shows the running command.

Standalone installation

Linux, an RTX 30/40/50-series GPU with 24 GB, the CUDA toolkit (13.2) and a machine with 24 GiB of RAM or more for the compile:

git clone https://github.com/l-forster/open-jet.git
cd open-jet
git clone --depth 1 --branch b10246 https://github.com/ggml-org/llama.cpp.git llama.cpp
cmake -S llama.cpp -B llama.cpp/build -DGGML_CUDA=ON -DLLAMA_CURL=OFF
cmake --build llama.cpp/build --config Release -j 2
python3 -m venv .venv-engine
. .venv-engine/bin/activate
python -m pip install -e ./megakernel
make -C megakernel -j1 NVCC="$(command -v nvcc)" libqwen38mk.so
openjet-engine --model /absolute/path/to/Qwen3.8-27B-Q4_K_M.gguf --port 18080 -c 106496 --kv q8 --exact-reuse -d 7

The server's own default is 4 drafts, so pass -d 7 as above. openjet-engine --help lists every option; python -m megakernel does the same. Instead of compiling, you can unpack a release's openjet-engine-linux-x64-sm86.tar.gz (or sm89, sm120) into megakernel/: it holds libqwen38mk.so and the llama.cpp libraries it needs.

Build / run

  • Compiling takes about 21 GiB of RAM, almost all of it ptxas on the megakernel, so build with -j1. It takes

up to half an hour. openjet setup doesn't try on a machine with less than 24 GiB and serves llama.cpp there instead.

  • make builds for the installed GPU; make ARCH=sm_89 overrides it. make with no target also builds the

qwen38_mk command line and the tools.

  • Windows: `build.ps1` (-Targets engine -Arch sm_86 -Llama <llama.cpp> -Cuda <CUDA>), which sets up

MSVC 2022 itself.

so they need NVIDIA driver 580 or newer.

Requirements, both builds, the model files and the checks to run after a build: docs/BUILDING.md.

The GGUF

The loader reads F32, F16, Q4_0, Q8_0, Q3_K, Q4_K, Q5_K, Q6_K, IQ4_NL, IQ3_S and IQ4_XS (`gguf.h`), checks each tensor's type for its role, and names the first one it refuses. unsloth's Q4_K_M and UD-Q4_K_XL are the files it's measured on. A plain llama-quantize ... Q4_K_M also loads; OpenJet labels it semi compatible. UD-Q3_K_XL holds Q2_K, IQ2_XXS, IQ2_XS, IQ2_S and IQ3_XXS tensors, which this engine has no kernels for, so it runs on the legacy engine.

KV cache presets (MK_KV)

The KV cache is q8_0 by default. MK_KV stores older positions in fewer bits, and MK_KV_WIN keeps the newest ones at q8_0, where attention puts most of its weight:

PresetEnvironmentK / V bits
default(none)8 / 8
DMK_KV='K*=6,V*=5' MK_KV_WIN=20486 / 5
FMK_KV='K*=5r,V*=5' MK_KV_WIN=20485 / 5, K Hadamard-rotated

openjet setup --long-context starts the engine with preset F and offers about 234K tokens of context on a 24 GB card, against about 120K with q8_0. Started as OpenJet starts it on an RTX 3090 with about 1.7 GiB already used by the desktop, with one short request, peak GPU memory was:

ContextKV cachePeak, of 24,576 MiB
120,000q8_022,383 MiB
234,000preset F23,433 MiB
262,144 (the model's maximum)preset F23,855 MiB

Only short conversations were run at these sizes. Benjamin Cutler's KL and benchmark measurements of each preset are in docs/BENCHMARKS.md.

Limitations

  • Qwen3.8-27B only, and Ampere or newer (sm_80+): Turing runs the legacy engine.
  • More than 4 drafts needs a GPU with at least 80 SMs (50 for up to 4). --agents with 2 or more slots needs 80 SMs

at any draft count.

  • Tuned and measured on an RTX 3090 (sm_86). sm_89 and sm_120 build in CI but haven't been measured.
  • top_k runs 1 to 32; repetition_penalty is ignored with a warning. --agents is text only and refuses the

presence and frequency penalties.

Documentation

`docs/` holds the documentation written for the standalone project. It uses that project's name and launch scripts (scripts/serve.sh), and its numbers are Benjamin Cutler's measurements, not OpenJet's.

Credits and license

Louis Forster (L-Forster) wrote this engine's design and first version in OpenJet: the persistent kernel that runs a whole speculative decode cycle in one launch, MTP drafting verified on the GPU, the batched prefill, the Q4_K_M weight kernels, the C API and the server. Benjamin Cutler developed it from there in qwen38-megakernel, including the UD-Q4_K_XL support, the low-bit KV presets, the conversation cache, parallel agents and the 7-draft decode; much of that work also went into OpenJet through his pull requests before this directory took the whole engine. Evan Light contributed the load-time tensor-type check and the server warm-up. Third-party code is listed in THIRD_PARTY_NOTICES.md.

It uses llama.cpp for the tokenizer (libllama) and follows its GGUF quantization formats. The model files and default sampling settings are Unsloth's; the model is Qwen's.

GNU AGPL v3, like OpenJet (LICENSE).