Write Python.
Run It Encrypted.
@h33.compile turns any Python function into a post-quantum FHE circuit. 4 engines. Automatic routing. No cryptography PhD required.
import h33 @h33.compile def match_biometric(template: h33.EncVec[128], sample: h33.EncVec[128]) -> h33.EncBool: similarity = h33.dot(template, sample) return similarity > 0.85 circuit = match_biometric.compile() print(circuit.engine) # "BFV-128" (auto-selected) print(circuit.latency) # "939us per batch"
Why This Exists
Zama's Concrete compiler lets you write Python and get FHE. That's powerful. But Concrete compiles to one backend (TFHE). If your workload needs integer arithmetic, you get TFHE. If it needs floating point, you still get TFHE. If it needs government-grade security, you still get TFHE.
H33-Compile compiles to four backends and auto-selects the fastest one for your workload. Float operations route to CKKS. Integer comparisons route to BFV-128. Government-grade security routes to BFV-256. Mixed workloads get automatically split across engines — a hybrid circuit that Concrete cannot produce.
The result: you write a Python function with a single decorator. The compiler handles parameter selection, noise budget management, SIMD vectorization, and engine routing. You never touch a polynomial ring.
Built and Tested
Not a whitepaper. Not a roadmap. A working Rust workspace with tests passing.
h33-compiler/ ├── h33-compiler-frontend 4 tests passing ├── h33-compiler-ir 30+ FHE operations ├── h33-compiler-optimizer 6 optimization passes ├── h33-compiler-backend FHE-IQ 4-engine routing ├── h33-compiler-runtime API + local execution └── h33-compiler-python PyO3 bindings
Why This Beats Concrete
Zama built a good compiler for one engine. We built a compiler for four.
h33.EncFloat, h33.EncVec[128] — real types the compiler enforces. Concrete uses runtime tracing.4-Engine Auto-Routing via FHE-IQ
Your Python function enters the compiler. FHE-IQ routes it to the optimal engine in under 500 nanoseconds.
@h33.compileThe engine selection is automatic. If your function uses float operations (dot products, sigmoid, similarity), CKKS is selected. If it uses integer comparison, BFV-128. If it needs government-grade security, BFV-256. If it mixes float and integer, the circuit is automatically split across engines (Hybrid mode).
Supported Operations
Every operation compiles to optimized FHE circuits with automatic noise budget management.
| Category | Operations |
|---|---|
| Arithmetic | add, sub, mul, div, mod |
| Comparison | >, <, >=, <=, ==, != |
| Vector | dot product, rotate, sum, pack |
| ML | relu, sigmoid, tanh, softmax (polynomial approximation) |
| Matrix | matmul, transpose |
| Logic | and, or, not, select (encrypted if-then-else) |
| I/O | encrypt, decrypt, constant |
H33-Compile vs Zama Concrete
A direct comparison of the two Python-to-FHE compilers.
| Zama Concrete | H33-Compile | |
|---|---|---|
| Backends | 1 (TFHE) | 4 (BFV-128, BFV-256, CKKS, BFV-32) |
| Auto-routing | No | Yes (FHE-IQ, <500ns) |
| Hybrid circuits | No | Yes (auto-splits across engines) |
| SIMD batching | Limited | 4,096 slots, 32 users/ciphertext |
| GPU required | Yes | No (Graviton4 CPU) |
| Speed | 124ms per 64-bit add | 38.5us per auth |
| Execution | Self-hosted only | API (managed) or local |
| Post-quantum proofs | No | Yes (STARK + Dilithium integrated) |
| License | BSD-3 + separate patent license required | Apache 2.0 (no patent encumbrance) |
| Type system | Runtime tracing (string hints) | Compile-time type annotations (EncFloat, EncVec[N]) |
How It Works
Five steps from Python function to encrypted computation.
Install
pip install h33-compiler
Rust-only while PyO3 3.14 support lands
Decorate
Add @h33.compile to your function
Compile
Call .compile() — H33 parses the AST, infers types, optimizes the circuit, and selects the best engine
Execute
Call circuit.run(encrypted_input) — runs on encrypted data
Decrypt
Decrypt the result on your side. The server never sees plaintext.
Built in Rust
The compiler is written in Rust with PyO3 bindings. The frontend parses Python AST. The optimizer minimizes multiplicative depth, vectorizes SIMD slots, eliminates common subexpressions, and places relinearizations optimally. The backend emits API calls to H33's production FHE engines.
No external FHE dependencies. No SEAL. No HElib. No OpenFHE. Every cryptographic operation runs on H33's proprietary engines — the same ones benchmarked at 2,172,518 auth/sec on Graviton4.
Open source: Apache 2.0 (same as HICI)
GitHub: github.com/h33ai-postquantum/h33-compiler
// Compiler pipeline (simplified) pub fn compile(ast: &PyAST) -> FheCircuit { let typed = infer_types(ast); let opt = minimize_depth(typed); let vectorized = simd_pack(opt); let engine = fhe_iq_route(&vectorized); let circuit = emit(vectorized, engine); // Relinearization placement place_relin(&mut circuit); // CSE pass eliminate_common_subexpr(&mut circuit); circuit }
See It in Action
Three real workloads. Three different engines. All auto-selected.
import h33 @h33.compile def credit_score(income: h33.EncFloat, debt: h33.EncFloat, history: h33.EncFloat) -> h33.EncFloat: ratio = debt / income weighted = (0.35 * history) + (0.30 * (1.0 - ratio)) + (0.35 * income / 100000) return h33.sigmoid(weighted) # polynomial approx, degree 7 circuit = credit_score.compile() print(circuit.engine) # "CKKS" (float ops detected)
import h33 @h33.compile def encrypted_lookup(query: h33.EncInt, table: h33.EncVec[1024]) -> h33.EncInt: matches = h33.pack([entry == query for entry in table]) index = h33.first_nonzero(matches) return h33.select(index >= 0, table[index], -1) circuit = encrypted_lookup.compile() print(circuit.engine) # "BFV-128" (integer comparison detected)
import h33 @h33.compile def detect_fraud(amount: h33.EncFloat, location: h33.EncInt, history: h33.EncVec[64]) -> h33.EncBool: # Float path (CKKS): compute anomaly score avg = h33.sum(history) / 64.0 deviation = h33.relu(amount - avg * 3.0) score = h33.sigmoid(deviation / 1000.0) # Integer path (BFV-128): check blocklist blocked = location == 9999 # Hybrid merge: compiler auto-splits across engines return (score > 0.7) | blocked circuit = detect_fraud.compile() print(circuit.engine) # "Hybrid(CKKS, BFV-128)" (mixed types detected)
H33 Credit-Based Pricing
Same credits, same rates as all H33 products.
Compilation
The compiler runs on your machine. Parse, optimize, and route your circuits with zero cost. No API key required for compilation.
API Execution
Execute compiled circuits on H33's managed infrastructure. Pay per auth with H33 credits. No GPU, no infrastructure management.
Local Mode
Run compiled circuits on your own hardware. The compiler generates optimized Rust code. No internet access required.
Frequently Asked Questions
Do I need to understand FHE to use H33-Compile?
How is this different from Zama Concrete?
Is it open source?
Can I run compiled circuits offline?
What Python versions are supported?
pip install h33-compiler works on x86_64 and ARM64 (Apple Silicon, Graviton).Write Python. Run It Encrypted.
Ship It Today.
No cryptography PhD. No GPU. No parameter tuning. Just a decorator.
pip install h33-compiler
Rust-only while PyO3 3.14 support lands