Metadata-Version: 2.4
Name: avalan
Version: 1.5.7
Summary: Multi-backend, multi-modal micro-framework for AI agent development, orchestration, and deployment
License: MIT
License-File: LICENSE
Author: The Avalan Team
Author-email: avalan@avalan.ai
Requires-Python: >=3.11,<3.15
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Provides-Extra: a2a
Provides-Extra: agent
Provides-Extra: apple
Provides-Extra: audio
Provides-Extra: browser
Provides-Extra: code
Provides-Extra: ds4
Provides-Extra: litellm
Provides-Extra: local
Provides-Extra: memory
Provides-Extra: mlx
Provides-Extra: nvidia
Provides-Extra: quantization
Provides-Extra: secrets
Provides-Extra: server
Provides-Extra: task
Provides-Extra: task-documents
Provides-Extra: task-otel
Provides-Extra: task-pdf-images
Provides-Extra: task-pgsql
Provides-Extra: task-prometheus
Provides-Extra: tool
Provides-Extra: translation
Provides-Extra: vendors
Provides-Extra: vision
Provides-Extra: vllm
Requires-Dist: RestrictedPython (>=8.0,<9.0.0) ; extra == "code"
Requires-Dist: SQLAlchemy (>=2.0.43,<3.0.0) ; extra == "tool"
Requires-Dist: a2a-sdk[fastapi] (>=1.1.0,<2.0.0) ; extra == "a2a"
Requires-Dist: accelerate (>=1.9.0,<2.0.0) ; extra == "local"
Requires-Dist: aioboto3 (>=15.0.0,<16.0.0) ; extra == "vendors"
Requires-Dist: aiohttp (>=3.14.1,<4.0.0) ; (python_version < "3.14") and (extra == "litellm")
Requires-Dist: aiohttp (>=3.14.1,<4.0.0) ; extra == "vendors"
Requires-Dist: aiomysql (>=0.3.0,<0.4.0) ; extra == "tool"
Requires-Dist: anthropic (>=0.71.0,<0.72.0) ; extra == "vendors"
Requires-Dist: asyncpg (>=0.29.0,<0.32.0) ; extra == "tool"
Requires-Dist: beautifulsoup4 (>=4.14.2,<5.0.0) ; extra == "memory"
Requires-Dist: bitsandbytes (>=0.46.1,<0.47.0) ; (platform_system == "Linux") and (extra == "nvidia")
Requires-Dist: bitsandbytes (>=0.46.1,<0.47.0) ; (platform_system == "Linux") and (extra == "quantization")
Requires-Dist: boto3 (>=1.40.3,<2.0.0) ; extra == "memory"
Requires-Dist: boto3 (>=1.40.3,<2.0.0) ; extra == "secrets"
Requires-Dist: cryptography (>=48.0.1,<49.0.0) ; extra == "memory"
Requires-Dist: cryptography (>=48.0.1,<49.0.0) ; extra == "server"
Requires-Dist: diffusers (>=0.38.0,<0.39.0) ; extra == "vendors"
Requires-Dist: diffusers (>=0.38.0,<0.39.0) ; extra == "vision"
Requires-Dist: elasticsearch (>=9.1.0,<10.0.0) ; extra == "memory"
Requires-Dist: faiss-cpu (>=1.14.2,<2.0.0) ; extra == "memory"
Requires-Dist: fastapi (>=0.101.0,<1.0.0) ; extra == "server"
Requires-Dist: google-genai (>=1.28.0,<2.0.0) ; extra == "vendors"
Requires-Dist: hf-xet (>=1.4.3,<2.0.0) ; (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "arm64" or platform_machine == "aarch64") and (extra == "local")
Requires-Dist: httpx (>=0.27.1,<1.0.0) ; extra == "tool"
Requires-Dist: huggingface-hub (>=1.0.0,<2.0.0) ; extra == "local"
Requires-Dist: humanize (>=4.12.3,<5.0.0)
Requires-Dist: imageio (>=2.37.0,<3.0.0) ; extra == "vision"
Requires-Dist: imageio-ffmpeg (>=0.6.0,<0.7.0) ; extra == "vision"
Requires-Dist: jinja2 (>=3.1.6,<4.0.0) ; extra == "agent"
Requires-Dist: jsonschema (>=4.26.0,<5.0.0) ; extra == "task"
Requires-Dist: keyring (>=25.6.0,<26.0.0) ; extra == "secrets"
Requires-Dist: litellm (>=1.83.7,<2.0.0) ; (python_version < "3.14") and (extra == "litellm")
Requires-Dist: markdownify (>=1.1.0,<2.0.0) ; extra == "memory"
Requires-Dist: markdownify (>=1.1.0,<2.0.0) ; extra == "task-documents"
Requires-Dist: markitdown[pdf] (>=0.1.2,<0.2.0) ; (python_version < "3.14") and (extra == "memory")
Requires-Dist: markitdown[pdf] (>=0.1.2,<0.2.0) ; (python_version < "3.14") and (extra == "task-documents")
Requires-Dist: matplotlib (>=3.6.0,<4.0.0) ; extra == "tool"
Requires-Dist: mcp (>=1.23.0,<2.0.0) ; extra == "server"
Requires-Dist: mlx (>=0.31.2,<0.32.0) ; (platform_system == "Darwin" and platform_machine == "arm64") and (extra == "apple")
Requires-Dist: mlx (>=0.31.2,<0.32.0) ; (platform_system == "Darwin" and platform_machine == "arm64") and (extra == "mlx")
Requires-Dist: mlx-lm (>=0.31.3,<0.32.0) ; (platform_system == "Darwin" and platform_machine == "arm64") and (extra == "apple")
Requires-Dist: mlx-lm (>=0.31.3,<0.32.0) ; (platform_system == "Darwin" and platform_machine == "arm64") and (extra == "mlx")
Requires-Dist: openai (>=2.0.0,<3.0.0) ; extra == "vendors"
Requires-Dist: opencv-python (>=4.12.0.88,<5.0.0) ; extra == "vision"
Requires-Dist: opentelemetry-sdk (>=1.41.1,<2.0.0) ; extra == "task-otel"
Requires-Dist: packaging (>=24.0,<27.0)
Requires-Dist: pgvector (>=0.4.1,<0.5.0) ; extra == "memory"
Requires-Dist: pillow (>=12.2.0,<13.0) ; extra == "vendors"
Requires-Dist: pillow (>=12.2.0,<13.0) ; extra == "vision"
Requires-Dist: playwright (>=1.54.0,<2.0.0) ; extra == "browser"
Requires-Dist: prometheus-client (>=0.23.0,<1.0.0) ; extra == "task-prometheus"
Requires-Dist: protobuf (>=6.31.1,<7.0.0) ; extra == "translation"
Requires-Dist: psycopg-binary (>=3.2.9,<4.0.0) ; (python_version < "3.14") and (extra == "memory")
Requires-Dist: psycopg-binary (>=3.2.9,<4.0.0) ; (python_version < "3.14") and (extra == "task-pgsql")
Requires-Dist: psycopg[pool] (>=3.2.9,<4.0.0) ; extra == "memory"
Requires-Dist: psycopg[pool] (>=3.2.9,<4.0.0) ; extra == "task-pgsql"
Requires-Dist: pydantic (>=2.0,<3.0.0) ; extra == "server"
Requires-Dist: pyds4 (>=1.0.2,<2.0.0) ; (platform_system == "Linux" or platform_system == "Darwin" and platform_machine == "arm64") and (extra == "ds4")
Requires-Dist: pypdf (>=6.13.3,<7.0.0) ; extra == "memory"
Requires-Dist: pypdfium2 (>=5.1.0,<6.0.0) ; extra == "task-pdf-images"
Requires-Dist: python-multipart (>=0.0.31,<0.1.0) ; extra == "server"
Requires-Dist: rich (>=13.7.0,<16.0.0)
Requires-Dist: safetensors (>=0.8.0rc0,<0.9.0) ; extra == "vendors"
Requires-Dist: safetensors (>=0.8.0rc0,<0.9.0) ; extra == "vision"
Requires-Dist: sentence-transformers (>=5.4.1,<6.0.0) ; extra == "local"
Requires-Dist: sentencepiece (>=0.2.0,<0.3.0) ; extra == "translation"
Requires-Dist: soundfile (>=0.13.1,<0.14.0) ; extra == "audio"
Requires-Dist: sqlglot (>=22.0,<31.0.0) ; extra == "tool"
Requires-Dist: starlette (>=1.3.1,<2.0.0) ; extra == "server"
Requires-Dist: sympy (>=1.12,<2.0.0) ; extra == "tool"
Requires-Dist: termaid[rich] (>=0.6.1,<0.7.0)
Requires-Dist: tiktoken (>=0.6.0,<1.0.0)
Requires-Dist: torch (>=2.12.1,<2.13.0) ; extra == "local"
Requires-Dist: torchaudio (>=2.11.0,<2.12.0) ; extra == "audio"
Requires-Dist: torchvision (>=0.27.1,<0.28.0) ; (python_full_version != "3.14.1") and (extra == "vision")
Requires-Dist: transformers (>=5.5.4,<6.0.0) ; extra == "local"
Requires-Dist: tree-sitter (>=0.25.1,<0.26.0) ; extra == "memory"
Requires-Dist: tree-sitter-python (>=0.23.6,<0.24.0) ; extra == "memory"
Requires-Dist: uvicorn (>=0.27.0,<1.0.0) ; extra == "server"
Project-URL: Bug Tracker, https://github.com/avalan-ai/avalan/issues
Project-URL: Documentation, https://github.com/avalan-ai/avalan#readme
Project-URL: Homepage, https://avalan.ai
Project-URL: Repository, https://github.com/avalan-ai/avalan
Description-Content-Type: text/markdown

<h1 align="center">avalan</h1>
<h3 align="center">The multi-backend, multi-modal micro-framework for AI agent development, orchestration, and deployment</h3>

<p align="center">
  <a href="https://pypi.org/project/avalan/"><img src="https://img.shields.io/pypi/pyversions/avalan.svg" alt="Python versions" /></a>
  <a href="https://pypi.org/project/avalan/"><img src="https://img.shields.io/github/v/release/avalan-ai/avalan?label=Release" alt="Release" /></a>
  <a href="https://github.com/avalan-ai/avalan/actions/workflows/test.yml"><img src="https://github.com/avalan-ai/avalan/actions/workflows/test.yml/badge.svg" alt="Tests" /></a>
  <a href="https://coveralls.io/github/avalan-ai/avalan"><img src="https://coveralls.io/repos/github/avalan-ai/avalan/badge.svg" alt="Code test coverage" /></a>
  <img src="https://img.shields.io/github/last-commit/avalan-ai/avalan.svg" alt="Last commit" />
  <a href="https://github.com/avalan-ai/avalan/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/avalan.svg" alt="License" /></a>
  <a href="https://discord.gg/8Eh9TNvk"><img src="https://img.shields.io/badge/discord-community-blue" alt="Discord Community" /></a>
  <a href="https://codewiki.google/github.com/avalan-ai/avalan"><img src="https://img.shields.io/badge/Google-Code%20Wiki-4285F4?logo=google&amp;logoColor=white" alt="Google Code Wiki" /></a>
</p>

Avalan is a Python SDK and CLI for building your own intelligence harness
across local and hosted models. Prompts, model routing, tools, memory,
workflows, tasks, and serving protocols stay explicit, so the model is a
component you control rather than the whole system.

## 🧠 Build Your Intelligence Harness

Avalan is for teams that want the model to be one part of the system, not the
system itself. It gives you the runtime harness around inference, tools,
memory, orchestration, tasks, protocols, and human control.

With Avalan, you can:

- 💻 Run **local and hosted models** behind one interface, with inference-time
  control over prompts, sampling, streaming, backends, and vendor routing.
- 🛠️ **Execute tools** as first-class runtime steps, including browser automation,
  code, databases, shell media tools, MCP servers, and A2A agents.
- 🧱 Choose **runtime isolation** for execution surfaces with local, sandbox,
  and container modes, trusted profiles, and fail-closed policy.
- 🔁 **Compose flows** where each node, edge, input, output, and review boundary is
  visible.
- ✅ Package repeatable work as **tasks with typed inputs**, file handling, queues,
  durable execution, privacy settings, and schema-validated outputs.
- 🌐 **Serve your agents** through OpenAI-compatible APIs, MCP, and A2A without
  changing the agent runtime.
- 🔒 Add **human-in-the-loop** and least-privilege controls around tool execution,
  data access, files, and networked agent calls.

## 📦 Install

Avalan supports Python 3.11 through 3.14.

### 🍺 Homebrew (macOS)

```sh
brew install avalan-ai/avalan/avalan
```

### 🐧 Ubuntu (PPA)

```sh
sudo add-apt-repository -y ppa:avalan-ai/avalan
sudo apt update
sudo apt install -y avalan
```

### 🐍 Pip

```sh
python3 -m pip install -U "avalan[agent,server,tool,vendors]"
```

### 🛠️ From Source with Poetry

```sh
poetry install --extras "agent server tool vendors" --with test
```

See [docs/INSTALL.md](docs/INSTALL.md) for pip extras, backend-specific
dependencies, DS4 setup, and source build prerequisites.

## ⚡ Quickstart

### 💬 Call a hosted model from the CLI

Export a vendor key, then run:

```sh
export OPENAI_API_KEY=...
echo "Who are you, and who is Leo Messi?" \
    | avalan model run "ai://env:OPENAI_API_KEY@openai/gpt-4o" \
        --system "You are Aurora, a helpful assistant" \
        --max-new-tokens 100
```

### 🐍 Use the Python SDK

```python
from asyncio import run
from os import environ
from avalan.entities import GenerationSettings, TransformerEngineSettings
from avalan.model.nlp.text.vendor.openai import OpenAIModel
from avalan.model.stream import StreamItemKind

async def main() -> None:
    api_key = environ["OPENAI_API_KEY"]
    settings = TransformerEngineSettings(access_token=api_key)

    with OpenAIModel("gpt-5-mini", settings) as model:
        async for item in await model(
            "Give me five facts about Leo Messi.",
            settings=GenerationSettings(use_async_generator=True),
        ):
            if (
                item.kind is StreamItemKind.ANSWER_DELTA
                and item.text_delta is not None
            ):
                print(item.text_delta, end="", flush=True)

run(main())
```

### ✅ Run a flow-backed task

This example requires task, PDF image conversion, agent, and vendor
dependencies:

```sh
python3 -m pip install -U "avalan[agent,task,task-pdf-images,vendors]"
```

```sh
avalan task run docs/examples/tasks/poc_extraction/image_flow_task.toml \
    --ephemeral \
    --pdf docs/examples/tasks/poc_extraction/sample.pdf \
    --json \
    --output image.json
```

For task contracts, flow graphs, file conversion, queues, and schema output,
see [docs/TASKS.md](docs/TASKS.md), [docs/FLOWS.md](docs/FLOWS.md), and
[docs/examples/tasks/poc_extraction/README.md](docs/examples/tasks/poc_extraction/README.md).

## Documentation & Resources

- [docs/README.md](docs/README.md) - Complete documentation index.
- [docs/INSTALL.md](docs/INSTALL.md) - Platform setup, extras, backends, and
  source builds.
- [docs/MODELS.md](docs/MODELS.md) - Model URIs, local and hosted backends,
  generation settings, and streaming.
- [docs/AGENT_GUIDE.md](docs/AGENT_GUIDE.md) - Agent TOML, prompts, tools, memory,
  structured output, multimodal inputs, and serving.
- [docs/TOOLS.md](docs/TOOLS.md) - Built-in tools, MCP, A2A, shell tools,
  confirmation, safety controls, and reasoning strategies.
- [docs/MEMORIES.md](docs/MEMORIES.md) - Recent and permanent memory,
  namespaces, indexing, retrieval, and storage backends.
- [docs/FLOWS.md](docs/FLOWS.md) - Explicit graph workflows, strict
  definitions, Mermaid views, branching, and review boundaries.
- [docs/TASKS.md](docs/TASKS.md) - Durable task contracts, file delivery,
  queues, storage, privacy, and schema validation.
- [docs/MODALITIES.md](docs/MODALITIES.md) - Text, vision, and audio CLI and
  Python examples.
- [docs/CLI.md](docs/CLI.md) - Command and flag reference.
- [docs/examples](docs/examples/README.md) - Runnable examples.

## Community & Support

- Join the [Avalan Discord](https://discord.gg/8Eh9TNvk) to ask questions,
  share workflows, and follow release announcements.
- Browse generated documentation or ask follow-up questions in
  [Google Code Wiki](https://codewiki.google/github.com/avalan-ai/avalan).
- For commercial support, email
  [avalan@avalan.ai](mailto:avalan@avalan.ai).

## Contributing

We welcome pull requests, issue reports, docs improvements, and new examples.

1. Read the [Code of Conduct](CODE_OF_CONDUCT.md) before you start.
2. Install the development environment with
   `poetry install --all-extras --with test`.
3. Run `make lint`.
4. Run `poetry run pytest --verbose -s`.

Open a [GitHub issue](https://github.com/avalan-ai/avalan/issues) if you
discover bugs or want to propose larger changes.

