Metadata-Version: 2.4
Name: latencyzero
Version: 0.1.1
Summary: Cut API latency by 50-90% with Adaptive Anticipatory Approximation
Home-page: https://github.com/latencyzero/latencyzero
Author: LatencyZero Team
Author-email: hello@latencyzero.ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
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
Requires-Python: >=3.8
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: requires-dist
Dynamic: requires-python
Dynamic: summary

# LatencyZero (A³) — Adaptive Anticipatory Approximation

**LatencyZero reduces API, database, and ML inference latency by 50–90% using safe, confidence-based approximation.**

LatencyZero is a lightweight Python SDK that acts as a smart middleware in front of expensive functions. It learns from previous executions and returns near-instant responses when it is confident the result is correct — otherwise it safely falls back to the exact computation.

---

## ✨ Key Features

- ⚡ **50–90% latency reduction** for repeated or similar requests
- 🎯 **Correctness guaranteed** via confidence-based fallback
- 🔧 **Drop-in decorator** — no refactoring required
- 🔄 **Progressive refinement** in the background
- 📊 **Built-in metrics & observability**
- 🧠 Designed for APIs, databases, and ML inference

---

## 📦 Installation

```bash
pip install latencyzero

🚀 Quick Start
from latencyzero import a3

@a3(tolerance=0.02)
def expensive_function(x):
    return model.run(x)

# First call: exact computation
expensive_function("query")

# Subsequent calls: ~10ms approximate response ⚡
expensive_function("query")


LatencyZero automatically decides when approximation is safe and falls back to exact execution if confidence is low.

⚙️ Configuration
from latencyzero import configure

configure(
    gateway_url="http://localhost:8080",
    timeout=0.1,
    enable_metrics=True
)
