Aquila — an Elixir library for LLM orchestration

Aquila is Franz Bettag's open-source Elixir library that orchestrates the OpenAI Responses and Chat Completions APIs, with tool-context callbacks, streaming sinks for processes and LiveView, and deterministic record/replay for tests.

Problem

Starting point

Production LLM integrations in Elixir/Phoenix need a shared abstraction for the Responses and Chat Completions APIs, tool calls with their own context, streaming into processes and LiveView, and reproducible tests without live API calls.

Role

Franz Bettag's role

Author and maintainer of the library.

Architecture and workflow

Orchestration

Responses and Chat Completions orchestration with tool-context callbacks.

Streaming

Streaming sinks for Elixir processes and Phoenix LiveView.

Deterministic tests

Record/replay cassettes enable reproducible tests without live API calls, complemented by telemetry for observability.

Results and limitations

What's documented

The record/replay cassettes are reproducible reliability and correctness checks, not performance benchmarks. No measured customer latency or cost-savings data exists.

Complete application example

examples/support_assistant runs a complete tool and streaming workflow offline. Verification on 5 September 2026: 432 library tests passed, 15 live tests excluded, 82.6% coverage, plus three passing application-example tests. This is a demonstration application.

Evidence

Sources and status

Source code, package, documentation and a publicly configured CI pipeline. The current CI status is visible via the link and was not manually verified for this page.