Skip to main content

pydantic-ai-otari

Run Pydantic AI agents through Otari, the open-source LLM gateway, and get its budgets, usage tracking, fallback routing and guardrails on every model call.

pip install pydantic-ai-otari
export OTARI_API_KEY=<your-otari-key>                # from otari.ai, or from your own gateway
export OTARI_BASE_URL=http://localhost:8000/api/v1   # only for a self-hosted gateway: its URL plus /api/v1
from pydantic_ai import Agent
from pydantic_ai_otari import OtariModel

agent = Agent(OtariModel("anthropic:claude-sonnet-4-6"))
print(agent.run_sync("Say hello in one sentence.").output)
  • OtariModel(model_name) takes any model your gateway routes: provider:model, or the name of a routing policy or alias. The provider part also selects the model's capabilities in Pydantic AI, so a Claude model is treated as one.
  • OtariProvider(base_url=..., api_key=...) configures the gateway in code; pass it as OtariModel(..., provider=...). Without OTARI_BASE_URL, requests go to otari.ai's gateway, https://api.otari.ai/api/v1.
  • OPENAI_API_KEY is never used as a fallback, so an OpenAI key is not sent to the gateway by mistake.

Tools, structured output and streaming work unchanged. The full guide, including how to do this without the package: Use with Pydantic AI.

Developed in mozilla-ai/otari, where every change is tested against a running Otari.

Metadata

Release files for pydantic-ai-otari 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-ai-otari 0.1.0
File Size Uploaded Provenance
pydantic_ai_otari-0.1.0.tar.gz 8.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-ai-otari 0.1.0
File Interpreter ABI Platform
pydantic_ai_otari-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / pydantic_ai_otari-0.1.0.tar.gz

Download URL pydantic_ai_otari-0.1.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2d7a7b178df5c04d068d3898bd35a79aaee9a5abfbd8068d25c9b39b5954aec7
BLAKE2b-256 checksum
How to use checksums
0fa08b4582b7f7263da1f696086ccadacac05d6e529fac7eb04cc11a45ef3936
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / pydantic_ai_otari-0.1.0-py3-none-any.whl

Download URL pydantic_ai_otari-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7bd6945ea8fcf5becc0d87bd0fa6127db547a245af668e477bd5a0d55db8ac9
BLAKE2b-256 checksum
How to use checksums
6af215ef3133572050a350ba14e488daf5ccff5d48530c08697a8ef63ff88293
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for pydantic-ai-otari 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pydantic_ai_otari-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page