Metadata-Version: 2.4
Name: composecache
Version: 0.1.0
Summary: Compositional semantic caching for LLM APIs and RAG pipelines
Author: Rojan Upreti
License: MIT
Requires-Python: >=3.10
Requires-Dist: numpy>=1.26.0
Requires-Dist: openai>=1.30.0
Requires-Dist: psycopg[binary]>=3.1.19
Provides-Extra: dev
Requires-Dist: mypy>=1.11.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.2.0; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Description-Content-Type: text/markdown

# ComposeCache Python Package

Python package for compositional semantic caching over LLM requests.

## Quick Start

```bash
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
```

```python
from composecache import ComposeCache

cache = ComposeCache(
    database_url="postgresql://dev:dev@localhost:5432/composecache",
    openai_api_key="YOUR_OPENAI_KEY",
)

response = cache.complete(
    {
        "model": "gpt-4o-mini",
        "messages": [{"role": "user", "content": "Compare GDP of France and Germany"}],
    }
)

print(response["content"])
print(response["cache_type"])
```
