Skip to content

candela-sidecar

The Candela Sidecar is a lightweight Go proxy (< 5MB) built for production container environments. It provides LLM request proxying, OpenTelemetry tracing, and cost calculation with minimal overhead. Budget enforcement is optionally available.

  • Zero-config GCP auth via Application Default Credentials (ADC)
  • W3C Trace Context propagationtraceparent/tracestate headers
  • Async span export via Google Cloud Pub/Sub or OTLP
  • Cost calculation with the shared costcalc engine
  • Budget enforcement (optional) — enable for per-user spending limits, or omit for observability-only mode
  • Single static binary — < 5MB, no runtime dependencies
RouteProviderAuth
/proxy/google/*Google Gemini (native format)ADC
/proxy/openai/*OpenAI APIAPI key in config
/proxy/anthropic/*Anthropic (via Vertex AI)ADC
/proxy/anthropic-vertex/*Anthropic (native Vertex AI, for Claude Code)ADC
/proxy/anthropic-direct/*Anthropic (direct to api.anthropic.com)Client API key
/proxy/gemini-oai/*Google Gemini (OpenAI-compatible format)ADC

Environment variables:

VariableRequiredDescription
GCP_PROJECTGCP project for Vertex AI and Pub/Sub
GCP_REGIONVertex AI region (default: us-central1)
PUBSUB_TOPICPub/Sub topic for span export
OTLP_ENDPOINTOTLP HTTP endpoint for span export
PORTListen port (default: 8080)
BUDGET_DBBudget store connection string (omit to disable budget enforcement)
Terminal window
docker run -p 8080:8080 \
-e GCP_PROJECT=my-project \
-e PUBSUB_TOPIC=candela-spans \
ghcr.io/candelahq/candela-sidecar:latest
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
template:
spec:
containers:
- name: app
image: my-app:latest
env:
- name: LLM_BASE_URL
value: "http://localhost:8080/proxy/google"
- name: candela-sidecar
image: ghcr.io/candelahq/candela-sidecar:latest
ports:
- containerPort: 8080
env:
- name: GCP_PROJECT
value: my-project
- name: PUBSUB_TOPIC
value: candela-spans
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "64Mi"
cpu: "100m"
service.yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: my-service
spec:
template:
spec:
containers:
- image: my-app:latest
ports:
- containerPort: 3000
- image: ghcr.io/candelahq/candela-sidecar:latest
env:
- name: GCP_PROJECT
value: my-project
candela-sidecarcandela-server
Best forContainers, CI, productionLocal dev with UI
Size< 5MB binaryFull server
StoragePub/Sub + OTLP exportDuckDB, SQLite, BigQuery
Budget enforcementOptionalYes
UINoneDashboard at :3000
Default port:8080:8181
Terminal window
curl http://localhost:8080/healthz