Skip to main content

TraceLite

Lightweight LLM observability SDK with vector semantic caching using PostgreSQL (pgvector) and Redis.

Features

  • Async Telemetry: Logs token usage, cost, latency, and TTFT in background threads.
  • Two-Tier Caching: Exact hash caching (Redis) + Semantic vector caching (pgvector).
  • Fallback Token Counting: Uses tiktoken if native usage streaming metadata is omitted.

Installation

pip install tracelite
from tracelite.client import ObservedOpenAI

client = ObservedOpenAI(
    api_key="your-openai-api-key",
    db_url="postgresql://tracelite:secretpassword@localhost:5432/llm_observability"
)

response = client.chat_completion(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello world!"}]
)

print(response.choices[0].message.content)

---

### 3. Deploy Update (`v0.1.4`)

```bash
git add pyproject.toml README.md
git commit -m "fix pypi metadata and readme"
git push origin main

Release files for tracelite 0.1.7

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

Source distribution (sdist)

Source distribution for tracelite 0.1.7
File Size Uploaded
tracelite-0.1.7.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tracelite 0.1.7
File Interpreter ABI Platform
tracelite-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / tracelite-0.1.7.tar.gz

Download URL tracelite-0.1.7.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5a564f4f92466dce3c8d28308b277e6010c4e3e3d9af6e25ddf909b1e227a873
BLAKE2b-256 checksum
How to use checksums
7fecb360baf024714656904136fc1e01fc226b809d1b3e12922fc73219b026bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / tracelite-0.1.7-py3-none-any.whl

Download URL tracelite-0.1.7-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
def412f7124cb2774300ec20abae5080872f97e78d7e4b1c491ad631b3cc85ef
BLAKE2b-256 checksum
How to use checksums
9d554c496092e459262c1022f82d61dc7cf16cdfb9439fe35f21e381efca1f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.3

2 release files

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