Skip to main content

Arova

PyPI Python License

One API. Every model. Zero ceremony.

Arova is a small, typed Python client for calling major hosted and local language-model providers through one stable interface. It uses native adapters where wire formats differ and one universal OpenAI-compatible adapter for the long tail of endpoints.

Quickstart

pip install arova
export OPENAI_API_KEY=sk-...
from arova import completion

response = completion(
    "openai/gpt-5.6-luna",
    [{"role": "user", "content": "Explain zero-copy I/O in one paragraph."}],
)
print(response.text, response.cost)

The model prefix selects a provider. A bare model name uses OpenAI by default, and fallback chains can mix providers: fallbacks=["groq/llama-3.3-70b-versatile", "opencompat/local-model"]. For asynchronous applications, use await arova.acompletion(...) or async for event in arova.astream(...).

Provider coverage

Arova includes native adapters for OpenAI, Anthropic, Gemini, Azure OpenAI, Bedrock, Mistral, Cohere, Groq, DeepSeek, and xAI. It also includes arova.opencompat, which can target any OpenAI-compatible endpoint by setting base_url, model, and key. This covers Together AI, Fireworks AI, OpenRouter, Hugging Face Inference Providers, Ollama, vLLM, LM Studio, Perplexity, Cerebras, SambaNova, NVIDIA NIM, DeepInfra, Novita, and deployment-specific endpoints without adding vendor SDKs. The detailed matrix and source notes are in RESEARCH.md.

Adapter Provider examples Wire format
Native OpenAI, Anthropic, Gemini, Azure OpenAI, Bedrock, Mistral, Cohere, Groq, DeepSeek, xAI Provider-specific translation and streaming
opencompat Together, Fireworks, OpenRouter, Ollama, vLLM, LM Studio, Perplexity, Cerebras, SambaNova, self-hosted gateways /chat/completions
from arova.providers.opencompat import OpenCompatProvider
from arova.types import ChatRequest, Message

provider = OpenCompatProvider(
    base_url="https://api.together.xyz/v1",
    api_key="...",
    provider_name="together",
)

Streaming

Streaming yields typed events rather than provider-specific dictionaries. Tool-call arguments may arrive over many deltas and can be reassembled with assemble_tool_calls.

from arova import Arova, TextDelta, Finish

client = Arova()
for event in client.stream("groq/llama-3.3-70b-versatile", [{"role": "user", "content": "Give me three names for a two-faced API."}]):
    if isinstance(event, TextDelta):
        print(event.text, end="", flush=True)
    elif isinstance(event, Finish):
        print(f"\nfinished: {event.reason}")

Tool calling and structured output

The same request types work across native adapters and compatible endpoints. Provider quirks are translated at the boundary.

from arova import completion

response = completion(
    "anthropic/claude-sonnet-4.0",
    [{"role": "user", "content": "What is the weather in Paris?"}],
    tools=[{
        "name": "get_weather",
        "description": "Return current weather for a city.",
        "parameters": {
            "type": "object",
            "properties": {"city": {"type": "string"}},
            "required": ["city"],
        },
    }],
)
for call in response.tool_calls:
    print(call.name, call.arguments)

A JSON-schema response can be requested with response_format={"type": "json_schema", "name": "answer", "schema": {...}}. Support depends on the upstream model; Arova preserves the request and normalizes the response when the provider supports it.

Retries, fallbacks, and costs

Arova retries transient transport failures, 408/409/429 responses, and 5xx responses with jittered exponential backoff. A numeric Retry-After header takes precedence. A fallback chain is expressed as model strings, for example fallbacks=["groq/llama-3.3-70b-versatile", "opencompat/local"]. Every non-streaming response includes normalized usage and a deterministic cost estimate from the bundled static price table. Prices are a source-controlled snapshot, not a billing authority; see RESEARCH.md.

Error Handling

If a request completely fails (e.g., invalid API key, network error, or all fallbacks exhausted), Arova handles it depending on the method:

  • completion / acompletion: Raises an arova.ProviderError which chains the final underlying exception (e.g., httpx.HTTPStatusError) so standard tracebacks reveal the exact upstream failure.
  • stream / astream: Yields an ErrorEvent in the stream containing the failure details, rather than throwing an exception that crashes the active generator.

CLI

arova --help
arova models
arova cost groq llama-3.3-70b-versatile --input-tokens 1000 --output-tokens 250
arova chat --model openai/gpt-5.6-luna

Benchmark-note placeholder

A controlled benchmark will compare direct provider calls with Arova using warmed HTTP/2 connections, identical payloads, and separate cold-start measurements. Until that benchmark is added, performance claims are design goals rather than published results. Arova intentionally avoids per-call imports, unnecessary re-validation, mandatory logging, and proxy/server dependencies in the request path.

License

Arova is released under the MIT License. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arova-0.1.6.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arova-0.1.6-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file arova-0.1.6.tar.gz.

File metadata

  • Download URL: arova-0.1.6.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for arova-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f6484864f1f9e853dec5d037869df7a2e35a70f78f4fd745580e73541395bde3
MD5 a7e24bf3bdfd73c396d37e5f381c7971
BLAKE2b-256 02fe5fcd9df06605c20ce9b0c44211e42b1c4dd354a3a8db61eda77a31f2b3c8

See more details on using hashes here.

File details

Details for the file arova-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: arova-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for arova-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 dad430aaf40cef85e135422af5024ebd19d564f325f726b5d42d646df0ffac01
MD5 9e8d5b308e55131f034a5ce1aaad7725
BLAKE2b-256 c62f733b642014bafbdf6f8544070befc10d1e8dd103b845ed7a4eb1953ce767

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

This release

0.1.6 This release

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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