Open source · Apache 2.0 · Python SDK
The control plane for AI inference
Drop-in replacement for the OpenAI, Anthropic, Google Gemini and Mistral Python SDKs. Cache, route, observe and fall back across providers, by changing one import.
Get started in 30 seconds
pip install "caelum-ai[openai]"from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)from caelum import OpenAI # <- the only change
client = OpenAI(cache=True, retry=True)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)
client.metrics.print_summary() # requests, cache hits, costYour code, your types and your API keys stay the same. Caching and retries are opt-in. CAELUM never resells tokens: you keep your own provider accounts.
Why CAELUM
Exact & semantic cache
Identical requests are answered locally from SQLite. An opt-in semantic cache reuses answers to rephrased questions, after a small model confirms both ask the same thing.
Routing by config
Send requests to different models from a dict, JSON or YAML file. OpenAI ⇄ Anthropic request translation built in.
Built-in observability
client.metrics tracks calls, tokens, cache hits, latency and estimated cost. Export to JSON.
Multi-provider fallback
When a provider fails, retry with backoff, then fall back to the model you chose on another provider, or to a free local model (Ollama, llama.cpp, vLLM, LM Studio).
- 30%
- of calls saved on a benchmark with 30% repeated requests
- < 1 ms
- p95 overhead measured for the exact cache (target: under 5 ms)
- 0 / 50
- look-alike questions answered wrongly by the semantic cache, with 37 of 50 rephrasings reused (real API test)
- 4
- SDKs wrapped: OpenAI, Anthropic, Google Gemini, Mistral, plus local models
Figures come from our own benchmarks (see the repository). Your savings depend on how often your prompts repeat.
CAELUM Cloud is coming
A hosted dashboard for your inference costs and cache. Join the waitlist to hear first.
Waitlist opens soon.