Metadata-Version: 2.4
Name: tessera-autogen
Version: 0.1.0
Summary: Drop-in Tessera integration for AutoGen (autogen_core / autogen_agentchat / autogen_ext). One line of config routes your AutoGen agents' LLM calls through Tessera's auto-route + auto-cache + auto-compress + auto-batch proxy. Free 60M tokens/mo. Production: 20% of measured savings.
Project-URL: Homepage, https://tesseraai.io
Project-URL: Documentation, https://tesseraai.io/docs
Project-URL: Repository, https://github.com/tessera-llm/tessera-autogen
Project-URL: Issues, https://github.com/tessera-llm/tessera-autogen/issues
Project-URL: Changelog, https://github.com/tessera-llm/tessera-autogen/blob/main/CHANGELOG.md
Author-email: "Tessera (Fintechagency OÜ)" <contact@tesseraai.io>
License: Apache-2.0
License-File: LICENSE
Keywords: agent-framework,ai-cost,anthropic,autogen,autogen-agentchat,autogen-core,claude,cost-optimization,gpt-4o,llm,llm-cost,llm-proxy,multi-agent,openai,tessera
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: autogen
Requires-Dist: autogen-core>=0.4.0; extra == 'autogen'
Requires-Dist: autogen-ext[anthropic,openai]>=0.4.0; extra == 'autogen'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.21; extra == 'test'
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

# tessera-autogen

[![PyPI](https://img.shields.io/pypi/v/tessera-autogen.svg)](https://pypi.org/project/tessera-autogen/)
[![Python](https://img.shields.io/pypi/pyversions/tessera-autogen.svg)](https://pypi.org/project/tessera-autogen/)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)

Drop-in [Tessera](https://tesseraai.io) integration for [AutoGen](https://github.com/microsoft/autogen) 0.4+ (`autogen_core` / `autogen_agentchat` / `autogen_ext`). One line of config routes every LLM call your AutoGen agents make through Tessera's auto-route + auto-cache + auto-compress + auto-batch proxy.

**Free 60M tokens/month. Production: 20% of measured savings.** No card up front.

## Install

```bash
pip install tessera-autogen
```

Requires Python 3.10+. `autogen-core` + `autogen-ext` are peer dependencies — install them alongside this package.

## Usage

The most common pattern uses a bundled factory to construct a pre-wired AutoGen `ChatCompletionClient`:

```python
from autogen_agentchat.agents import AssistantAgent
from tessera_autogen import tessera_openai_client

client = tessera_openai_client(
    model="gpt-4o",
    openai_api_key="sk-...",   # your OpenAI key
    tessera_api_key="tsr_...",  # get a free one at tesseraai.io/dev
)

agent = AssistantAgent(name="researcher", model_client=client)

# Rest of your AutoGen code runs unchanged — single-agent calls,
# SelectorGroupChat, Swarm, tool use all route through Tessera and
# benefit from auto-optimization.
```

For Anthropic models:

```python
from tessera_autogen import tessera_anthropic_client

client = tessera_anthropic_client(
    model="claude-sonnet-4-6",
    anthropic_api_key="sk-ant-...",
    tessera_api_key="tsr_...",
)
```

For explicit `ChatCompletionClient` construction (rare — useful when you need fine-grained client kwargs):

```python
from autogen_ext.models.openai import OpenAIChatCompletionClient
from tessera_autogen import tessera_openai_config

client = OpenAIChatCompletionClient(
    model="gpt-4o",
    api_key="sk-...",
    **tessera_openai_config(api_key="tsr_..."),
)
```

## What Tessera does for your AutoGen workloads

- **Auto-route** — calls to expensive models are evaluated for a cheaper alternative that preserves quality on canary samples.
- **Auto-cache** — exact-match + semantic cache for repeat queries. Multi-agent loops often re-issue identical sub-prompts; cache returns are free.
- **Auto-compress** — system prompts + tool descriptions compressed losslessly before they hit the upstream provider.
- **Auto-batch** — async teams with batch-tolerant SLAs get arbitraged onto provider batch APIs for ~50% cost reduction.

All gated by per-workload quality canaries; toggle any mechanic on/off from the [Tessera dashboard](https://ledger.tesseraai.io). Free Sandbox tier gives you observe-only mechanics; Production tier unlocks the full stack.

## Supported providers (v0.1)

| Provider | Status | Config function |
| --- | --- | --- |
| OpenAI | ✅ verified | `tessera_openai_config`, `tessera_openai_client` |
| Anthropic | ✅ verified | `tessera_anthropic_config`, `tessera_anthropic_client` |
| Mistral / Gemini | 🚧 queued for v0.2 | — |

v0.1 covers ~85% of customer traffic per our outreach research. Open an issue if you need a provider on the queue surfaced sooner.

## Companion packages

<!-- COMPANION-PACKAGES-START -->
Companion to [`tessera-sdk`](https://github.com/tessera-llm/tessera-sdk) (vanilla provider SDKs), [`tessera-langchain`](https://github.com/tessera-llm/tessera-langchain) (LangChain integration), [`tessera-vercel-ai`](https://github.com/tessera-llm/tessera-vercel-ai) (Vercel AI SDK integration), [`tessera-llamaindex`](https://github.com/tessera-llm/tessera-llamaindex) (LlamaIndex integration), [`tessera-mastra`](https://github.com/tessera-llm/tessera-mastra) (Mastra Agent framework integration), [`tessera-pydantic-ai`](https://github.com/tessera-llm/tessera-pydantic-ai) (Pydantic AI integration), and [`tessera-crewai`](https://github.com/tessera-llm/tessera-crewai) (CrewAI multi-agent integration). Same proxy, same mechanic stack, AutoGen-shaped API.
<!-- COMPANION-PACKAGES-END -->

## License

Apache 2.0 — see [LICENSE](LICENSE).
