Beyond the Transistor

How the toolkit is built

See which layer your code talks to, where the Rust core sits, and which part of the stack is closed source.

The toolkit is a Rust library with two front doors, a Python API and a C API. Both call the same Rust core. The core talks to the Q.ANT driver through a C interface, and the driver is the only closed-source layer.

Your Python code calls the Python API (PyO3 and maturin, src/python_bridge.rs). Your C or C++ code calls the C API (src/c_bridge/mod.rs). Both call the Rust toolkit, which calls the driver interface in src/qant_driver_import, with parts for Gen2 and Gen2+ cards and a device manager. A default build uses the closed-source driver, which runs Gen2 and Gen2+ cards. A build with -F cpu-backend uses the CPU emulator instead, which simulates three Gen2 and three Gen2+ devices.

The layers

LayerWhat it doesSource
Python APIExposes the toolkit to Python with PyO3. Maturin builds it into the qant_native_computing_toolkit wheel you install. Functions such as init_npu, upload and linear_fprop_preloaded are defined here.src/python_bridge.rs
C APIThe same operations as extern "C" functions, for C and C++ programs. The headers sit next to it in src/c_bridge/.src/c_bridge/mod.rs
Toolkit coreChecks arguments and builds each layer, such as linear, convolution, batch norm and pooling, from driver calls. The DFT, new in 2.5.0, lives in dft.rs.src/, for example linear.rs and conv.rs
Driver interfaceThe C ABI between the core and the driver. Since 2.5.0 it has one part per card generation, gen2/ and gen2p/, and a device manager that knows each NPU’s capabilities and resolves device_id=-1 to a device that supports the operation. A build flag picks the backend behind each part.src/qant_driver_import/
DriverRuns the physical NPU. Closed source.Not public

Two backends behind one interface

Each card generation has two backends, and the choice is made when you build the toolkit:

  • Default build: gen2/backend_driver.rs and gen2p/backend_driver.rs link against the Q.ANT driver library. You need a card and its driver.
  • -F cpu-backend: gen2/backend_cpu.rs and gen2p/backend_cpu.rs replace the driver with CPU code and simulate three Gen2 and three Gen2+ devices. Everything above them runs unchanged. Emulator and hardware explains what it computes.

What this means for you

  • Python and C give the same results. Both APIs are thin wrappers over one Rust core, so an operation behaves the same from either language.
  • Python version limits come from the Python API layer. PyO3 decides which Python versions the wheel supports. Since 2.5.0 the toolkit uses PyO3 0.29 with one abi3 wheel for Python 3.11 and newer. The older Python 3.15 workaround only ever touched the Python side, not the C library.
  • To see how an operation works, read the core. The open-source layers cover everything down to the driver interface.