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.1.tar.gz (48.2 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.1-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitpulse-0.1.1.tar.gz
  • Upload date:
  • Size: 48.2 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.1.tar.gz
Algorithm Hash digest
SHA256 2a4d148070772b3bd18aaee4e9fd74acaf9205f6640f2b5f7bdd1678e2566f68
MD5 298cf46b27975ff25a454ab1dba9892f
BLAKE2b-256 8450c3ba2667b4a46c2c8f81e70d22529bab279c3024c9150aa3cafd67da3f87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitpulse-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 55.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ddf68050500e9e13e5260abe9d9fc940eeab9c4c129e20fc2b4df897f866a3a
MD5 505665607ee5c9e8856ca1600a234be2
BLAKE2b-256 140ef5ddb6748f39cca211d576ba18d2e17b9bdd2152cb3a55146211eafc31d9

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