Skip to main content

OpenAnchor

See every LLM request. Track costs, latency, and quality in real-time.

Sit between your app and LLM providers. Observe token usage, latency, cost, and execution metrics for every request. Identify optimization opportunities before they become expensive problems.

PyPI Python 3.10+ Tests: 25 Passing License: Proprietary


30-Second Start

from openanchor import Observer

# Wrap your LLM client (any provider)
with Observer() as observer:
    response = client.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": "Hello"}]
    )

# Instant metrics
print(f"Cost: ${observer.cost:.4f}")
print(f"Tokens: {observer.tokens}")
print(f"Latency: {observer.latency_ms}ms")

Why OpenAnchor?

The Problem:

  • You don't know how much you're spending on LLMs
  • Latency spikes go unnoticed until users complain
  • No visibility into which prompts are expensive
  • Cost optimization is guesswork

The Solution:

  • Transparent observation of every LLM request
  • Real-time cost tracking across all providers
  • Latency analysis and bottleneck detection
  • Automatic optimization recommendations

Key Features

  • Real-Time Metrics: Cost, tokens, latency, model, provider
  • Multi-Provider: Claude, GPT-4, Gemini, Llama, custom APIs
  • Cost Attribution: See exactly which features cost the most
  • Telemetry Export: Send to Datadog, Prometheus, cloud observability platforms
  • Alerts: Notify when costs exceed thresholds
  • Quality Metrics: Track accuracy, token efficiency, response quality
  • Historical Analysis: Trends over time

Real-World Use Cases

Monitor Costs:

with Observer() as observer:
    for i in range(100):
        response = client.chat(prompt)

daily_cost = observer.total_cost
print(f"Daily LLM spending: ${daily_cost:.2f}")
if daily_cost > 100:
    alert("LLM costs spiking!")

Optimize Prompts:

# Test different approaches
results = []
for prompt_version in [v1, v2, v3]:
    with Observer() as obs:
        response = client.chat(prompt_version)
    results.append({
        "version": prompt_version,
        "cost": obs.cost,
        "tokens": obs.tokens,
        "quality": evaluate(response)
    })

# v2 is cheapest and best
best = min(results, key=lambda x: x['cost'])

Detect Problems:

with Observer() as observer:
    for req in requests:
        observer.track(req)

# Latency spiked?
if observer.p99_latency > 2000:
    print("Provider degradation detected")

Metrics Collected

Metric Type Example
Cost USD $0.012
Tokens Count 245 input, 43 output
Latency ms 245ms
Model String gpt-4-turbo
Provider String openai
Quality Score 0.95

Installation

pip install openanchor
# or with uv
uv pip install openanchor

Documentation


License

Proprietary License - Free to use with explicit attribution. See LICENSE.


OpenAnchor v2.0.0 | LLM observability | Python 3.10+ | 25 tests passing

License

MIT


MCP 2.0 Mega-Platform | v2.0.0 | Wheels-Only Distribution

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openanchor-0.4.0.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openanchor-0.4.0-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file openanchor-0.4.0.tar.gz.

File metadata

  • Download URL: openanchor-0.4.0.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for openanchor-0.4.0.tar.gz
Algorithm Hash digest
SHA256 82220583ef93d2bc5e8fff569f13252e24ee2c9042f5cc4bda9368e1bd5a3e93
MD5 d56bda6e3fe1a3969091ba9191d1be4d
BLAKE2b-256 cfa97a83991b4c85c00625917b29c3dd882cc5840a24deda29496931f25a8a77

See more details on using hashes here.

File details

Details for the file openanchor-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: openanchor-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for openanchor-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97bf76f27910d4c8536811ee0c2e3cebec8f726039036a9d11e056ec6a3b7010
MD5 0aa8286288112f9a754c5244b3708628
BLAKE2b-256 ad820155fc04ddb1250d26d3e7456865d80715e7dd16a09dadd681b5452d1ddb

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.2.0

2 files

0.1.4

1 file

0.1.2

2 files

0.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page