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. Free tier: 60M tokens/mo. Production: 20% of measured savings.

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 Dev tier: 60M tokens/month, no card. Production: 20% of measured savings, $0 if we save you nothing.

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="tsr_..."),   # 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="tsr_...")

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 tsr_… 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.0.tar.gz (6.4 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.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tessera_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tessera_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d6d311d1f8cf6dcf451cf3b6ac71ffed02817589a6998f1d244341e5984bb8b
MD5 1e61de1682a059e289a773d1dd4172a0
BLAKE2b-256 afe1bb8b127bfc7667e8f36ab4a8353f48f10f748ace2c8699b3b39b26965df5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tessera_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0ccc7d98e7429ae7a737b3d7e7883ffd769e1f53941432433b08cc28636a293
MD5 a40f178e27a625e30b284542bcbc062e
BLAKE2b-256 b24a5de8671fe1864b4ea2e72e365ba4d328962908948d0df38018e4f4da91b4

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