Otellix

May 5, 2026 ยท View on GitHub

Stop the LLM Bill Shock. Production-grade observability for Go backends โ€” built on OpenTelemetry.

Otellix Dashboard

Live Interactive Demo โ†’

CI Go Reference Go Report Card License: MIT


๐Ÿ’ธ The Problem: "Bill Shock" is Real

Most LLM observability tools tell you what you spent after the money is gone. In production, a recursive prompt loop or a single "power user" can rack up thousands in costs before your billing alerts even trigger.

Otellix is different. It brings real-time cost enforcement to the application layer.


โšก Key Features

  • โ›“๏ธ LangChainGo Integration: Drop-in callbacks.Handler for LangChainGo. Zero-config cost tracking for complex chains.
  • ๐Ÿ”Œ Zero-Config Attribution: Automatically capture user_id and project_id from Gin/Echo middleware. No more manual context plumbing.
  • ๐Ÿ—„๏ธ Redis Budget Store: Distributed budget enforcement for high-availability production clusters.
  • ๐Ÿš€ Go-Native & High-Performance: Built for Go 1.22+ using native streaming and OpenTelemetry.
  • ๐Ÿ“Š Standard-Compliant (OTel): 100% OTel compliant. Works with Jaeger, Honeycomb, Prometheus, and Grafana.
  • ๐Ÿ’Ž Prompt Caching ROI: Track exactly how much you save with Anthropic/OpenAI prompt caching.

๐Ÿš€ Quick Start

go get github.com/oluwajubelo1/otellix

๐Ÿ•น๏ธ Try it Locally (Docker)

Want to see the full stack (Prometheus + Grafana) in action? Run our one-liner demo:

curl -sL https://raw.githubusercontent.com/oluwajubelo1/otellix/main/scripts/demo.sh | bash

1. Simple Tracing

Wrap your provider calls to get instant cost attribution and standard OTel spans.

p := openai.New()
result, err := otellix.Trace(ctx, p, params,
    otellix.WithUserID("user_456"),
)

2. LangChainGo Integration

Just add the Otellix handler to your LLM configuration.

import "github.com/oluwajubelo1/otellix/integrations/langchaingo"

handler := langchaingo.NewOtellixHandler()
p, _ := openai.New(openai.WithCallback(handler))

// Automatically captures all chain events, costs, and spans.
res, err := p.GenerateContent(ctx, parts)

3. Middleware Attribution

Stop manually passing IDs. Use our middleware to discover identity from headers/sessions.

r := gin.Default()
r.Use(otellixgin.Middleware()) // Automatically populates context with User/Project IDs

๐Ÿ“Š Standardized OTel Attributes

Otellix populates your spans with industry-standard attributes:

AttributeDescription
llm.providerThe LLM provider (OpenAI, Anthropic, etc.)
llm.usage.cache_read_tokensTokens served from provider cache (Savings!)
llm.cost_usdReal-time USD cost of the call
llm.budget.blockedFlag if the call was blocked by guardrails

๐Ÿ—๏ธ Supported Providers

  • Anthropic: Claude 3.5 with full Prompt Caching metrics.
  • OpenAI: GPT-4o, GPT-4o-mini with caching support.
  • Google Gemini: Gemini 1.5 Pro & Flash.
  • Ollama: Local models with zero-dependency streaming.

๐Ÿ“– Deep Dives


๐Ÿค Contributing

We love stars and contributions! Please see CONTRIBUTING.md. Licensed under MIT.