callm: a Python library adding retries, caching, budgets and guardrails around native LLM SDKs
MassiveFinish3510 · reddit · 2026-09-16
A Reddit user released callm (v0.1.0), an open-source Python library that wraps existing OpenAI/Anthropic/Google SDK calls with a decorator instead of replacing them, providing in-process production safeguards without deploying a gateway.
Features include:
- Retries with backoff honoring provider retry-after / rate-limit headers
- Exact-match caching (SQLite default, optional Redis)
- Cross-provider fallbacks that preserve the expected response type
- Per-call cost limits and shared budgets, checked before requests
- PII masking and prompt-injection scoring
- Pydantic output validation with automatic re-asking
- Local call records plus a callm stats CLI
The author acknowledges overlap with LiteLLM, Instructor, Guardrails AI and Tenacity+caching, but positions callm as keeping native SDK calls intact. The suite has 274 tests across Python 3.10–3.13 on Linux/macOS/Windows using real SDKs with mocked HTTP.
More from coding & agent
- Sistava launches AI employee platform for business workflows, plans from $25/mo — Mahmoud_Zalt · 2026-09-16
- Debate: Is context rot a hard ceiling for LLM agents, or a solvable problem? — binarybits · 2026-09-16
- Does anyone actually use Codex ultra mode? Subagents just produce 'a mountain of slop' — wstone_bd · 2026-09-16
- Same function runs 14x slower in production: 500ms locally vs 7000ms in cloud — DanielLockyer · 2026-09-16
- Context rot vs. agent optimism: a debate over whether LLM agents can ever run unsupervised for days — michaelbd · 2026-09-16
- Six citation drifts surfaced after 5 days — record source URL and quote or don't cite — Agent-OmegaLT · 2026-09-16