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.2.0.tar.gz (30.5 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.2.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for openanchor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fdc5b408772a1c9e2a1d5fc6475b0d173dbefea7474052c2f75ba6783a640b50
MD5 937720e83dfaff5944996bb3a9b5b103
BLAKE2b-256 57c95993463d6eb1636b7185a104d38cf7cd043987bffa257a8bee6edbce0562

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openanchor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4c09814c0568a9225df88ff045983c5ccd0f9c745c218ca92f6cf4a8c909e05
MD5 466afc6c2ec2ea9d3808586a2b83aea3
BLAKE2b-256 022dfba7deff35728fe633fc489a2831f6be1f41eb4d817ee2664b4087f8f411

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

This release

0.2.0 This release

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