Update Python version requirements and fix compatibility issues

- Bump minimum Python version from 3.11 to 3.13 across all apps
- Add Python 3.11-3.13 test matrix to CLI workflow
- Document Python 3.11+ requirement in .env.example
- Fix Starlette Broadcast removal with in-process fallback implementation
- Add _InProcessBroadcast class for tests when Starlette Broadcast is unavailable
- Refactor API key validators to read live settings instead of cached values
- Update database models with explicit
This commit is contained in:
oib
2026-02-24 18:41:08 +01:00
parent 24b3a37733
commit 825f157749
270 changed files with 66674 additions and 2027 deletions

View File

@@ -0,0 +1,75 @@
# FHE Integration Plan for AITBC
## Candidate Libraries
### 1. Microsoft SEAL (C++ with Python bindings)
**Pros:**
- Mature and well-maintained
- Supports both BFV and CKKS schemes
- Good performance for ML operations
- Python bindings available
- Extensive documentation
**Cons:**
- C++ dependency complexity
- Larger binary size
- Steeper learning curve
**Use Case:** Heavy computational ML workloads
### 2. TenSEAL (Python wrapper for SEAL)
**Pros:**
- Pure Python interface
- Built on top of SEAL
- Easy integration with existing Python codebase
- Good for prototyping
**Cons:**
- Performance overhead
- Limited to SEAL capabilities
- Less control over low-level operations
**Use Case:** Rapid prototyping and development
### 3. Concrete ML (Python)
**Pros:**
- Designed specifically for ML
- Supports neural networks
- Easy model conversion
- Good performance for inference
**Cons:**
- Limited to specific model types
- Newer project, less mature
- Smaller community
**Use Case:** Neural network inference on encrypted data
## Recommended Approach: Hybrid ZK + FHE
### Phase 1: Proof of Concept with TenSEAL
- Start with TenSEAL for rapid prototyping
- Implement basic encrypted inference
- Benchmark performance
### Phase 2: Production with SEAL
- Migrate to SEAL for better performance
- Implement custom optimizations
- Integrate with existing ZK circuits
### Phase 3: Specialized Solutions
- Evaluate Concrete ML for neural networks
- Consider custom FHE schemes for specific use cases
## Integration Architecture
```
Client Request → ZK Proof Generation → FHE Computation → ZK Result Verification → Response
```
### Workflow:
1. Client submits encrypted ML request
2. ZK circuit proves request validity
3. FHE computation on encrypted data
4. ZK circuit proves computation correctness
5. Return encrypted result with proof