Skip to main content

tessera-llm-proxy

PyPI version Python

Drop-in cost optimization for LLM applications. One line of code patches your existing OpenAI / Anthropic / Mistral / DeepSeek / Groq / Together / Fireworks / OpenRouter / Perplexity / Cerebras / xAI client to route through Tessera's measurement + auto-optimize proxy. You keep your provider account and keys; we route + cache + compress and measure savings on every request.

Free Sandbox tier: 60M tokens / month · no card required · no fee until you upgrade. Get your free key at tesseraai.io/dev.

Get a free API key

→ Get free key (email + ToS, 30 seconds, no card)

After signup you get:

  • Your tk_ API key (shown once)
  • A magic-link for the dashboard — see your token counter + savings counter live
  • 60M tokens/month at 30 req/min — generous for hobby + side projects

Install

pip install tessera-llm-proxy

One-line setup

Drop this at the top of your application's entry point (main.py, app.py, manage.py, wherever your app boots):

import tessera
tessera.activate("tk_your_tessera_key")

That's it. Your existing code runs unchanged — openai.OpenAI(), anthropic.Anthropic(), mistralai.Mistral(), and other supported SDK constructors are transparently patched to route through Tessera. Your provider keys (OpenAI sk-..., Anthropic sk-ant-..., etc.) stay in your environment as before; Tessera forwards them upstream untouched.

Environment variable form

If you'd rather not put the key in code:

export TESSERA_KEY=tk_your_tessera_key
import tessera
tessera.activate()  # reads TESSERA_KEY from environment

What gets patched

Calling tessera.activate(...) patches the following SDKs at import time (each is opt-in: only patched if the library is installed):

SDK Tessera route
openai (≥1.0) https://api.tesseraai.io/v1/openai
anthropic https://api.tesseraai.io/v1/anthropic
mistralai https://api.tesseraai.io/v1/mistral
cohere https://api.tesseraai.io/v1/cohere (Wave 2)
groq https://api.tesseraai.io/v1/groq

If you use a framework that wraps these SDKs (LangChain, LlamaIndex, CrewAI, AutoGen, Mastra, Pydantic AI, etc.), the patch applies transparently because those frameworks call the underlying SDK constructors which are what we patched.

Direct provider URLs

If you call providers that aren't covered by an official Python SDK (DeepSeek, Together, Fireworks, OpenRouter, Perplexity, Cerebras, xAI), construct an openai.OpenAI client manually with the matching Tessera URL:

from openai import OpenAI

# DeepSeek via Tessera
client = OpenAI(
    api_key="sk-deepseek-...",
    base_url=tessera.url("deepseek"),  # → https://api.tesseraai.io/v1/deepseek
    default_headers=tessera.headers(),
)

# Same pattern for: together, fireworks, openrouter, perplexity, cerebras, groq, xai

tessera.url(provider) and tessera.headers() are pure helpers — no globals, no patching. Use them when you want explicit, traceable wiring.

Verification

import tessera
tessera.activate("tk_...")

assert tessera.is_active(), "Tessera should be active after activate()"
print(tessera.status())  # → ProxyStatus(active=True, providers_patched=['openai', 'anthropic'], proxy_base='https://api.tesseraai.io/v1')

Deactivation

To restore the original SDK constructors (e.g. in test teardown):

tessera.deactivate()

Configuration

tessera.activate(
    key="tk_...",                              # or TESSERA_KEY env var
    proxy_base="https://api.tesseraai.io/v1",  # default; override for staging/dev
    feature_tag="checkout-summarizer",         # attaches to every request for per-feature attribution
)

feature_tag lets you split savings reporting per workload (e.g. one tag per logical feature in your app). You can also set per-request tags by passing extra_body={"tessera_feature_tag": "..."} on individual SDK calls.

How the pricing works

  • Free Sandbox tier: 60M tokens/month, no card required, $0 fee.
  • Production tier: 20% of measured savings, debited daily from a prepaid balance you control ($100 minimum top-up via Stripe).
  • Zero savings = zero fee. If our optimization doesn't save you anything in a period, you pay nothing for that period.
  • Kill-switch available anytime from your portal — pauses optimization, traffic still flows passthrough.

Full terms: https://tesseraai.io/terms

License

Apache-2.0

Metadata

Release files for tessera-llm-proxy 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tessera-llm-proxy 0.1.3
File Size Uploaded Provenance
tessera_llm_proxy-0.1.3.tar.gz 8.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tessera-llm-proxy 0.1.3
File Interpreter ABI Platform
tessera_llm_proxy-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / tessera_llm_proxy-0.1.3.tar.gz

Download URL tessera_llm_proxy-0.1.3.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
015971281cac224149874b0579d9c6d7b0ae576c80b452737324bab77052db8a
BLAKE2b-256 checksum
How to use checksums
d47d17176b918fa4f737df5762eec9ea680e014f8cc54f98c81986fdd0b1c15a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tessera_llm_proxy-0.1.3-py3-none-any.whl

Download URL tessera_llm_proxy-0.1.3-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f444e1913f3736bc1ddda304f1d512b3ea55e9113da894f528d610fde72c1bdd
BLAKE2b-256 checksum
How to use checksums
d34a2aa80a67662b6ce23da516efc0dc06ca70de0c247627949130940f4c90c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for tessera-llm-proxy 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page