LLM integrations

Use Quantum Lever with llama.cpp and vLLM.

Run a local OpenAI-compatible server, give it a Quantum Lever key, and let the sampler draw from signed QRNG batches instead of a local pseudo-random generator.

Day and week keys

ql_day_ and ql_week_ keys use the public QRNG stream. They are the right first test for normal sampling.

Lever keys

ql_lever_ keys can use the subscriber Lever stream. They are also where experimental subscriber-only sampler features belong.

quantum-llama.cpp

The fork at dnhkng/quantum-llama.cpp builds a quantum-llama-server target. You can compile it from source or use binaries from the fork's releases when available.

git clone https://github.com/dnhkng/quantum-llama.cpp
cd quantum-llama.cpp
cmake -B build
cmake --build build --config Release -t quantum-llama-server

./build/bin/quantum-llama-server \
  -hf ggml-org/gemma-3-1b-it-GGUF \
  --quantum-api-key ql_week_your_key_here

For SSL-enabled server builds, configure with -DLLAMA_OPENSSL=ON before building the same target.

cmake -B build -DLLAMA_OPENSSL=ON
cmake --build build --config Release -t quantum-llama-server

Download path: check quantum-llama.cpp releases first. If there is no matching binary for your platform, build from source.

quantum-vLLM

The fork at dnhkng/quantum-vllm tracks upstream vLLM. Build it from source when you need fork code; otherwise use normal vLLM installation for baseline serving.

git clone https://github.com/dnhkng/quantum-vllm
cd quantum-vllm
uv venv
source .venv/bin/activate
uv pip install -e .

quantum-vllm serve Qwen/Qwen2.5-1.5B-Instruct \
  --quantum-api-key ql_week_your_key_here \
  --quantum-source qrng

Download path: vLLM is normally installed as a Python package or built into a container image. For fork-specific builds, install from the GitHub checkout above.

Do not confuse vLLM's normal --api-key with a Quantum Lever key. The normal vLLM flag protects your local OpenAI-compatible server for clients; --quantum-api-key gives the sampler access to Quantum Lever entropy.

Quantum Lever flags

The core Quantum Lever options below are shared by the quantum llama.cpp and vLLM integrations. In OpenAI-compatible request JSON, the same settings are available as snake_case fields such as quantum_api_key.

FlagUse
--quantum-api-key KEYYour generated Quantum Lever key. Use ql_day_ or ql_week_ for public QRNG entropy; use ql_lever_ for subscriber Lever features.
--quantum-source qrngUse the public signed QRNG batch stream. This is the default and works with free keys.
--quantum-source leverUse the subscriber Lever stream. Requires a key with Lever capability.
--quantum-samplerEnable the subscriber-only quantum_floor sampler instead of only replacing the final random draw. Requires Quantum Sampler capability.
--quantum-personalization TEXTLocally personalizes selector words with a non-secret label. The label is not sent to Quantum Lever.
--quantum-k KMinimum integer-CDF slots per token for quantum_floor. Default: 64.

Using keys per request

Server startup flags are the simplest path. For request-level control in quantum-llama-server, include Quantum Lever fields in the generation request. The Quantum Lever key is for entropy access; any local server auth token is separate.

curl http://127.0.0.1:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "local-model",
    "messages": [{"role": "user", "content": "Write one sentence from this branch."}],
    "temperature": 0.8,
    "quantum_api_key": "ql_week_your_key_here",
    "quantum_source": "qrng"
  }'

For quantum_sampler, use non-greedy temperature settings and avoid grammar constraints. The fork requires samplers: ["temperature"] for that mode.