arvel-ai
One stable API over many AI providers — plus a secured MCP server — for the arvel framework.
Your app talks to one contract: AI.chat, AI.stream, AI.structured, AI.embed. Which provider
actually serves the request — Anthropic, OpenAI, a LiteLLM proxy, a local vLLM or Ollama — is a
config choice, not a code change. No provider SDK type (httpx, any_llm) ever
crosses into your code; the boundary is enforced by the import-linter, not just intended.
uv add arvel-ai # gateway (openai_compatible + fake) + MCP server
uv add 'arvel-ai[anthropic]' # + the any-llm driver and your provider's SDK, one extra
One extra per provider — anthropic, openai, gemini, bedrock, mistral, ollama,
groq, … (full list); arvel-ai[all] installs every provider.
Need durable, multi-step orchestration? That's a separate package —
arvel-workflow(Temporal-backed) — not part of the gateway.
Installing registers the provider automatically — app.make("ai") and the AI facade work with
zero wiring.
from arvel_ai import AI
reply = await AI.chat("Summarize this review in one line", model="fast")
print(reply.text)
async for delta in AI.stream("Write a product description"):
... # TextDelta / ToolCallDelta / StreamEnd
copy = await AI.structured(ProductCopy, "Write copy for red wool socks")
# a typed, validated ProductCopy — not a dict
What's in the box
- The gateway —
chat/stream(SSE) /structured(typed output) /embed, over a stable msgspec contract and oneAiErrortaxonomy. Swap providers in config; your code never changes. - Model aliases — code says
model="fast"/"smart"; ops maps those to real ids, so a retired model is a one-line config edit, not a code hunt. - A secured MCP server — expose your app's functions to AI agents over the Model Context Protocol, with token or OIDC auth (RFC 8707 audience binding). Off by default.
- First-class fakes —
AI.fake()tests AI code with no network, the same way you test mail. - A health-checked resource — the gateway reports on
/healthand the startup log via a real probe: a wrong or missing key shows asfailed, not a falseok.
Point it at a provider
The gateway speaks the OpenAI HTTP format, and both Anthropic and OpenAI expose OpenAI-compatible endpoints — so you need no proxy in front:
# config/ai.py
from arvel import env
ai = {
"default": "openai_compatible",
"models": {"fast": "claude-haiku-4-5", "smart": "claude-opus-4-8"},
"drivers": {
"openai_compatible": {
"base_url": env("AI_GATEWAY_URL", "https://api.anthropic.com/v1"),
"api_key_env": "AI_API_KEY", # the NAME of the env var, never the key itself
"model": env("AI_MODEL_FAST", "claude-haiku-4-5"),
},
},
}
Keys live in environment variables only — config holds the env var name, never the secret.
Documentation
| Guide | What's in it |
|---|---|
| Getting Started | install → configure → first call → first test, end to end |
| The Gateway | chat/stream/structured/embed, tools, drivers, aliases, errors, observability, testing |
| MCP Server | expose tools to agents, token & OIDC auth, the security model |
| Configuration | the complete config("ai") reference — every key and default |
Requirements
- Python 3.14+
- arvel (installed with the package)
- Optional engines:
arvel-ai[<provider>](the any-llm driver — one extra per provider, see Getting Started); OIDC MCP auth needsarvel[jwt]
License
MIT — see LICENSE.
Metadata
Release files for arvel-ai 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arvel_ai-0.2.0.tar.gz | 173.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arvel_ai-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 206.2 kB
Release files / arvel_ai-0.2.0.tar.gz
| Download URL | arvel_ai-0.2.0.tar.gz |
|---|---|
| Size | 173.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fed3f846ecd86bec7364a3be33b9bbb88872da6be10e7cf6ac612623a585d140
|
|
BLAKE2b-256 checksum How to use checksums |
91b1adfa80aaf1cfb179d2a7690af2e1a645f40d72468db3559332e52ad3b364
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 17, 2026.
Transparency logRelease files / arvel_ai-0.2.0-py3-none-any.whl
| Download URL | arvel_ai-0.2.0-py3-none-any.whl |
|---|---|
| Size | 33.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5938ff82f229e977ce5a01c83731ea5db0e400715702e1b23dc15106d30574b1
|
|
BLAKE2b-256 checksum How to use checksums |
785edf3a9cfe3eaf96d4ef14192c869ab6c464394046d1472562504733650074
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 17, 2026.
Transparency log