{"id":50454410,"url":"https://github.com/tessera-llm/tessera-sdk","last_synced_at":"2026-06-01T01:32:22.945Z","repository":{"id":358710385,"uuid":"1241891357","full_name":"tessera-llm/tessera-sdk","owner":"tessera-llm","description":"Drop-in LLM cost-optimization proxy. Auto-route + cache + compress + batch. Flat monthly pricing by token volume, keep 100% of savings. Free 60M tokens/mo.","archived":false,"fork":false,"pushed_at":"2026-05-28T18:27:50.000Z","size":92,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T20:11:24.171Z","etag":null,"topics":["ai-cost","ai-proxy","anthropic","apache-2","claude","cohere","cost-optimization","gemini","gpt-4o","groq","llm","llm-cost","llm-proxy","mistral","openai","python","sdk","tessera","typescript"],"latest_commit_sha":null,"homepage":"https://tesseraai.io/dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tessera-llm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-18T00:00:10.000Z","updated_at":"2026-05-28T18:25:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tessera-llm/tessera-sdk","commit_stats":null,"previous_names":["tessera-llm/sdk","tessera-llm/tessera-sdk"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tessera-llm/tessera-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessera-llm%2Ftessera-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessera-llm%2Ftessera-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessera-llm%2Ftessera-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessera-llm%2Ftessera-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tessera-llm","download_url":"https://codeload.github.com/tessera-llm/tessera-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessera-llm%2Ftessera-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33756575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-cost","ai-proxy","anthropic","apache-2","claude","cohere","cost-optimization","gemini","gpt-4o","groq","llm","llm-cost","llm-proxy","mistral","openai","python","sdk","tessera","typescript"],"created_at":"2026-06-01T01:32:22.335Z","updated_at":"2026-06-01T01:32:22.936Z","avatar_url":"https://github.com/tessera-llm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tessera SDK — drop-in LLM cost-optimization proxy\n\nTessera is an LLM inference API gateway that sits in your request path. It auto-routes to cheaper-equivalent models, caches repeated prompts, compresses context, and batches eligible calls. Every request is measured for cost delta against the model you originally asked for. **Pricing is a flat monthly subscription priced by your gross monthly token volume. You keep 100% of the measured savings — savings is your ROI proof, not our billing basis.**\n\n[![PyPI](https://img.shields.io/pypi/v/tessera-llm-proxy.svg?label=PyPI)](https://pypi.org/project/tessera-llm-proxy/)\n[![PyPI downloads](https://img.shields.io/pypi/dm/tessera-llm-proxy.svg?label=pip%20installs)](https://pypi.org/project/tessera-llm-proxy/)\n[![Python](https://img.shields.io/pypi/pyversions/tessera-llm-proxy.svg)](https://pypi.org/project/tessera-llm-proxy/)\n[![npm](https://img.shields.io/npm/v/@tessera-llm/tessera-sdk.svg?label=npm)](https://www.npmjs.com/package/@tessera-llm/tessera-sdk)\n[![npm downloads](https://img.shields.io/npm/dm/@tessera-llm/tessera-sdk.svg?label=npm%20installs)](https://www.npmjs.com/package/@tessera-llm/tessera-sdk)\n[![Node](https://img.shields.io/node/v/@tessera-llm/tessera-sdk.svg)](https://www.npmjs.com/package/@tessera-llm/tessera-sdk)\n[![CI](https://github.com/tessera-llm/tessera-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/tessera-llm/tessera-sdk/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/tessera-llm/tessera-sdk?style=flat\u0026color=18181b\u0026labelColor=fafafa)](https://github.com/tessera-llm/tessera-sdk)\n\n**Free Sandbox tier: 60M tokens / month, no card required.** Get a key at [tesseraai.io/dev](https://tesseraai.io/dev).\n\n\u003cdetails\u003e\n\u003csummary\u003eTable of contents\u003c/summary\u003e\n\n- [Who this is for](#who-this-is-for)\n- [Install](#install)\n- [One-line integration](#one-line-integration)\n- [30-second curl test](#30-second-curl-test)\n- [Quality SLA — auto-rollback + 10% credit](#quality-sla--auto-rollback--10-credit)\n- [Worked example — what a flat subscription looks like](#worked-example--what-a-flat-subscription-looks-like)\n- [What Tessera does to each request](#what-tessera-does-to-each-request)\n- [How it works (60 seconds)](#how-it-works-60-seconds)\n- [Pricing](#pricing)\n- [Supported providers](#supported-providers)\n- [Compared to LLM observability tools](#compared-to-llm-observability-tools)\n- [Frameworks \u0026 examples](#frameworks--examples)\n- [Type safety](#type-safety)\n- [Tessera in one paragraph (for search engines)](#tessera-in-one-paragraph-for-search-engines)\n- [FAQ](#faq)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [License](#license)\n- [About Tessera](#about-tessera)\n\n\u003c/details\u003e\n\n---\n\n## Who this is for\n\n- **AI-native SaaS** spending $5k+/month on OpenAI / Anthropic / Gemini and wanting that bill cut without re-architecting.\n- **Vertical AI agents** (sales, support, voice, customer success) where margin compresses as call volume scales.\n- **Engineering teams** who want an honest cost-reduction layer, not another observability dashboard.\n- **Solo developers, side-project builders, and hobbyists** with personal Anthropic / OpenAI / Mistral API accounts — the 60M-tokens-per-month free tier covers most personal projects entirely. No card up front, no per-token fee, no future bill surprise.\n\n**Not for:**\n- **Consumer subscriptions** (Claude Pro, ChatGPT Plus, Gemini Advanced) — Tessera proxies API requests; subscriptions don't expose an API and aren't billed per token. Tessera cannot route subscription traffic.\n- **Air-gapped on-prem deployments** — we're a hosted proxy only.\n\n---\n\n## Install\n\n| Language | Install |\n|---|---|\n| Python | `pip install \"tessera-llm-proxy\u003e=0.1.0,\u003c0.2\"` |\n| Node / TypeScript | `npm install @tessera-llm/tessera-sdk@^0.1.0` |\n\nPre-1.0 semver: minor releases may include breaking changes. Pin a floor + ceiling in production.\n\n## One-line integration\n\n### Python\n\n```python\nimport tessera\ntessera.activate(\"tk_your_tessera_key\")\n\n# Existing code runs unchanged. Any openai.OpenAI(), anthropic.Anthropic(),\n# mistralai.Mistral(), groq.Groq(), cohere.Client() constructed AFTER this\n# call routes through Tessera transparently. Your provider keys stay in\n# the environment as usual.\n```\n\n### Node / TypeScript\n\n```ts\nimport { activate } from \"@tessera-llm/tessera-sdk\";\nactivate(\"tk_your_tessera_key\");\n\n// Same shape: new OpenAI(), new Anthropic(), new Mistral(), etc. — all\n// patched at load time. Bring-your-own provider keys.\n```\n\n---\n\n## 30-second curl test\n\nGet your key first at [tesseraai.io/dev](https://tesseraai.io/dev) — takes a minute, no card. Then:\n\n```bash\ncurl https://api.tesseraai.io/v1/openai/chat/completions \\\n  -H \"X-Tessera-Key: tk_\u003cyour-free-key\u003e\" \\\n  -H \"Authorization: Bearer sk-\u003cyour-openai-key\u003e\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"gpt-4o\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}'\n\n# Response shape = plain OpenAI. Behind the scenes: route + cache + compress + batch.\n# Savings counter ticks live at ledger.tesseraai.io/portal.\n```\n\n---\n\n## Quality SLA — auto-rollback + 10% credit\n\n**Quality is the primary contract; savings are the second-order effect. We address the quality story first because that's the only honest answer to \"what happens when the cheaper model is dumber?\"**\n\nA canary runs your workload at 10% sample rate against the baseline model, scored by a [promptfoo](https://promptfoo.dev) eval set you can define. If a workload's stack mean-score drops below 0.95 for 3 consecutive days with at least 30 samples per stack:\n\n1. The specific stack (e.g. `m1+m7`) auto-disables. `m1` alone and `m7` alone stay live — surgical rollback, not nuclear.\n2. A 10% credit on that month's subscription lands on your account automatically.\n3. An `audit_event` records the breach + credit + reactivation timeline in your `/portal/audit` ledger.\n\nYou can also flip the global kill-switch in `/portal/billing` at any time — traffic continues flowing as passthrough, just with no mutation. We treat quality regression as our problem, not yours: you get the SLA credit automatically, you don't have to file anything.\n\n---\n\n## Worked example — what a flat subscription looks like\n\n**TL;DR — a customer-support agent burning $24,000/month on `gpt-4o` cuts inference cost to $9,400/month, pays a flat $999 Growth-tier subscription, and keeps 100% of the savings — $13,601/month back. Quality canary held at 0.96 across all four mechanics (above the 0.95 floor documented in the section above).**\n\nA customer-support AI agent runs on `gpt-4o` with high prompt repetition (FAQ-style queries). 5B tokens / month at OpenAI list prices (70% input @ $2.50/M, 30% output @ $10/M) sits around **$24,000/month** at the start of the period. At ~5B gross monthly tokens this workload lands on the **Growth tier ($999/month flat)**.\n\nAfter enabling Tessera (no code change beyond one-line activate):\n\n| Stage | Cost / month | Savings |\n|---|---:|---:|\n| Baseline (OpenAI direct) | $24,000 | — |\n| + auto-cache (35% hit rate on FAQ prefix) | $15,600 | $8,400 |\n| + auto-route (`gpt-4o → gpt-4o-mini` where quality canary holds) | $11,520 | $4,080 |\n| + prompt cache (OpenAI cached-input rate, 50% off cached prefix) | $10,200 | $1,320 |\n| + context pruning (RAG trim) | $9,400 | $800 |\n| **Tessera-optimized inference total** | **$9,400** | **$14,600 / month** |\n| **Tessera subscription (Growth tier, flat)** | $999 | — |\n| **Customer total pay** | **$10,399** | **$13,601 saved / month** |\n\nYou keep 100% of the measured savings; the only line we add is the flat $999 subscription. Quality canary mean-score held at 0.96 across all stages (floor 0.95) — if it had dropped, the auto-route mechanic would have rolled back automatically and the customer received a 10% SLA credit that month. **Numbers vary by workload shape.** Run your own workload free for 60M tokens to measure your actual delta.\n\n**Verify the savings math yourself.** Every billable line is traceable back to two immutable cost figures pinned to a multi-source pricing catalog snapshot captured at request time. Two engineers, three hours, can re-derive any month from raw inputs. Full procedure at [tesseraai.io/trust](https://tesseraai.io/trust).\n\n---\n\n## What Tessera does to each request\n\nTen mechanics shipped (`m1`-`m3`, `m5`-`m11`), one more in design (`m12` PII / jailbreak / toxicity guardrails — see the [roadmap](https://tesseraai.io/how-it-works)). `m4` is intentionally skipped (no mechanic in that slot). Each mechanic is per-workload opt-in. Stage 3 mutex caps content-mutating mechanics at one per request to bound quality risk.\n\nAudit-log chips in `/portal/audit` use the short codes in `\u003csub\u003e` below — that's the bridge if you want to map a specific request back to which mechanic fired.\n\n| Mechanic | What it does | Effect |\n|---|---|---|\n| **Auto-route** \u003csub\u003e(m1)\u003c/sub\u003e | Swap requested model for a cheaper-equivalent in the same family (e.g. `gpt-4o → gpt-4o-mini`) when quality canary holds ≥ 0.95 | 30–60% cost cut on most routed calls; up to 95% on the largest tier drops |\n| **Auto-cache** \u003csub\u003e(m2)\u003c/sub\u003e | Exact-match KV cache for repeated prompts within TTL | Up to 100% on cache hits |\n| **Auto-compress** \u003csub\u003e(m3)\u003c/sub\u003e | Whitespace and structural normalization only — preserves code fences and JSON value ranges. We never paraphrase your text. Per-role opt-in (system prompts and / or user turns) | 5–15% prompt size reduction |\n| **Semantic cache** \u003csub\u003e(m5)\u003c/sub\u003e | Embedding-based similarity cache (cosine ≥ 0.95) for near-duplicate prompts | Up to 100% on semantic hits |\n| **Prompt cache** \u003csub\u003e(m6)\u003c/sub\u003e | Native provider prompt-cache headers — OpenAI cached-input rate (50% off), Anthropic prompt caching (90% off cache reads) | 50–90% on cached prefixes depending on provider |\n| **Context pruning** \u003csub\u003e(m7)\u003c/sub\u003e | Conversation + RAG-block aware prune when message count \u003e 12 or body \u003e 32 KB | 10–40% prompt token reduction |\n| **Structured output** \u003csub\u003e(m8)\u003c/sub\u003e | Inject `response_format=json_schema` (strict mode) or `json_object` (auto mode) when an `expected_schema` is set | 10–35% output cost cut on JSON workloads |\n| **Output ceiling** \u003csub\u003e(m9)\u003c/sub\u003e | Cap `max_tokens` from rolling p90 truncation rate per workload — eliminates wasted completion tokens on responses that always finish short | 5–15% on output-bound workloads |\n| **Auto-batch** \u003csub\u003e(m10)\u003c/sub\u003e | Route async-tolerant calls to provider Batch APIs (OpenAI Batch, Anthropic Message Batches — both 50% off) | 50% on batch-eligible traffic |\n| **Cross-provider failover** \u003csub\u003e(m11)\u003c/sub\u003e | Opt-in passive failover to OpenRouter when primary upstream returns 5xx / connection error / timeout. Same eval gate; gated on workload `compliance_tier` (regulated workloads skip) | Reliability, not cost — quality preservation estimate per pair |\n\n---\n\n## How it works (60 seconds)\n\n1. **Get a free API key** — email + ToS at [tesseraai.io/dev](https://tesseraai.io/dev). You receive a `tk_` key (shown once) plus a magic-link for dashboard access (we use passwordless email auth — no SSO yet, on the roadmap).\n2. **Install the SDK** — `pip install tessera-llm-proxy` or `npm install @tessera-llm/tessera-sdk`.\n3. **One line** — `tessera.activate(\"tk_…\")` (Python) or `activate(\"tk_…\")` (Node).\n4. **Watch the counter** — tokens used + savings number tick live on [ledger.tesseraai.io/portal](https://ledger.tesseraai.io/portal).\n\nProvider keys (your OpenAI `sk-…`, Anthropic `sk-ant-…`, etc.) stay in your environment. Tessera forwards them upstream untouched. We never store your prompts or completions — only token counts and cost deltas. See the [data privacy FAQ](#do-you-store-my-prompts-or-completions) below.\n\n---\n\n## Pricing\n\nFlat monthly subscription, priced by your **gross monthly tokens submitted** (before optimization). You keep **100% of the measured savings** — the subscription is the only line we bill.\n\n| Tier | Gross tokens / month | Price / month |\n|---|---|---:|\n| **Free Sandbox** | ≤ 60M | $0 |\n| **Starter** | ≤ 1B | $199 |\n| **Growth** | ≤ 5B | $999 |\n| **Scale** | ≤ 20B | $3,999 |\n| **Enterprise** | 20B+ | Custom |\n\n| | **Free Sandbox** | **Paid tiers** |\n|---|---|---|\n| Rate limit | 30 req / min | 60 req / min |\n| Monthly savings statement | — | Audit-grade PDF |\n| Anomaly response | Read-only alerts | Auto-throttle on cost spike, auto-halt on runaway |\n| Team seats | — | Up to 5 |\n\nThe kill-switch in `/portal/billing` pauses optimization any time; traffic still flows passthrough.\n\nUpgrade flow: start free, then pick a tier inside the dashboard once your token volume crosses the Sandbox ceiling — no separate signup. Full terms: [tesseraai.io/terms](https://tesseraai.io/terms).\n\n---\n\n## Supported providers\n\n**Patched at SDK level (zero-config — `activate()` wires these up automatically):** OpenAI, Anthropic, Mistral, Groq, Cohere.\n\n**Available via OpenAI-compatible base URL** (use `tessera.url(provider)` + `tessera.headers()` — see [`examples/direct-provider.py`](./examples/direct-provider.py)):\n\n| Provider | Tessera route |\n|---|---|\n| OpenAI | `https://api.tesseraai.io/v1/openai` |\n| Anthropic | `https://api.tesseraai.io/v1/anthropic` |\n| Google (Gemini AI Studio) | `https://api.tesseraai.io/v1/google` |\n| xAI | `https://api.tesseraai.io/v1/xai` |\n| Cohere | `https://api.tesseraai.io/v1/cohere` |\n| Mistral | `https://api.tesseraai.io/v1/mistral` |\n| DeepSeek | `https://api.tesseraai.io/v1/deepseek` |\n| Groq | `https://api.tesseraai.io/v1/groq` |\n| Together AI | `https://api.tesseraai.io/v1/together` |\n| Fireworks AI | `https://api.tesseraai.io/v1/fireworks` |\n| OpenRouter | `https://api.tesseraai.io/v1/openrouter` |\n| Perplexity | `https://api.tesseraai.io/v1/perplexity` |\n| Cerebras | `https://api.tesseraai.io/v1/cerebras` |\n\nAWS Bedrock, Azure OpenAI, Vertex AI — September 2026.\n\n---\n\n## Compared to LLM observability tools\n\n| | **Tessera** | LLM observability tools |\n|---|---|---|\n| Position | Substrate proxy in request path | Observability sidecar |\n| Optimization | Does it (route, cache, compress, batch in real time) | Surfaces charts, no real-time mutation |\n| Engineer effort | Two headers, that's it | Set up tracing + dashboards |\n| Billing model | Flat monthly subscription by token volume | Per-seat or per-event subscriptions |\n| Co-existence | Yes — observability tools still get your telemetry downstream | Complementary |\n\n---\n\n## Frameworks \u0026 examples\n\nThe [examples/](./examples/) directory has runnable snippets:\n\n- [`openai-wrap.py`](./examples/openai-wrap.py) — OpenAI client (Python)\n- [`openai-wrap.ts`](./examples/openai-wrap.ts) — OpenAI client (Node)\n- [`anthropic-wrap.py`](./examples/anthropic-wrap.py) — Anthropic client\n- [`langchain-wrap.py`](./examples/langchain-wrap.py) — LangChain via transparent SDK patching (works because `activate()` patches the underlying OpenAI / Anthropic / etc. clients that LangChain uses internally)\n- [`direct-provider.py`](./examples/direct-provider.py) — DeepSeek, Together, Fireworks, etc. via OpenAI-compatible URL\n\nCompatible with LangChain, LlamaIndex, CrewAI, AutoGen, Mastra, Pydantic AI, and Vercel AI SDK — they all call the underlying provider SDK constructors that `activate()` patches.\n\n---\n\n## Framework integrations — dedicated packages\n\nIf you're already building on a framework, the dedicated integration package is the cleaner ergonomic fit than the transparent SDK patch:\n\n| Framework | Package | Install |\n|---|---|---|\n| **LangChain** (Python + Node) | [`tessera-langchain`](https://github.com/tessera-llm/tessera-langchain) | `pip install tessera-langchain` · `npm install @tessera-llm/langchain` |\n| **Vercel AI SDK** (Node) | [`@tessera-llm/vercel-ai`](https://github.com/tessera-llm/tessera-vercel-ai) | `npm install @tessera-llm/vercel-ai` |\n| **LlamaIndex** (Python) | [`tessera-llamaindex`](https://github.com/tessera-llm/tessera-llamaindex) | `pip install tessera-llamaindex` |\n| **Mastra** (Node) | [`@tessera-llm/mastra`](https://www.npmjs.com/package/@tessera-llm/mastra) | `npm install @tessera-llm/mastra` |\n| **Pydantic AI** (Python) | [`tessera-pydantic-ai`](https://pypi.org/project/tessera-pydantic-ai/) | `pip install tessera-pydantic-ai` |\n| **CrewAI** (Python) | [`tessera-crewai`](https://pypi.org/project/tessera-crewai/) | `pip install tessera-crewai` |\n| **AutoGen 0.4+** (Python) | [`tessera-autogen`](https://pypi.org/project/tessera-autogen/) | `pip install tessera-autogen` |\n\nAll integrations use the same proxy at `api.tesseraai.io` and the same `tk_…` API key — install whichever matches your codebase. `tessera-sdk` (this package) and the framework-specific integrations are safe to use side by side.\n\n---\n\n## Type safety\n\n- **Node / TypeScript:** Ships full type declarations (`dist/index.d.ts`). Autocomplete and type-checking work out of the box.\n- **Python:** Ships the [PEP 561](https://peps.python.org/pep-0561/) `py.typed` marker — `mypy --strict` recognises the package as typed. All public functions are annotated; return types are explicit.\n\n---\n\n## Tessera in one paragraph (for search engines)\n\nTessera is an open-source LLM gateway and AI cost-optimization proxy for OpenAI, Anthropic, Google Gemini, Mistral, xAI, Cohere, DeepSeek, Groq, Together, Fireworks, OpenRouter, Perplexity, and Cerebras. It sits in your request path as a substrate proxy, auto-routes to cheaper-equivalent models, applies exact-match and semantic caching, compresses prompts, and batches eligible calls — all measured per request. Pricing is a flat monthly subscription priced by gross monthly token volume, with a free 60M-tokens-per-month Sandbox tier for development; customers keep 100% of the measured savings. Built for AI-native SaaS teams looking for OpenAI cost reduction without re-architecture.\n\n---\n\n## FAQ\n\n### Do you store my prompts or completions?\n\nNo. The proxy logs token counts, model identifiers, cost deltas, and `request_id` — never the prompt or response bodies. The exact-match cache stores hashed prompts (sha256) for lookup keys; the semantic cache stores prompt embeddings (one-way, not invertible to recover prompt text). [Full data handling](https://tesseraai.io/security).\n\n### How do you handle PII in prompts?\n\nWe don't inspect prompt content. The proxy forwards your request body upstream byte-for-byte to the provider you specified, then forwards their response back. Our measurement layer reads only the token counts, model identifiers, and cost deltas from headers and usage objects — never the prompt or response bodies. If your workload contains PII, your data path is identical to calling the provider directly, plus one TLS hop through Cloudflare edge.\n\n### What happens to my OpenAI / Anthropic rate limits?\n\nYour provider rate limits are unchanged. Tessera forwards your provider key upstream, so you stay on whatever tier your account holds. Our own rate limits (30 req/min on Free Sandbox, 60 req/min on paid tiers) apply on top — they exist to prevent abuse of the free tier and are lifted on request for paid customers with confirmed traffic spikes. Email [founder@tesseraai.io](mailto:founder@tesseraai.io).\n\n### What happens if Tessera is down?\n\nYour application sees an HTTP 5xx from our edge. We recommend wrapping the SDK with your existing retry / fallback logic — most LLM SDKs ship with built-in retry, keep it on. For mission-critical paths, set the proxy base URL per environment so you can flip back to the provider's direct URL with one config change. Target: 99.9% uptime.\n\n### Do you offer self-hosted or air-gapped deployment?\n\nNot today. The proxy runs on our hosted edge — that's how we measure savings against the canonical `pricing_catalog`. If you have a hard data-residency requirement and an annual contract size that justifies it, email [founder@tesseraai.io](mailto:founder@tesseraai.io) and we'll talk.\n\n### What's the latency overhead?\n\nTessera adds ~15–40 ms p50 on cache-miss paths (one extra TLS hop to Cloudflare edge). On cache hits, **latency drops** (no upstream call). Auto-batch trades latency for cost — opt-in per workload only.\n\n### How do you measure quality without seeing prompts?\n\nYou provide a [promptfoo](https://promptfoo.dev) golden set (5–50 prompts representative of your workload). The canary cron runs your workload's mechanic stack at 10% sample rate against the baseline model, scored by your eval set, daily. The aggregate `mean_score` per stack drives the quality SLA. You retain full control of the eval set — we just run it.\n\n### Where are you in your SOC 2 journey?\n\nTargeting SOC 2 Type 1 by Q3 2026. Current security posture: zero prompt or response storage at-rest, customer `Authorization` keys at-rest-encrypted via Supabase Vault (XChaCha20-Poly1305-IETF under the hood), RLS isolation per tenant, audit trail with cryptographic provenance via `pricing_catalog` snapshot ids. [Security page](https://tesseraai.io/security).\n\n### Why open-source the SDK if the proxy is closed?\n\nThe SDK is the integration surface — the part you ship in your binary. Apache-2.0 lets you fork, audit, vendor in, and prove to your security review that nothing exotic happens client-side. The proxy at `api.tesseraai.io` is closed because the mechanic implementations are the asymmetric IP. The wire format is open — any HTTPS client speaking OpenAI / Anthropic / Google shapes can use Tessera without our SDK.\n\n### How is the savings number computed — couldn't you inflate it?\n\nEach request emits two cost figures: `original_cost_usd` (priced at the **requested** model's catalog rate) and `actual_cost_usd` (priced at the **actual** model after routing + cache hits + provider discounts). Both rates are pinned to a [`pricing_catalog`](https://tesseraai.io/how-it-works) snapshot version id captured at the request — immutable, with multi-source verification (LiteLLM + tokencost + OpenRouter API — all three must agree within 1%, confidence-scored). Mid-contract price changes don't retroactively alter past savings. The audit ledger is yours to export.\n\n### Can I see which mechanics fired on a specific request?\n\nYes. `/portal/audit` shows a chip strip per request (`m1`, `m2`, `m3`, etc. — the same short codes used in the mechanic table above). Each `request_id` is searchable by `feature_tag` / `customer_tag` headers you can set per call. Full mechanic reference at [tesseraai.io/how-it-works](https://tesseraai.io/how-it-works).\n\n### How do I opt out of a specific mechanic?\n\nPer workload, in `/portal/settings`: toggle any mechanic on / off. Or set the request-level header `x-tessera-do-not-optimize: true` for one-off passthrough. The kill-switch in `/portal/billing` pauses everything across all workloads.\n\n---\n\n## Documentation\n\n- **Python SDK:** [./python/README.md](./python/README.md)\n- **Node SDK:** [./node/README.md](./node/README.md)\n- **Architecture and mechanic reference:** [tesseraai.io/how-it-works](https://tesseraai.io/how-it-works)\n- **Security + Quality SLA:** [tesseraai.io/security](https://tesseraai.io/security)\n- **Engineering blog:** [tesseraai.io/blog](https://tesseraai.io/blog)\n- **Discussions:** [github.com/tessera-llm/tessera-sdk/discussions](https://github.com/tessera-llm/tessera-sdk/discussions)\n\n---\n\n## Contributing\n\nPRs welcome for new examples, framework adapters, type-stub improvements, and bug fixes. See [CONTRIBUTING.md](./CONTRIBUTING.md) and the [Code of Conduct](./CODE_OF_CONDUCT.md).\n\n- **Bug reports:** [github.com/tessera-llm/tessera-sdk/issues](https://github.com/tessera-llm/tessera-sdk/issues)\n- **Security:** [security@tesseraai.io](mailto:security@tesseraai.io) — see [SECURITY.md](./SECURITY.md)\n\n---\n\n## License\n\nApache-2.0. See [LICENSE](./LICENSE).\n\n---\n\n## About Tessera\n\nTessera is the **substrate layer** for **LLM cost optimization**, also called the **Optimize Layer** in our product surface. A thin proxy that sits in your application's **request-path**, applies a conservative cascade of optimization mechanics, and measures every saved dollar against an **audit-immutable** baseline. We bill a **flat monthly subscription** priced by gross monthly token volume; customers keep **100% of verified savings**. No per-token gateway fee; the category we operate in is \"**LLM cost-optimization proxy**,\" distinct from per-token **AI gateways** and observability dashboards.\n\nWhere observability tools tell you what you spent and AI gateways re-shape the request without measuring the cost delta, Tessera is the layer that does both, and proves the savings back to you down to the dollar. The **verified-savings ledger** at [`ledger.tesseraai.io`](https://ledger.tesseraai.io) shows every original-vs-actual cost pair, snapshot-pinned to a `pricing_catalog` version captured at request time. Mid-contract price changes don't retroactively alter past savings. This is the **FinOps**-friendly model for AI inference: every line of the bill traces to a code-enforced rule.\n\nOperated by Fintechagency OÜ (Estonia, registry code 16638667).\n\n- Developer entry: [tesseraai.io/dev](https://tesseraai.io/dev)\n- Mechanic reference: [tesseraai.io/how-it-works](https://tesseraai.io/how-it-works)\n- Dashboard: [ledger.tesseraai.io](https://ledger.tesseraai.io)\n- Security posture: [tesseraai.io/security](https://tesseraai.io/security)\n- Engineering blog: [tesseraai.io/blog](https://tesseraai.io/blog)\n- Landing: [tesseraai.io](https://tesseraai.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftessera-llm%2Ftessera-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftessera-llm%2Ftessera-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftessera-llm%2Ftessera-sdk/lists"}