Metadata-Version: 2.4
Name: justllm
Version: 0.4.0
Summary: Production LLM calls. Just the three lines. Reliability, native caching, and reversible context compression on by default.
Project-URL: Homepage, https://github.com/robbiebusinessacc/justllm
Project-URL: Repository, https://github.com/robbiebusinessacc/justllm
Project-URL: Issues, https://github.com/robbiebusinessacc/justllm/issues
Project-URL: Changelog, https://github.com/robbiebusinessacc/justllm/blob/main/CHANGELOG.md
Author: Robert Walmsley
License: MIT
License-File: LICENSE
Keywords: ai,anthropic,context-compression,fallback,llm,openai,orchestration,prompt-caching,routing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: fastembed>=0.3; extra == 'all'
Requires-Dist: headroom-ai>=0.25; extra == 'all'
Requires-Dist: instructor>=1.5; extra == 'all'
Requires-Dist: litellm>=1.70; extra == 'all'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'all'
Requires-Dist: tiktoken>=0.7; extra == 'all'
Provides-Extra: benchmarks
Requires-Dist: headroom-ai>=0.25; extra == 'benchmarks'
Requires-Dist: tiktoken>=0.7; extra == 'benchmarks'
Provides-Extra: compression
Requires-Dist: headroom-ai>=0.25; extra == 'compression'
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: embeddings
Requires-Dist: fastembed>=0.3; extra == 'embeddings'
Provides-Extra: langfuse
Requires-Dist: langfuse>=2; extra == 'langfuse'
Provides-Extra: litellm
Requires-Dist: litellm>=1.70; extra == 'litellm'
Provides-Extra: otel
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
Provides-Extra: structured
Requires-Dist: instructor>=1.5; extra == 'structured'
Requires-Dist: litellm>=1.70; extra == 'structured'
Description-Content-Type: text/markdown

# justllm

[![PyPI](https://img.shields.io/pypi/v/justllm)](https://pypi.org/project/justllm/)
[![CI](https://github.com/robbiebusinessacc/justllm/actions/workflows/ci.yml/badge.svg)](https://github.com/robbiebusinessacc/justllm/actions/workflows/ci.yml)
[![Python](https://img.shields.io/pypi/pyversions/justllm)](https://pypi.org/project/justllm/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)

**Production LLM calls. Just the three lines.**

```python
from justllm import LLM

llm = LLM("anthropic/claude-opus-4-8")
llm("Summarize this contract.")
```

That one call already does what you'd normally wire by hand — **on by default,
zero config:**

- **Context compression** — [Headroom](https://github.com/chopratejas/headroom) shrinks tool output 50–95% before it reaches the model
- **Prompt-cache optimization** — provider-optimal cache breakpoints (Anthropic / OpenAI / Google)
- **Reliability** — retry with backoff, then fail over across providers

```bash
pip install 'justllm[all]'
```

## More, when you want it

Same three-line surface — each of these is one call or one kwarg:

```python
llm.extract(Invoice, text)                    # structured output (validated Pydantic)
llm.stream("...")                             # token streaming
await llm.acall("...")                        # async
llm.agent(system="...").run("...")            # tool-calling loop
LLM(router=Cascade(small=cheap, large=big))   # cheap first, escalate when needed
```

Plus OpenTelemetry tracing with the per-call **cost** the spec omits (`[otel]`),
Langfuse-backed prompts, semantic cascade escalation, exact-match caching — all
opt-in. The point: every one of these is SOTA under the hood and a one-liner on top.

Runnable recipes for all of it: **[cookbook →](examples/)**

## Why

The ecosystem is split: powerful but heavy (LiteLLM, LangChain), or simple but
thin (aisuite, any-llm). justllm is the middle — every optimization on, behind a
three-line surface. The discipline *is* the product.

---

*Alpha. Wiring is tested on CI (Python 3.10–3.13); call paths are validated live.*

[Cookbook](examples/) · [Roadmap](ROADMAP.md) · [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [MIT](LICENSE)
