Skip to main content

AI API Trust & Cost Transparency SDK — Audit your LLM relay providers

Project description

TruthProbe SDK

AI API Trust & Cost Transparency — Know if your relay provider is honest.

Install

pip install truthprobe

Quick Start

import truthprobe
truthprobe.patch()

# Use OpenAI SDK as normal — TruthProbe monitors in background
from openai import OpenAI
client = OpenAI(api_key="sk-xxx", base_url="https://your-relay.com/v1")
response = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Hello"}]
)
# After each response, you'll see:
# ✓ ¥0.032 │ claude-sonnet-4-6 │ 1.2s

CLI

truthprobe report      # Full audit report
truthprobe balance     # Check provider balances
truthprobe score       # Current trust score

Configuration

import truthprobe

truthprobe.init(
    providers=[
        {"name": "RelayA", "base_url": "https://relay-a.com/v1", "key": "sk-aaa"},
        {"name": "RelayB", "base_url": "https://relay-b.com/v1", "key": "sk-bbb"},
    ],
    lang="zh",                    # "zh" or "en" (auto-detected by default)
    alert_balance_threshold=50,   # Alert when balance < ¥50
    currency_symbol="¥",
)

truthprobe.patch()

Silent Mode

truthprobe.patch(quiet=True)    # No output at all, just records
truthprobe.patch(verbose=False) # No per-request line, but alerts still fire

What It Detects

  • Model downgrade: Relay claims to use GPT-4o but serves GPT-4o-mini
  • Timing anomalies: Response too fast for the claimed model
  • Text quality drops: Vocabulary richness / reasoning depth below model baseline

Alerts (automatic, no config needed)

  1. Balance danger: When any provider balance < threshold
  2. Trust collapse: When suspicious rate > 30% in recent 20 requests

License

MIT

Project details


Download files

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

Source Distribution

truthprobe-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

truthprobe-0.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file truthprobe-0.1.0.tar.gz.

File metadata

  • Download URL: truthprobe-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for truthprobe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f0728f147ab00943e5a8838ea765e10584d39fb6f0d1d26837bf44f7ccc227d
MD5 ef8c2212b45b13588fa063e72212437b
BLAKE2b-256 3475a2b4257399d5a1aef0eaf3cc9848591b08ae71b4e397eb64d676c17924bc

See more details on using hashes here.

File details

Details for the file truthprobe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: truthprobe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for truthprobe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69ca3d211fbe8f97fed6efd42bd5d7eb7a414e337db6d29904b31fcf3cab49a8
MD5 22b5de4e045fc790044d5a76c5dcb0e0
BLAKE2b-256 06f5cf2a81321bf184fdbe150f21435d6979744946e32bec069d13f116927199

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page