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.3.tar.gz (44.3 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.3-py3-none-any.whl (50.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitpulse-0.1.3.tar.gz
  • Upload date:
  • Size: 44.3 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.3.tar.gz
Algorithm Hash digest
SHA256 d56a9e4155ffc61d7079e92d4bee333ef684617c728d66dd30c114d93c6ffe9b
MD5 1f76ea62ed0246cfe9e03943e9fd3040
BLAKE2b-256 d9624dca6be7db734ae3c04946f21e990984cf3c53d2b08631d75e505fcbb943

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitpulse-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 50.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a63ae97ba05f30378e2de8026b24dba5fd8b70d1b0fc3f1172c3721744e7b0bf
MD5 d67e678b37b38183f6967a62b65a1eb9
BLAKE2b-256 d379c2c4315a0c6022e418b64024a88faad1a366ab4113476115df9feb67338e

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