AI inference in your terminal. PII-stripped, compliance-logged, cost-optimized.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
astrai_sdk-0.2.0.tar.gz
(73.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astrai_sdk-0.2.0.tar.gz.
File metadata
- Download URL: astrai_sdk-0.2.0.tar.gz
- Upload date:
- Size: 73.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0828992fb541dec5933d5ae681eb22de2c3dfd85dbe40f25f1ffb3de1e797187
|
|
| MD5 |
cb49b04371eff399c98db2857db869a9
|
|
| BLAKE2b-256 |
61f2a33dbd925e6a0185d4843d14cafa14ee8fbac2a45bb64fc51f3b85febdd3
|
File details
Details for the file astrai_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: astrai_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 42.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81a217af38619c04057d756aefc99dfc5e5d534776a3b484a3104cc60d64c04a
|
|
| MD5 |
3b202e3eb6b79ad2ef5a86be2a0b14c2
|
|
| BLAKE2b-256 |
7496c7d02b18497cd732627bf886b5dd9a9fdc606b8219803deb23577d30759b
|