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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

openanchor-0.1.4-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openanchor-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.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.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17617cb8727834627b457400df3f619ef67eee1959e8675c648609c23df7cbb0
MD5 ce82d29780a1256f916677976aecbd76
BLAKE2b-256 f4df31da5280acc6fae218731486612fdac34ed120f887fd43832c83602f0d56

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

0.4.0

2 files

0.2.0

2 files

This release

0.1.4 This release

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