Skip to main content

Drop-in Tessera integration for LangChain. One line of config routes your existing ChatOpenAI / ChatAnthropic / ChatMistralAI / ChatGroq / ChatCohere through Tessera's auto-route + auto-cache + auto-compress + auto-batch proxy.

Project description

tessera-langchain

PyPI version Python

Drop-in cost optimization for LangChain ChatModels. One line of config in your existing ChatOpenAI / ChatAnthropic / ChatMistralAI / ChatGroq / ChatCohere constructor routes your traffic through the Tessera proxy — auto-route, exact + provider-prompt-cache hits, per-role compression, output-length ceiling, batch arbitrage. Free Sandbox tier: 60M tokens/month, no card. Paid tiers: flat monthly subscription by token volume, keep 100% of savings.

Companion package to tessera-llm-proxy — same proxy, LangChain-shaped API.

Install

pip install tessera-langchain

Quickstart

from langchain_openai import ChatOpenAI
from tessera_langchain import tessera_openai_config

llm = ChatOpenAI(
    model="gpt-4o",
    openai_api_key="sk-...",                      # your OpenAI key, unchanged
    **tessera_openai_config(api_key="tk_..."),   # one line, routes through Tessera
)

# Existing LangChain code (agents, chains, tools, streaming) runs unchanged.
response = llm.invoke("Summarize a Kubernetes operator architecture in 3 bullets.")

Same pattern for the other providers — tessera_anthropic_config, tessera_mistral_config, tessera_groq_config, tessera_cohere_config.

Or wrap an existing instance:

from tessera_langchain import wrap_openai

llm = wrap_openai(my_existing_ChatOpenAI, tessera_api_key="tk_...")

Free key

Get a free API key (60M tokens/mo, no card) at tesseraai.io/dev — sign-up takes ~30 seconds and returns an instant tk_… key plus magic-link dashboard access.

Documentation

Full README with worked-numbers example ($24k → $9.4k OpenAI bill cut), mechanic table, FAQ, and architecture notes:

github.com/tessera-llm/tessera-langchain

Tessera platform:

tesseraai.io

License

Apache-2.0. The SDK is open source; the optimization proxy at api.tesseraai.io is closed. Wire format is open; mechanic implementations are not.

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

tessera_langchain-0.1.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

tessera_langchain-0.1.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file tessera_langchain-0.1.3.tar.gz.

File metadata

  • Download URL: tessera_langchain-0.1.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tessera_langchain-0.1.3.tar.gz
Algorithm Hash digest
SHA256 91cd06844eeaf7ec75c331793e10f6dc41d9cc6032cdb3e01ad6c657232841ba
MD5 d9d1d531fb145929ff0f014589541db1
BLAKE2b-256 0032375649828a2e27a202e4f1cf19fb0f7ea1b5022b590c68c45b6c2d4eb52d

See more details on using hashes here.

File details

Details for the file tessera_langchain-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for tessera_langchain-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d528903d95c16294aeba86050fda2afc7e5b6d89dd13c92c6d524291667c5ed7
MD5 5086895823b2fa6f8dc595a4bb32bf24
BLAKE2b-256 16e461054e8d7d2d1ec83a04ab7aa4760fa6748f535ed7eb47114538fb7cacab

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