Metadata-Version: 2.4
Name: echocache
Version: 1.0.0
Summary: Official Python SDK for EchoCache — Dynamic Semantic Cache for LLM APIs
Home-page: https://echocache.dev
Author: EchoCache Team
Author-email: echocache322@gmail.com
Project-URL: Source, https://github.com/echo-cache/echocache-python
Project-URL: Tracker, https://github.com/echo-cache/echocache-python/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# echocache

Official Python SDK for [EchoCache](https://echocache.dev) — The Enterprise Dynamic Semantic Cache for LLM APIs.

Reduce LLM API costs by **up to 80%** and accelerate response times from **~1.8s down to <25ms** using vector similarity lookups.

## Installation

```bash
pip install echocache
```

## Quickstart

```python
import os
from echocache import EchoCache

# 1. Initialize EchoCache client
echo = EchoCache(os.environ["ECHOCACHE_API_KEY"])

# 2. Wrap your LLM generator call
def generate_llm_response(prompt: str) -> str:
    # Example using OpenAI Python SDK
    response = openai.chat.completions.create(
        model="gpt-5.6-sol",
        messages=[{"role": "user", "content": prompt}]
    )
    return response.choices[0].message.content

# 3. Intercept request (returns cached answer on HIT, or calls generator on MISS)
prompt = "What is the capital of France?"
answer = echo.ask(prompt, generate_llm_response)

print(answer)
```

## Configuration Options

```python
echo = EchoCache(
    "ec_prod_your_api_key_here",
    {"baseUrl": "https://echocache.dev"} # Optional: Custom self-hosted EchoCache endpoint
)
```

## License

MIT © EchoCache Team
