Astrai — Compliant LLM Gateway
PII stripping, audit logs, multi-model routing. Built for regulated industries.
pip install astrai
Quick Start
# Configure your API key
astrai config --api-key YOUR_KEY
# Chat with the best model (auto-routed)
astrai chat "What is risk parity?"
# Use a specific model
astrai chat -m claude-opus-4.5 "Explain Black-Scholes"
# Export audit log for compliance
astrai audit --days 30 -o audit.json
Commands
| Command | Description |
|---|---|
astrai chat |
Send a chat message (streaming) |
astrai models |
List available models and pricing |
astrai health |
Model health dashboard |
astrai usage |
Usage statistics and spend |
astrai audit |
Export compliance audit log |
astrai preferences |
View learned routing preferences |
astrai config |
Configure API key, model, strategy |
Features
- Auto-routing: Automatically picks the best model for cost/quality/latency
- PII stripping: Sensitive data is stripped before reaching external models
- Audit logs: Every request is logged with model, cost, latency, routing reason
- BYOK: Bring your own API keys per provider
- Fallback chains: Claude -> GPT -> Llama automatic failover
- EU routing: Route to EU-based providers for GDPR compliance
Models
| Tier | Models | Use Case |
|---|---|---|
| Ultra | claude-opus-4.5, gpt-5.2, gemini-3-pro | Complex analysis |
| Target | llama-4-maverick, deepseek-v3.2, llama-3.3-70b | General use |
| Draft | llama-4-scout, gemini-3-flash | Fast/cheap tasks |
| Reasoning | o3, deepseek-r1 | Multi-step reasoning |
Environment Variables
| Variable | Description |
|---|---|
ASTRAI_API_KEY |
Your Astrai API key |
ASTRAI_API_URL |
Custom API endpoint |
ASTRAI_MODEL |
Default model override |
For Compliance Officers
Export a complete audit trail of all AI model usage:
# JSON export for the last 30 days
astrai audit --days 30 --format json -o compliance_report.json
# Weekly CSV export
astrai audit --days 7 --format csv -o weekly_audit.csv
Each audit record includes:
- Timestamp, model used, provider
- Routing reason (cost, quality, preference)
- Token count, cost, latency
- Task type classification
Metadata
Release files for astrai-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| astrai_sdk-0.2.0.tar.gz | 73.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| astrai_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 115.5 kB
Release files / astrai_sdk-0.2.0.tar.gz
| Download URL | astrai_sdk-0.2.0.tar.gz |
|---|---|
| Size | 73.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0828992fb541dec5933d5ae681eb22de2c3dfd85dbe40f25f1ffb3de1e797187
|
|
BLAKE2b-256 checksum How to use checksums |
61f2a33dbd925e6a0185d4843d14cafa14ee8fbac2a45bb64fc51f3b85febdd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / astrai_sdk-0.2.0-py3-none-any.whl
| Download URL | astrai_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 42.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81a217af38619c04057d756aefc99dfc5e5d534776a3b484a3104cc60d64c04a
|
|
BLAKE2b-256 checksum How to use checksums |
7496c7d02b18497cd732627bf886b5dd9a9fdc606b8219803deb23577d30759b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|