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, cost calculation, and budget enforcement with minimal overhead.

  • 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 via Firestore
  • 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

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)
FIRESTORE_DBFirestore database for 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 enforcementYes (via Firestore)Yes (via local store)
UINoneDashboard at :3000
Default port:8080:8181
Terminal window
curl http://localhost:8080/healthz