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.5.0.tar.gz (42.2 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.5.0-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for openanchor-0.5.0.tar.gz
Algorithm Hash digest
SHA256 fa90cb58ce16cbcf80bf7d8034d4599b8c3a971cfb26fa52c19a81e224f1e8c2
MD5 56ab204fcdd82f540c48a47f5656edfe
BLAKE2b-256 a5eb1e02c944510f6682d77940520b63e8a42c30b516474ea7ad73670660e211

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openanchor-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 37.3 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 216e1cccd12b5f93ece1535860eadc81e1994ef85b6dc90e03d327dfe977e3d6
MD5 6be0a5cc06bfa4e463d429d2edbdb510
BLAKE2b-256 917a83c337ca1db7dc28e214607f36a103531ae91177fb33ff0a76a05bad95b0

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.1

2 files

0.6.0

2 files

This release

0.5.0 This release

2 files

0.4.0

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