Phoenix ML Platform Documentation
Technical documentation for the Phoenix ML Platform β a self-healing, model-agnostic real-time ML inference system built for modularity and production reliability.
What is Phoenix ML?
Phoenix ML is an end-to-end MLOps platform that provides:
- Real-time Inference: Model serving via REST API and gRPC with latency < 10 ms
- Model-Agnostic: Supports any model exported to ONNX (classification, regression, image, NLP)
- Self-Healing: Automatic data drift detection β alert β rollback β export fresh data β retrain
- Multi-Model Management: Champion/Challenger, A/B Testing, Canary Deployment, Shadow Mode
- Full Observability: Prometheus metrics, Grafana dashboards, Jaeger distributed tracing
- Event-Driven: Kafka for async event streaming and real-time prediction logging
- Automated Retraining: Export labeled prediction logs β merge with baseline β retrain on fresh distribution
Tech Stack
| Layer | Technologies |
|---|---|
| Backend API | Python 3.13, FastAPI, gRPC, Uvicorn |
| ML Runtime | ONNX Runtime, TensorRT, Triton Inference Server |
| Frontend | React 19, TypeScript, Vite, Recharts |
| Database | PostgreSQL 15 (async via SQLAlchemy 2.0) |
| Cache/Features | Redis (online feature store) |
| Messaging | Apache Kafka (KRaft mode) |
| Model Registry | MLflow Tracking Server |
| Artifact Storage | MinIO (S3-compatible) |
| Monitoring | Prometheus + Grafana + Jaeger |
| Pipeline | Apache Airflow |
| Deployment | Docker Compose, Kubernetes (Helm) |
| CI/CD | GitHub Actions |
| Quality | Ruff (lint), Mypy (type check), pytest, Vitest, ESLint |
Architecture at a Glance
graph TD
Client[Client] -->|REST / gRPC| API[FastAPI API Gateway]
subgraph "Application"
API --> PH[PredictHandler]
PH --> IS[InferenceService]
IS --> Router[Routing Strategy]
Router --> CB[Circuit Breaker]
CB --> Engine[ONNX / TensorRT / Triton]
end
subgraph "Data"
IS -->|Features| Redis[(Redis)]
API -->|CRUD| PG[(PostgreSQL)]
end
subgraph "Events"
PH -.->|Async| Kafka{Kafka}
end
subgraph "Monitoring"
Monitor[MonitoringService] --> Drift[DriftCalculator]
Drift -.-> Alert[AlertManager]
Alert -.-> Rollback[RollbackManager]
end
subgraph "Observability"
API --> Prometheus
Prometheus --> Grafana
API --> Jaeger
end
Dashboard[React Dashboard] --> API
Documentation Sections
π Architecture
- System Design β Full architecture: layer structure, data flow, infrastructure services, design patterns, self-healing flow
- Frontend Architecture β React dashboard: components, state management, API integration, testing strategy
π‘ API & Deployment
- API Reference β All REST endpoints: inference, batch prediction, model management, drift monitoring, feature store
- Deployment Guide β Docker Compose stack (14+ services), Kubernetes Helm chart, environment config
π Guides
- Library API Guide β Use Phoenix ML as a Python library: programmatic inference, model loading, feature retrieval
- Customization Guide β Add models, implement custom engines/plugins, configure alerts, extend data loaders
- Monitoring & Alerting β Drift detection algorithms, anomaly detection, Prometheus metrics, Grafana dashboards, webhook alerts
- Troubleshooting β Common issues, error reference, debug commands, port mapping
- Contributing β Development setup, branching strategy, code standards, PR checklist
π Architecture Decision Records
| # | Decision | Status |
|---|---|---|
| 002 | ONNX Runtime as unified inference engine | β Accepted |
| 003 | Apache Kafka for event streaming | β Accepted |
| 004 | Prometheus + Grafana for observability | β Accepted |
π Blog Posts
- System Design Overview β Architecture decisions deep dive
- Self-Healing ML β Automated drift detection and model recovery
- Performance Optimization β Latency, throughput, and batching engineering
Quick Start
# Clone and setup
git clone https://github.com/vtnguyen04/phoenix_ML.git
cd phoenix_ML && cp .env.example .env
# Start all services
docker compose up -d
docker compose -f docker-compose.airflow.yaml up -d
# Train all models
uv run python scripts/generate_datasets.py
uv run python examples/credit_risk/train.py
uv run python examples/house_price/train.py
uv run python examples/fraud_detection/train.py
uv run python examples/image_classification/train.py
uv run python examples/sentiment/train.py
# Run full simulation
uv run python scripts/simulate_pipeline.py --fast
# Access
# API: http://localhost:8001/docs
# Frontend: http://localhost:5174
# MLflow: http://localhost:5001
# Grafana: http://localhost:3001
# Airflow: http://localhost:8080
Project Stats
| Metric | Value |
|---|---|
| Source files | 145+ Python, 30+ TypeScript |
| Test files | 60 backend + 16 frontend = 76 total |
| Test coverage | 87% backend |
| Lint/Type check | Ruff 0 errors, Mypy 0 errors, ESLint 0 errors, TSC 0 errors |
| Docker services | 14 containers |
| Models supported | 5 (credit-risk, fraud-detection, house-price, image-classification, sentiment) |
Repository: phoenix_ML