Skip to main content

Respan LiteLLM Exporter

LiteLLM integration for exporting logs and traces to Respan.

Installation

pip install respan-exporter-litellm

Quick Start

Callback Mode

Use the callback to send traces to Respan:

import litellm
from respan_exporter_litellm import RespanLiteLLMCallback

# Setup callback
callback = RespanLiteLLMCallback(api_key="your-respan-api-key")
callback.register_litellm_callbacks()

# Make LLM calls - traces are automatically sent
response = litellm.completion(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
)

Proxy Mode

Route requests through Respan gateway:

import litellm

response = litellm.completion(
    api_key="your-respan-api-key",
    api_base="https://api.respan.ai/api",
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
)

Logging

If you just want individual logs (no trace/span IDs), omit trace fields and send only basic metadata. This will produce one log per request.

Callback Mode (with respan_params)

import litellm
from respan_exporter_litellm import RespanLiteLLMCallback

callback = RespanLiteLLMCallback(api_key="your-api-key")
callback.register_litellm_callbacks()

response = litellm.completion(
    api_key="your-api-key",
    api_base="https://api.respan.ai/api",
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
    metadata={
        "respan_params": {
            "workflow_name": "simple_logging",
            "span_name": "single_log",
            "customer_identifier": "user-123",
        }
    },
)

Proxy Mode (with extra_body)

import litellm

response = litellm.completion(
    api_key="your-respan-api-key",
    api_base="https://api.respan.ai/api",
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
    extra_body={
        "span_workflow_name": "simple_logging",
        "span_name": "single_log",
        "customer_identifier": "user-123",
    },
)

License

MIT

Metadata

Release files for respan-exporter-litellm 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-exporter-litellm 1.0.1
File Size Uploaded Provenance
respan_exporter_litellm-1.0.1.tar.gz 4.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-exporter-litellm 1.0.1
File Interpreter ABI Platform
respan_exporter_litellm-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / respan_exporter_litellm-1.0.1.tar.gz

Download URL respan_exporter_litellm-1.0.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0ce3733bc962b0dd5b7d5c8c9a8409a82d73f06e1e2a69d02671fc72759c5c00
BLAKE2b-256 checksum
How to use checksums
e447f12ee9b82349022c5effd3e9bea8953ea1fb3243e1b98e234b81d02a1038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.8 Darwin/25.2.0

Release files / respan_exporter_litellm-1.0.1-py3-none-any.whl

Download URL respan_exporter_litellm-1.0.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa155485d9cbcecde6cc42fc60990da9984a3259bbc20f25198d58f4649caf03
BLAKE2b-256 checksum
How to use checksums
3b39db9e2cf10f127140b1067e77849771e022eb502bcb51eb52e4f4c8674b19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.8 Darwin/25.2.0

Security for respan-exporter-litellm 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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