AI_Catalyst Framework
A production-ready AI components framework with enterprise-grade security, resilience, and async performance optimizations.
🚀 Features
Core Components
- 🤖 Three-Tier LLM System - Local/Network/OpenAI with concurrent failover (3x faster)
- 🔒 PII Detection & Scrubbing - Enterprise-grade data protection with audit logging
- 📁 Multi-Format File Processing - Async streaming for JSON, JSONL, CSV, TXT
- 🗄️ Database Patterns - Async PostgreSQL with connection pooling
- ⚙️ Configuration Management - Encrypted config with key rotation
- 📊 System Monitoring - Health checks and performance metrics
Security & Resilience
- 🔐 Secure Configuration - AES-256 encryption for sensitive data
- 🔑 API Key Vault - Secure storage with automatic rotation
- 🚦 Rate Limiting - Token bucket algorithm with configurable limits
- 📋 Audit Logging - Comprehensive compliance tracking
- 🔄 Retry Logic - Exponential backoff with circuit breakers
- 💚 Health Monitoring - Continuous service availability checks
📦 Installation
pip install ai-catalyst
⚡ Quick Start
Basic Usage
import asyncio
from ai_catalyst import LLMProvider, PIIProcessor, FileProcessor
async def main():
# LLM with automatic failover
llm = LLMProvider()
response = await llm.generate_async("Explain quantum computing")
print(f"Response: {response['content']}")
# PII scrubbing with audit logging
pii = PIIProcessor()
clean_text = await pii.scrub_text_async("Call John at 555-1234")
print(f"Scrubbed: {clean_text}") # "Call <NAME> at <PHONE>"
# Async file processing
processor = FileProcessor()
async for item in processor.process_file_async("data.json"):
print(f"Processed: {item['data']}")
asyncio.run(main())
Production Setup with Security
from ai_catalyst import (
LLMProvider, APIKeyVault, RateLimiter,
AuditLogger, SecureConfigManager
)
# Setup secure environment
key_vault = APIKeyVault()
key_vault.store_key('openai', 'your-api-key')
rate_limiter = RateLimiter()
audit_logger = AuditLogger(log_file='audit.log')
# Initialize with security components
llm = LLMProvider(
key_vault=key_vault,
rate_limiter=rate_limiter,
audit_logger=audit_logger
)
🏗️ Architecture
Async-First Design
- Non-blocking I/O - All operations are async by default
- Concurrent Processing - Parallel execution with semaphore control
- Backward Compatibility - Sync wrappers for existing code
- Resource Management - Proper cleanup and session handling
Security Model
- Zero-Trust - All operations are logged and rate-limited
- Encryption - Sensitive data encrypted at rest
- Audit Trail - Complete compliance logging
- Access Control - API key management with rotation
Resilience Patterns
- Circuit Breakers - Automatic failure detection and recovery
- Retry Logic - Exponential backoff with jitter
- Health Checks - Continuous service monitoring
- Graceful Degradation - Fallback strategies for all components
📊 Performance
| Operation | Before | After | Improvement |
|---|---|---|---|
| LLM Failover | 45s | 15s | 3x faster |
| Batch PII Processing | 60s | 12s | 5x faster |
| File Processing | Blocking | Streaming | Non-blocking |
| Rate Limiting | N/A | <1ms | Sub-millisecond |
🔧 Configuration
Environment Variables
# API Keys
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key"
# Security
export AI_CATALYST_MASTER_KEY="your-encryption-key"
Configuration File
# config.yaml
llm:
timeout: 30
model: "gpt-4"
security:
rate_limits:
openai: "paid" # or "free"
audit_log: "audit.log"
processing:
batch_size: 100
max_concurrency: 10
🧪 Testing
# Install with dev dependencies
pip install ai-catalyst[dev]
# Run tests
pytest
# Run with coverage
pytest --cov=ai_catalyst
📚 Documentation
- Migration Guide - Upgrading to async
- Security Guide - Enterprise security setup
- Performance Guide - Optimization tips
- API Reference - Complete API documentation
🤝 Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
📄 License
MIT License - see LICENSE file for details.
🆘 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security: Report security issues privately to security@example.com
Metadata
Release files for ai-catalyst 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ai_catalyst-0.1.1.tar.gz | 40.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ai_catalyst-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.5 kB
Release files / ai_catalyst-0.1.1.tar.gz
| Download URL | ai_catalyst-0.1.1.tar.gz |
|---|---|
| Size | 40.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75c4006604dc0a2aad8186df81b970d1e5c69c0ee00986f5b96fe6a8f4b579be
|
|
BLAKE2b-256 checksum How to use checksums |
0091c4800c553858398c6ef96df1084b97260a4a3a2a56232efbf7c378c1b441
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / ai_catalyst-0.1.1-py3-none-any.whl
| Download URL | ai_catalyst-0.1.1-py3-none-any.whl |
|---|---|
| Size | 43.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4e3c129e9810a05760a90daabede388f64e72f24a3cf8bc859f7a20048e4e92
|
|
BLAKE2b-256 checksum How to use checksums |
4a6ed16864f409c6441e7e742a6812ed528663bb919651a4e93e455255016dcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for ai-catalyst 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.