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)

---

### 2. Bump version in `pyproject.toml`

Change the version string to **`0.1.8`**:

```toml
version = "0.1.8"

Release files for tracelite 0.1.8

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.8
File Size Uploaded
tracelite-0.1.8.tar.gz 6.9 kB Details

Built distribution (wheel)

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

Total release size: 14.7 kB

Release files / tracelite-0.1.8.tar.gz

Download URL tracelite-0.1.8.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d49fea1ea8ac063cffeb29fc4d613dd5df4482b3fffdb94d7b7656297f2ea47c
BLAKE2b-256 checksum
How to use checksums
77501f3ed2eb283308097d6df1f205c563a7e2cf6cb914226bd6161178d02ea0
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.8-py3-none-any.whl

Download URL tracelite-0.1.8-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
102519e8cbc30bd2c0f6ba6c469ca749d66d11a4221369df2cb9a6f513e2f920
BLAKE2b-256 checksum
How to use checksums
ce0ff2f8eff3a55d71cf7da8ed4d492e8e176f67dba6571e2f17e955f809610f
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

This release

0.1.8 This release

2 release files

0.1.7

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