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 Sandbox 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="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.1.tar.gz (7.7 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.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tessera_langchain-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dacc554fe535a0220a8881c23c1fb58b25920422b2204a2689037ef7efe00169
MD5 6ae17f3ddeaaceee3a68e4ec9286d347
BLAKE2b-256 0f8b60b30bb50c12ea0be1170efbeca4dcafb1fc4226f81ad745913ae0047ebb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tessera_langchain-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 328ad7c8c915f2960672fed927d2eccf68ff308e285e7beca4f767bcc1ee9039
MD5 42ba8a2b40b07f244867112a8f4b092f
BLAKE2b-256 b745197851f048ae299ed3e8808aee6ccf91b2445aa30619fb0c2c3cf14a0d42

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