System Overview
Helicone is built as a modular, scalable system with six core components:Core Components
Web (Next.js)
Technology: Next.js 14, React, TailwindCSS Purpose: Frontend dashboard for visualizing and managing your LLM observability data. Key Features:- Request logs and trace visualization
- Cost and latency analytics
- Prompt management UI
- Session and agent tracing
- User and organization management
- Evaluation and scoring interfaces
Jawn (Backend API)
Technology: Node.js, Express, TypeScript, Tsoa (OpenAPI) Purpose: Main backend API server that handles all business logic and data operations. Responsibilities:- REST API endpoints for the web dashboard
- Request and response logging
- Prompt versioning and deployment
- User authentication and authorization
- Analytics aggregation
- Webhook management
- Dataset creation and management
/v1/request/*- Request logging and retrieval/v1/prompt/*- Prompt management/v1/user/*- User and organization management/v1/analytics/*- Analytics queries
Worker (Cloudflare Workers / Node.js)
Technology: TypeScript, running on Node.js (self-hosted) or Cloudflare Workers (cloud) Purpose: High-performance proxy that intercepts LLM requests, logs them, and forwards to providers. Worker Types:-
OpenAI Proxy (Port 8787)
- Proxies requests to OpenAI API
- Logs requests to ClickHouse
- Stores bodies in MinIO
-
Anthropic Proxy (Port 8790)
- Proxies requests to Anthropic API
- Handles streaming responses
-
Gateway API (Port 8789)
- Unified gateway for multiple providers
- Intelligent routing and fallbacks
-
Helicone API (Port 8788)
- Internal API worker
- Async logging endpoints
PostgreSQL (Application Database)
Technology: PostgreSQL 17 Purpose: Stores application data including users, organizations, API keys, prompts, and metadata. Key Tables:auth.users- User accountspublic.organization- Organizationspublic.helicone_api_keys- API keyspublic.prompts- Prompt versionspublic.request- Request metadata (references ClickHouse)public.properties- Custom propertiespublic.feedback- User feedback and ratings
ClickHouse (Analytics Database)
Technology: ClickHouse 24.3 Purpose: High-performance columnar database for storing and analyzing request logs at scale. Key Tables:default.request_response_versioned- Main request/response logdefault.request_response_rmt- Replicated table for HAdefault.properties_v2- Request propertiesdefault.score_value- Evaluation scoresdefault.cache_hits- Cache performance data
- Handles billions of rows efficiently
- Fast aggregations for analytics
- Excellent compression (10x+ vs PostgreSQL)
- Optimized for time-series data
- HTTP: 8123 (mapped to 18123)
- Native: 9000 (mapped to 19000)
MinIO (Object Storage)
Technology: MinIO (S3-compatible) Purpose: Stores large request and response bodies separately from metadata. Buckets:request-response-storage- Full request/response bodiesprompt-body-storage- Prompt templates and versionshql-store- HQL query results
- Request/response bodies can be very large (images, documents, etc.)
- Storing in database would bloat tables and slow queries
- S3-compatible storage is cheap and scalable
- Bodies are referenced by ID in ClickHouse
- API: 9000
- Console: 9001
Request Flow
1. Proxied Request Flow
When an LLM request goes through Helicone’s proxy:2. Dashboard Query Flow
When viewing requests in the dashboard:Data Storage Strategy
What Goes Where?
| Data Type | Storage | Reason |
|---|---|---|
| User accounts | PostgreSQL | Relational, requires ACID |
| API keys | PostgreSQL | Needs auth lookups |
| Prompt versions | PostgreSQL | Small, relational |
| Request metadata | ClickHouse | Fast analytics, billions of rows |
| Request/response bodies | MinIO | Large blobs, cheap storage |
| Properties | ClickHouse | Time-series, analytics |
| Scores/evaluations | ClickHouse | Time-series, analytics |
Data Retention
High Availability Architecture
For production deployments:Security Architecture
Authentication Flow
-
User Authentication (Better Auth)
- Email/password via PostgreSQL
- Session tokens stored in cookies
- OAuth providers (Google, GitHub)
-
API Key Authentication
- API keys stored in PostgreSQL
- Validated on each proxy request
- Scoped to organizations
-
Service-to-Service
- Internal services trust each other
- Network isolation in production
- Service accounts for workers
Data Security
Scalability
Horizontal Scaling
Stateless Services (can scale infinitely):- Web: Add more replicas behind load balancer
- Jawn: Add more replicas behind load balancer
- Workers: Add more worker instances
- PostgreSQL: Primary + read replicas
- ClickHouse: Sharded cluster with replication
- MinIO: Distributed mode with erasure coding
Vertical Scaling
Recommended resource allocation:| Service | CPU | Memory | Storage |
|---|---|---|---|
| Web | 0.5-1 core | 1-2GB | Minimal |
| Jawn | 1-2 cores | 2-4GB | Minimal |
| Worker | 0.5-1 core | 512MB-1GB | Minimal |
| PostgreSQL | 2-4 cores | 4-8GB | 100GB+ |
| ClickHouse | 4-8 cores | 8-16GB | 500GB+ |
| MinIO | 1-2 cores | 2-4GB | 1TB+ |
Monitoring
Health Checks
All services expose health endpoints:Metrics
Exposed Prometheus metrics:- HTTP request latency (p50, p95, p99)
- Request volume per endpoint
- Error rates
- Database connection pool stats
- Queue depths
- Cache hit rates
Next Steps
Docker Deployment
Deploy with Docker Compose
Kubernetes
Production deployment with Helm
