Metadata-Version: 2.5
Name: tracelite
Version: 0.1.3
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: Your Name <developer@example.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.

## Quick Start
```bash
docker-compose up -d
pip install -e .

---

#### `.github/workflows/publish.yml`
```yaml
name: Publish TraceLite to PyPI

on:
  release:
    types: [published]

jobs:
  pypi-publish:
    name: Build and publish TraceLite
    runs-on: ubuntu-latest
    environment:
      name: pypi
      url: https://pypi.org/p/tracelite
    permissions:
      id-token: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Install build dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install build

      - name: Build source distribution and wheel
        run: python -m build

      - name: Publish package distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
