Summary
✨ A minimal, async‑first client with wire‑speed streaming, consistent ergonomics across providers, and built‑in observability. One API, multiple providers, zero boilerplate.
Highlights
- ⚡ Async‑first with clean sync mirrors
- 🔀 Multi‑provider: OpenAI, Anthropic, Gemini — auto‑routes by model name
- 🌊 Wire‑speed streaming with simple, ordered events
- đź§° Normalized tool/function calling across providers
- 🛡️ Reliability built‑in: retries with jitter, granular timeouts, typed errors
- đź’¸ Cost controls: token/cost ceilings with clear failure modes
- 🧠Caching: deterministic keys with in‑memory LRU+TTL
- 🧵 Batch helpers: concurrency caps, fail‑fast/return‑exceptions, summaries
- đź” Observability: structured logs + metrics (latency/TTFB/retries/tokens/cache)
- đź§© Optional extras: OpenTelemetry, StatsD, structlog
Install
- Base:
pip install llm-fiber - Extras:
pip install "llm-fiber[otel]","[statsd]","[structlog]", or"[all]" - Python: 3.8–3.12
Docs
- 📚 Full docs & feature guides: https://github.com/aimlesx/llm-fiber/blob/main/docs/index.md
- 🚦 Quickstart in README: https://github.com/aimlesx/llm-fiber
Notes
- ✅ First stable release; public APIs targeted for long‑term stability
- đź”’ Use only the env vars you need:
OPENAI_API_KEY,ANTHROPIC_API_KEY,GEMINI_API_KEY - đź’ˇ Quick taste:
Fiber.from_env().sync.ask("Hello!", model="gpt-4o-mini")