Skip to main content

Automatically capture and send LLM trace data from GraphBit applications to your observability API endpoint

Project description

BitPulse

Python Version License PyPI

Production-grade LLM observability for GraphBit workflows.

  • Zero-config automatic tracing for LLM calls and workflows
  • Captures prompts, responses, tokens, latency, errors
  • Sends trace data to your observability API endpoint

Project Info

  • Python: 3.10–3.13
  • License: GraphBit Framework License
  • PyPI: bitpulse
  • PRs: Welcome via GitHub pull requests

Install

pip install bitpulse

Python: 3.10–3.13

What It Does

BitPulse automatically captures detailed trace data from GraphBit LLM clients and workflows and submits it to your observability endpoint for monitoring, analytics, and debugging.

Key Features

  • Automatic tracing for LLM calls and workflows
  • Rich metadata: prompts, responses, tokens, latency, finish reasons, errors
  • Tool-call detection for agent workflows
  • Works with OpenAI and GraphBit internals
  • Type-safe models (Pydantic) and robust async I/O

Quick Start

import asyncio, os
from graphbit import LlmClient, LlmConfig
from bitpulse import AutoTracer

async def main():
    tracer = await AutoTracer.create()
    cfg = LlmConfig.openai(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o-mini")
    client = tracer.wrap_client(LlmClient(cfg), cfg)
    resp = await client.complete_full_async("What is GraphBit?", max_tokens=100)
    results = await tracer.send()
    print("sent:", results["sent"], "failed:", results["failed"])

asyncio.run(main())

Configuration

Set environment variables to configure external endpoints:

export BITPULSE_TRACING_API_KEY="your-api-key"
export BITPULSE_TRACEABLE_PROJECT="your-project-name"
# optional
export BITPULSE_TRACING_API_URL="https://your-api-endpoint.com/traces"

Links

License

GraphBit Framework License. See LICENSE.md in the repository.

Trace Data Format Example

Example JSON payload sent to your observability endpoint:

{
    "tracing_api_key": "your-api-key",
    "traceable_project_name": "your-project",
    "run_name": "LlmClient",
    "run_type": "llm",
    "status": "success",
    "input": "Hello, world!",
    "output": "Hi there!",
    "error": null,
    "start_time": "2025-01-01T00:00:00Z",
    "latency": 123.45,
    "tokens": 50,
    "metadata": {
        "model_name": "gpt-4o-mini",
        "provider": "openai",
        "input_tokens": 10,
        "output_tokens": 40,
        "finish_reason": "stop"
    }
}

API Reference

High-level AutoTracer methods:

  • AutoTracer.create(): Initialize tracer
  • wrap_client(llm_client, llm_config): Trace LLM client calls
  • wrap_executor(executor, llm_config): Trace workflow execution
  • send(): Convert and submit captured spans to your endpoint
  • export(): Export captured traces locally

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

bitpulse-0.1.0.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

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

bitpulse-0.1.0-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitpulse-0.1.0.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bitpulse-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a084edb405c5ff85f83b7ff97fb15b4b2a9cc6f298313faac02940fd3a166d62
MD5 7b04ed70df0b5ca2baef9a1d16993182
BLAKE2b-256 bf6ae8245f3828be893ae13fc19cbcf0e02501025c46c12fcf23499530a1951b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitpulse-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bitpulse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8664eaeab47a58b3b18b5be268fb33ddfc3ea069e082f3ec2e5650fac75eb386
MD5 bce56f977a5e0ca61278485dd7f5536b
BLAKE2b-256 8079b14e3fc54e4dff73c2ec04da89baf7b30b5f8dac051114115c1b573e2a6f

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