Skip to main content

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
Configuration:
Default Port: 3000

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
Configuration:
Default Port: 8585 Key Endpoints:
  • /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:
  1. OpenAI Proxy (Port 8787)
    • Proxies requests to OpenAI API
    • Logs requests to ClickHouse
    • Stores bodies in MinIO
  2. Anthropic Proxy (Port 8790)
    • Proxies requests to Anthropic API
    • Handles streaming responses
  3. Gateway API (Port 8789)
    • Unified gateway for multiple providers
    • Intelligent routing and fallbacks
  4. Helicone API (Port 8788)
    • Internal API worker
    • Async logging endpoints
Configuration:

PostgreSQL (Application Database)

Technology: PostgreSQL 17 Purpose: Stores application data including users, organizations, API keys, prompts, and metadata. Key Tables:
  • auth.users - User accounts
  • public.organization - Organizations
  • public.helicone_api_keys - API keys
  • public.prompts - Prompt versions
  • public.request - Request metadata (references ClickHouse)
  • public.properties - Custom properties
  • public.feedback - User feedback and ratings
Configuration:
Default Port: 5432 (mapped to 54388 in docker-compose)

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 log
  • default.request_response_rmt - Replicated table for HA
  • default.properties_v2 - Request properties
  • default.score_value - Evaluation scores
  • default.cache_hits - Cache performance data
Why ClickHouse?
  • Handles billions of rows efficiently
  • Fast aggregations for analytics
  • Excellent compression (10x+ vs PostgreSQL)
  • Optimized for time-series data
Configuration:
Default Ports:
  • 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 bodies
  • prompt-body-storage - Prompt templates and versions
  • hql-store - HQL query results
Why Separate Storage?
  • 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
Configuration:
Default Ports:
  • 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 Retention

High Availability Architecture

For production deployments:

Security Architecture

Authentication Flow

  1. User Authentication (Better Auth)
    • Email/password via PostgreSQL
    • Session tokens stored in cookies
    • OAuth providers (Google, GitHub)
  2. API Key Authentication
    • API keys stored in PostgreSQL
    • Validated on each proxy request
    • Scoped to organizations
  3. 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
Stateful Services (require clustering):
  • PostgreSQL: Primary + read replicas
  • ClickHouse: Sharded cluster with replication
  • MinIO: Distributed mode with erasure coding

Vertical Scaling

Recommended resource allocation:

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