Skip to main content
Avo Logo

Avo

The Resilient, Observable AI Agent Runtime with Multi-Tier Combo Routing & Subscription OAuth

One conversation, many models. Automatic failover down to local Ollama. Zero core dependencies.

Python 3.11 | 3.12 License: MIT Tests: 1331 passed Coverage: ≥90% Docs


Avo is an observable, resilient AI agent runtime that unites your Claude Pro, ChatGPT Plus, and Gemini subscriptions with multi-tier combo failover down to local Ollama. When API quotas or rate limits hit mid-flight, Avo switches models seamlessly without losing conversational state or task execution. Built on an event-sourced SQLite ledger with deterministic replay, safe workspace tools, and zero extra core dependencies (Pydantic only).


What Makes Avo Different?

┌─────────────────────────────────────────────────────────────┐
│                      Avo Runtime                            │
└───────────────────────────┬─────────────────────────────────┘
                            │
              ┌─────────────▼─────────────┐
              │    ComboRouterProvider    │
              └─────────────┬─────────────┘
                            │
      ┌─────────────────────┼─────────────────────┐
      │ (Tier 1: Primary)   │ (Tier 2: Cheap)     │ (Tier 3: Free Floor)
┌─────▼──────────────┐┌─────▼──────────────┐┌─────▼──────────────┐
│ Claude / ChatGPT   ││ OpenRouter / Groq  ││ Ollama (Local)     │
│ (Subscription)     ││ (Pay-per-token)    ││ (Zero Cost / Free) │
└────────────────────┘└────────────────────┘└────────────────────┘
         │ (429/Quota)         │ (429/Quota)
         └──────► Fallback ────┴──────► Fallback ────► Done

1. 🔑 Subscription OAuth & Universal Login

Reuse your existing Claude Pro/Team, ChatGPT Plus/Team (Codex), or Google Gemini CLI subscriptions via standard PKCE browser flows (avo login claude, avo login codex, avo login gemini). Tokens are encrypted with chmod 0600, refreshed automatically in the background with deduplication, and stored alongside API keys in ~/.config/avo/auth.json.

2. 🔀 Multi-Tier Combo Routing & Quota Failover

Never suffer crashed agent runs from HTTP 429 or exhausted token quotas again. Configure named combo profiles (default, coder, budget) where models are organized in priority order (subscription → cheap API → free local floor). Avo detects rate limits and credit exhaustion mid-turn, switches to the next tier, and continues streaming.

3. 📜 Event-Sourced Ledger & Replay

Every decision, prompt, tool call, output, and failover is recorded as an immutable event in a durable SQLite ledger. Any past run can be inspected with chronological traces (avo runs inspect <id>) or resumed deterministically (avo runs resume <id>).

4. 🛡️ Hardened Workspace & Ephemeral Sandboxing

File tools strictly enforce POSIX O_NOFOLLOW boundaries—null bytes, symlink escapes, and ../ traversal are blocked before any I/O occurs. Shell commands run in isolated, ephemeral Docker containers with CPU/memory limits and disabled networking by default.

5. 🪶 Zero Extra Core Dependencies

The core agent loop, state machine, event store, and providers require only Pydantic. Additional capabilities (Docker sandbox, OpenTelemetry, CLI extras) remain opt-in.


Terminal Visual Walkthrough

Experience interactive agent loops with real-time model failover:

$ export AVO_PROVIDER=combo
$ export AVO_COMBO=coder
$ avo chat

       ▄██▄           Avo CLI 0.1.0
     ▄██████▄         Fqih (Subscription)
    ███    ███        provider: combo · model: coder [subscription -> cheap -> free]
   ███  ▄▄  ███       workspace: ~/Project/Loopward
   ███  ▀▀  ███       session: c8f921ab04e1
  ──────────────────────────────────────────────────────

> Analyze the authentication flow in src/avo/auth.py and write unit tests

⠋ Thinking...
⤾ Fallback: switched from 'subscription' (claude) to 'cheap' (openrouter) [rate_limited_429]

I've analyzed `src/avo/auth.py`. Here is the architecture breakdown and test suite...

Quickstart (Under 2 Minutes)

1. Installation

Requires Python 3.11+.

git clone https://github.com/Fqih/avo.git
cd avo
python -m pip install -e ".[dev,providers,sandbox]"

2. Authenticate

Log in via subscription OAuth or plain API keys:

# OAuth Subscription login (Claude, ChatGPT Codex, or Gemini)
avo login claude

# Or store plain API keys securely
avo login openrouter --key-stdin

Verify your environment configuration with one command:

avo doctor

3. Interactive Chat REPL

Launch the agent with multi-tier combo routing:

AVO_PROVIDER=combo AVO_COMBO=coder avo chat

Inside the REPL:

  • Type /combo to view real-time tier health and latencies.
  • Type /combo budget to hot-swap to another profile.
  • Type /diff to inspect uncommitted workspace modifications.
  • Type /model to pick a specific standalone model.

4. Python API Example

Embed Avo's resilient loop directly into your Python service:

import asyncio
from pydantic import BaseModel

from avo import AgentRuntime, FunctionTool, ModelResponse, TokenUsage, ToolCall
from avo.providers import FakeProvider


class AddArguments(BaseModel):
    left: int
    right: int


async def add(arguments: AddArguments) -> object:
    return {"sum": arguments.left + arguments.right}


async def main() -> None:
    # 100% offline testable fake provider
    provider = FakeProvider(
        [
            ModelResponse(
                tool_call=ToolCall(
                    tool_call_id="addition-1",
                    name="add",
                    arguments={"left": 2, "right": 3},
                ),
                usage=TokenUsage(input_tokens=12, output_tokens=5),
            ),
            ModelResponse(
                content="The sum is 5.",
                usage=TokenUsage(input_tokens=18, output_tokens=6),
            ),
        ]
    )

    runtime = AgentRuntime(
        provider=provider,
        tools=[
            FunctionTool(
                name="add",
                description="Add two integers.",
                arguments_model=AddArguments,
                function=add,
            )
        ],
    )
    result = await runtime.run("What is 2 + 3?")
    print(result.status.value, result.stop_reason.value, result.output)


if __name__ == "__main__":
    asyncio.run(main())

Comparison Matrix

How does Avo compare to alternative model proxies and CLI tools?

Feature Avo 9router LiteLLM OpenRouter Claude Code
In-Process Agent Runtime ✅ Yes ❌ (Proxy only) ❌ (Gateway only) ❌ (Hosted API) ✅ Yes
Subscription OAuth (Claude/Codex/Gemini) ✅ Yes ✅ Yes ❌ No ❌ No ⚠️ (Claude only)
Multi-Tier Failover (Sub → Cheap → Local) ✅ Yes ⚠️ (Basic route) ✅ Yes ⚠️ (Model fallbacks) ❌ No
Zero-Cost Local Floor (Ollama) ✅ Yes ⚠️ (Via endpoint) ✅ Yes ❌ No ❌ No
Event-Sourced Ledger & Replay (SQLite) ✅ Built-in ❌ No ❌ No ❌ No ❌ No
POSIX Safe Workspace (O_NOFOLLOW) ✅ Built-in ❌ No ❌ No ❌ No ❌ No
Ephemeral Docker Sandbox ✅ Built-in ❌ No ❌ No ❌ No ⚠️ (Host shell)
Core Dependency Footprint Pydantic only Go binary Heavy Python deps N/A (Cloud) Node.js

Supported Providers

Provider Identifier Auth Mechanism Primary Use Case
Anthropic Claude anthropic Subscription OAuth or API Key High-reasoning agent turns
ChatGPT Codex codex Subscription OAuth Complex coding & planning
Google Gemini gemini / gemini-cli Subscription OAuth or API Key Fast, multimodal turns
Ollama ollama Local HTTP (no auth) Zero-cost reliability floor
OpenRouter openrouter API Key 300+ models gateway
Groq groq API Key Ultra low-latency inference
Cerebras cerebras API Key Wafer-scale speed inference
MiniMax minimax API Key Cost-effective Anthropic style
OpenAI-Compatible openai API Key vLLM, llama.cpp, LocalAI
Multi-Tier Combo combo Orchestrates all above Automatic 429 & quota fallback

CLI & REPL Cheat Sheet

Core CLI Commands

Command Action
avo chat Start interactive chat REPL.
avo login [PROVIDER] Authenticate via subscription OAuth or API key.
avo combo list List configured multi-tier combo profiles (--json supported).
avo combo show <NAME> Inspect tier configuration, timeouts, and cooldowns.
avo combo new <NAME> --tier ... Create a custom combo route.
avo combo rm <NAME> Remove a custom combo profile.
avo doctor Smoke-test configuration without network calls.
avo cost Aggregate token usage and USD spend across recorded runs.
avo runs list List recorded execution runs.
avo runs inspect <RUN_ID> Chronological trace of steps, tools, and events.
avo runs diff <A> <B> Compare execution deltas between two runs.

Essential Chat Slash Commands

  • /combo [NAME]: View live tier health status or hot-swap combo profiles.
  • /model [NAME]: Switch active provider or model on the fly.
  • /provider: Inspect resolved endpoint and credentials.
  • /context: Snapshot token usage, session turns, and active persona.
  • /diff: Display unified git diff or status in the current workspace.
  • /undo: Revert uncommitted workspace modifications.
  • /export [PATH]: Export session history to formatted Markdown.
  • /clear: Clear terminal screen.
  • /quit: Exit REPL.

Acknowledgments & Upstream Lineage

Avo is built upon and inspired by excellent open-source projects:

  • decolua/9router (MIT): Upstream reference and port for OAuth PKCE authorization-code token exchange shapes, vendor endpoints, and token-refresh lifecycle patterns.
  • clash-ru/CLIProxyAPI (MIT): Upstream Go lineage for subscription flow verification.
  • BerriAI/liteLLM (MIT): Reference for provider fallback matrices and error categorization.
  • Textualize/rich (MIT): Inspiration for terminal styling and visual design.
  • Anthropic, OpenAI, Google, and Ollama: For developer APIs and local inference engines.

Documentation

Full documentation, architecture specs, and user guides are available at fqih.cloud:


License

Distributed under the MIT License. See LICENSE for details.

Metadata

Release files for avo 0.1.6

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

Source distribution (sdist)

Source distribution for avo 0.1.6
File Size Uploaded
avo-0.1.6.tar.gz 751.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avo 0.1.6
File Interpreter ABI Platform
avo-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / avo-0.1.6.tar.gz

Download URL avo-0.1.6.tar.gz
Size 751.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a43135f20194bc933d7551f24c11f5d854322210b576dc8789127024d152b223
BLAKE2b-256 checksum
How to use checksums
bc3dca28a7c3e03b47b158d914f5a147868cb739c38588a122217338885a171d
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 Sep 16, 2026.

Transparency log

Release files / avo-0.1.6-py3-none-any.whl

Download URL avo-0.1.6-py3-none-any.whl
Size 363.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
613fa98cc85ad978cdb5c5066ef395c6413e2a69b43c072bf6b1f2fb76abf910
BLAKE2b-256 checksum
How to use checksums
93036bdcbf9b77d70e4b72cc62b02a1ced9fc9a6a57f24bc2a8c2d6eb1f6ea97
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 Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.4

2 release files

0.7.2

2 release files

0.7.1

2 release files

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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