Metadata-Version: 2.5
Name: tracelite
Version: v0.1.8
Summary: Lightweight LLM observability SDK with vector semantic caching using pgvector & Redis.
Project-URL: Homepage, https://github.com/yourusername/tracelite
Project-URL: Repository, https://github.com/yourusername/tracelite
Author-email: Nikhil Pandey <nikhilpandey759@gmail.com>
License-Expression: MIT
Keywords: llm,observability,openai,pgvector,semantic-cache,vector-database
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Requires-Dist: openai>=1.0.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: redis>=5.0.0
Requires-Dist: tiktoken>=0.5.0
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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

```bash
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"
