- 67pybind11 modules expose the C++ engine to the parts of vLLM that call it
- 866of 867 places where Python dispatched work became direct native calls
- 0lines of my own Python in the release payload
From a Python prototype to C++ inside vLLM
In ActiveKV the Python version proved the design and was too slow on the per-token path, and it left the product logic as readable source. I moved the whole runtime to C++ inside vLLM, with pybind11 as the boundary, built against PyTorch's ATen.
The port is told in Rewriting an engine extension without changing a token, and how I proved the native code was the code that ran is in Proving a rewrite is the same system.
What may stay in Python
The hard part of a binding layer is deciding what may stay in Python. My rule: only an explicitly justified vLLM or PyTorch interface requirement remains, and a framework that requires a Python callable gets a thin binding with the logic behind it in C++.
The language boundary is a contract I minimise and justify line by line.
- Framework contract, with the framework source line citedstays
- Convenienceported
- Delegationported
- An async protocol method, defended as Python-onlyported
The engine owns the process
I also inverted the usual arrangement: a native launcher embeds the Python interpreter that vLLM needs. A type-conversion defect at the boundary that broke startup was fixed in the binding code before the release cut.
A release with the boundary enforced
The release payload comes as compiled binaries plus a patch to the user's vLLM, and every change is screened at intake.
I can carry a large Python-to-C++ port inside someone else's engine to bit-exact parity, and I reason about a language boundary from what the interpreter and framework actually require. pybind11, vLLM and PyTorch are third-party; the engine, bindings, launcher and boundary rules are mine.