Skip to main content

vllm-openttt

TTTPS Proof-of-Time ASGI middleware for vLLM. Attaches a cryptographic audit-trail timestamp (a signed Proof-of-Time receipt) to every non-streaming /v1/chat/completions and /v1/completions response served by vLLM's OpenAI-compatible server, sealed against the public self-serve KPP Provenance API.

This attaches a cryptographic audit-trail timestamp and integrity hash. It does not certify legal or regulatory compliance (EU AI Act, FDA, and so on). Treat it as an audit-trail timestamp, not a compliance claim.

Install

pip install vllm-openttt

vLLM itself is not a dependency of this package. The middleware only needs the ASGI contract, so it installs next to whatever vLLM version you already run.

Usage

Mint a free key with POST https://kpp.kenosian.com/v1/keys, export it, and pass the middleware to vllm serve:

export KPP_API_KEY=...

vllm serve Qwen/Qwen2.5-0.5B-Instruct \
    --middleware vllm_openttt.TTTPSMiddleware

vLLM imports the dotted path and, because it resolves to a class, registers it with app.add_middleware(). Every sealed response then carries two extra headers:

X-TTTPS-Status: ok
X-TTTPS-Receipt: {"status":"ok","backend":"kpp","content_hash":"sha256:...",
                  "receipt_id":"...","receipt":"...","time":"...",
                  "time_source":"...","verify_url":"https://kpp.kenosian.com/v1/verify?receipt_id=...",
                  "overhead_ms":...}

Reading the receipt from a client:

import json, requests

r = requests.post(
    "http://127.0.0.1:8000/v1/chat/completions",
    json={"model": "Qwen/Qwen2.5-0.5B-Instruct",
          "messages": [{"role": "user", "content": "hi"}]},
)
receipt = json.loads(r.headers["X-TTTPS-Receipt"])
print(receipt["receipt_id"], receipt["verify_url"])

A receipt can be re-checked at any time via POST https://kpp.kenosian.com/v1/verify with {"receipt_id": ...}.

Configuration

Variable Default Meaning
KPP_API_KEY empty Provenance key from POST /v1/keys
KPP_BASE https://kpp.kenosian.com Provenance API base URL
TTTPS_TIMEOUT_S 1.0 Fail-open deadline for the anchor call
TTTPS_BACKEND kpp kpp, or openttt for a self-hosted server
TTTPS_POT_BASE empty Base URL of your OpenTTT server, when TTTPS_BACKEND=openttt
TTTPS_API_KEY empty API key for that OpenTTT server

Self-hosted backend

Setting TTTPS_BACKEND=openttt mints receipts on your own OpenTTT server instead of the public API, which additionally chains each event into that server's hash chain and keeps every anchor inside your own infrastructure.

OpenTelemetry

If a request carries a W3C traceparent header, the trace and span ids are parsed and echoed back in the receipt, so a trace and a receipt point at each other. On the self-hosted backend the ids are also written into the signed Proof-of-Time hash preimage and into the server's queryable event description.

receipt_to_span_attributes() maps a receipt onto span attribute names:

from vllm_openttt import receipt_to_span_attributes

span.set_attributes(receipt_to_span_attributes(receipt))
# {"tttps.receipt_id": "...", "tttps.content_hash": "...", "tttps.trace_id": "...", ...}

Parsing prefers vLLM's own vllm.tracing.extract_trace_context() when running inside a vLLM process, and falls back to a dependency-free W3C parser otherwise. No extra dependency is added either way.

Fail-open

A missing key, an unreachable or slow backend, a malformed traceparent, or any unexpected error degrades the receipt to {"status": "degraded", "reason": ...}. The response body, status code and media type are never altered, and no exception ever escapes the middleware.

Scope

Streaming responses (stream: true, server-sent events) are passed through untouched. Sealing a live event stream needs a different approach and is not attempted here.

License

MIT

Metadata

Release files for vllm-openttt 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vllm-openttt 0.1.0
File Size Uploaded
vllm_openttt-0.1.0.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vllm-openttt 0.1.0
File Interpreter ABI Platform
vllm_openttt-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / vllm_openttt-0.1.0.tar.gz

Download URL vllm_openttt-0.1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
edd037b1e0723fbddf213452dedc6a9b8db2d8e2ab81e76d28606cd8811a7e0a
BLAKE2b-256 checksum
How to use checksums
79bc836c4b9623d322b468527455fa1c513831eeb31c7e968c980de5c5e33602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / vllm_openttt-0.1.0-py3-none-any.whl

Download URL vllm_openttt-0.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0ffa6958f3a076a3293d689d4abef9967b00e2101f40d577f92f15f7d28a8d5
BLAKE2b-256 checksum
How to use checksums
c4a320379f8e49e3ccb30e8ffc92ba6d442414b4b7f0fc14fd18837d17ec7784
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page