pareta
Python client for Pareta. One model id — "auto" — and
Pareta plans each request, routes it to benchmark-proven open specialists,
verifies the result, and falls back to a frontier model when that's the right
call. One request, one bill; you never pay for Pareta's orchestration or
cold starts.
pip install pareta # or: uv add pareta / poetry add pareta
from pareta import Pareta
pa = Pareta.from_env() # reads PARETA_API_KEY
# or: Pareta(api_key="pareta_sk_…", base_url="https://api.pareta.ai")
resp = pa.chat.completions.create(
model="auto", # the routing brain — the product
messages=[{"role": "user", "content": "Extract the total from this invoice: …"}],
)
print(resp.choices[0].message.content)
# Streaming (progress while Pareta plans + executes, then tokens)
for chunk in pa.chat.completions.create(model="auto", messages=[...], stream=True):
print(chunk.choices[0].delta.content or "", end="")
Async mirrors the sync client:
from pareta import AsyncPareta
async with AsyncPareta.from_env() as pa:
resp = await pa.chat.completions.create(model="auto", messages=[...])
Is it actually good? Measure it on YOUR data
Don't take the routing brain on faith — benchmark it. pa.evals runs "auto"
head-to-head against frontier models on your own ground truth and prices every
contender honestly:
run = pa.evals.runs.create(eval_set=es.id, models=["auto"],
frontier=["claude-opus-4-7"], wait=True)
And watch what your live traffic is doing — spend, success rate, and the projected savings vs calling a frontier directly:
pa.auto.metrics() # requests, success rate, spend, savings vs frontier
pa.auto.compare_frontier( # one prompt, metered, side-by-side with auto
model="gpt-5.5",
messages=[{"role": "user", "content": "…"}],
)
Inference is OpenAI-compatible
You don't even need this SDK to call Pareta — point the openai client at
base_url + your key and set model="auto":
from openai import OpenAI
client = OpenAI(api_key="pareta_sk_…", base_url="https://api.pareta.ai/v1")
resp = client.chat.completions.create(model="auto", messages=[...])
This SDK's unique value is everything AROUND that call — evals on your data, auto metrics, the benchmark catalog, and the dedicated-endpoint control plane — as Python methods, a CLI, and an MCP server.
Dedicated endpoints (when you want to pin one model)
"auto" routes per request. When a workload wants one specific open model on
dedicated capacity, deploy it and call it by endpoint id:
ep = pa.endpoints.deploy(task="invoice-extraction", model="recommended", wait=True)
resp = pa.chat.completions.create(model=ep.id, messages=[...])
for m in pa.models.list(): # everything your org can call
print(m.id)
Discovery (pa.tasks.match, pa.tasks.leaderboard) tells you which open
models are benchmark-proven for your task and what the frontier baseline costs.
Auth
Mint a pareta_sk_ key in the dashboard (key management is browser-only) and
pass it as api_key= or via PARETA_API_KEY. The SDK only ever consumes a
key; it never creates, lists, or revokes them.
CLI
pip install "pareta[cli]" adds the pareta command (or pipx install "pareta[cli]" for an isolated, always-on-PATH install):
export PARETA_API_KEY=pareta_sk_…
pareta chat "Summarize this contract: …" # model:"auto" by default
pareta auto metrics # your auto traffic, rolled up
pareta auto compare "…prompt…" --frontier gpt-5.5 # auto vs a frontier, metered
pareta tasks match "extract fields from invoices" # intent → task
pareta tasks leaderboard invoice-extraction # ranked open models + savings
pareta endpoints deploy --task invoice-extraction --wait
pareta chat -m ep_… "…" # pin a dedicated endpoint
Add --json to any command for machine-readable output; pareta --help (or
pareta <group> --help) documents the full tree — chat, auto, tasks,
models, endpoints, evals, audio.
MCP server
pareta-mcp is a Model Context Protocol
server (stdio) that exposes Pareta to an AI agent (Claude Desktop, Cursor, …) as
tools — chat (defaults to model="auto"), auto_metrics, compare_frontier,
plus discovery (match_task, get_leaderboard, …), provisioning
(deploy_endpoint, start / stop / delete), and run_eval.
Run it in its own isolated environment — like any MCP server it has its own
dependency tree, so don't pip install it into an app/project venv. The simplest
is uvx (no install, runs on demand). Register it
(Claude Desktop → Settings → Developer → Edit Config):
{
"mcpServers": {
"pareta": {
"command": "uvx",
"args": ["--from", "pareta[mcp]", "pareta-mcp"],
"env": { "PARETA_API_KEY": "pareta_sk_…" }
}
}
}
Prefer a persistent install? pipx install "pareta[mcp]" puts pareta-mcp on
your PATH in a dedicated venv — then use "command": "pareta-mcp". (Avoid a plain
pip install "pareta[mcp]" into a shared environment: its mcp/starlette
dependencies can clash with an app's FastAPI, and the console script may not land
on your PATH.) Provisioning and inference tools spend money; your MCP client's
per-tool-call approval is the guardrail.
Errors
All errors subclass pareta.ParetaError:
| Exception | When |
|---|---|
AuthenticationError (401) |
bad/missing key |
InsufficientCreditsError (402) |
org out of credit — top up in the dashboard |
NotFoundError (404) |
unknown endpoint |
EndpointNotReadyError (503) |
endpoint stopped / cold / provider down |
RateLimitError (429) |
throttled (auto-retried) |
BadRequestError (400/422) |
malformed request |
APIConnectionError / APITimeoutError |
transport failure (auto-retried) |
Idempotent GETs and 429/5xx/timeouts are retried with exponential backoff
(max_retries, default 2).
Status
Live: model="auto" inference (buffered + streaming) with pa.auto metrics and
frontier comparison, plus the full control plane — models, tasks (browse +
match), endpoints (deploy / operate / metrics), evals
(bring-your-own-data, with "auto" as a first-class contender), and audio —
and two interfaces over it: the pareta CLI (pip install "pareta[cli]")
and the pareta-mcp MCP server (pip install "pareta[mcp]"). Sync + async
clients.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pareta-0.3.1.tar.gz.
File metadata
- Download URL: pareta-0.3.1.tar.gz
- Upload date:
- Size: 341.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6731febdc7e4b0d2571ff6d95d4d117fa8084116832e1e762327748a1af08f89
|
|
| MD5 |
5f4d0ffbfe7543096660fd5dce71aadd
|
|
| BLAKE2b-256 |
34fadb36f08f0288103bc328b437764054497ad52ba45fdf66042eae4d18aa72
|
Provenance
The following attestation bundles were made for pareta-0.3.1.tar.gz:
Publisher:
publish.yml on Pareta-AI/pareta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pareta-0.3.1.tar.gz -
Subject digest:
6731febdc7e4b0d2571ff6d95d4d117fa8084116832e1e762327748a1af08f89 - Sigstore transparency entry: 2076139532
- Sigstore integration time:
-
Permalink:
Pareta-AI/pareta@8781567835db6f66c692964d366e11a80425e4d7 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Pareta-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8781567835db6f66c692964d366e11a80425e4d7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pareta-0.3.1-py3-none-any.whl.
File metadata
- Download URL: pareta-0.3.1-py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
605a3dd85291007213bd494a546187c0f280751ebc133b3a43c4cf4e4fc6f043
|
|
| MD5 |
585baecc89480682d4e9ff1d92e22633
|
|
| BLAKE2b-256 |
7a0ae1c7cc6e3765e96be86db11f6f6d8e4f60f980961d7274b9f5f877488804
|
Provenance
The following attestation bundles were made for pareta-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on Pareta-AI/pareta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pareta-0.3.1-py3-none-any.whl -
Subject digest:
605a3dd85291007213bd494a546187c0f280751ebc133b3a43c4cf4e4fc6f043 - Sigstore transparency entry: 2076139668
- Sigstore integration time:
-
Permalink:
Pareta-AI/pareta@8781567835db6f66c692964d366e11a80425e4d7 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Pareta-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8781567835db6f66c692964d366e11a80425e4d7 -
Trigger Event:
release
-
Statement type: