Skip to main content

Production LLM calls. Just the three lines. Reliability, native caching, and reversible context compression on by default.

Project description

justllm

PyPI CI Python License: MIT

Production LLM calls. Just the three lines.

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 compressionHeadroom 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
pip install 'justllm[all]'

More, when you want it

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

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 →

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 · Roadmap · Changelog · Contributing · MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

justllm-0.4.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

justllm-0.4.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file justllm-0.4.0.tar.gz.

File metadata

  • Download URL: justllm-0.4.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for justllm-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b7e15bbf12c9c7d1412f3b32cb5598263aa9a80b39b5630eb8b6d998ac06691e
MD5 cd6db35631f244516e99105b0c2e04e0
BLAKE2b-256 616982494bab098c1b0f9f8d0f5fdbd6685dd550b06efbb4bf804ffc8d6e7a64

See more details on using hashes here.

File details

Details for the file justllm-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: justllm-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for justllm-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9562319f6ac9a6ce8da2c021545a502a350c58dee728f385da5bddd8ef62c1f
MD5 cbd4ce69a480b33d6832be602b9c6375
BLAKE2b-256 dd099c0aedb8bfb7bc24b21352e6725ee2b566a7eef7aa4c2c1903b992889032

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page