Skip to main content

Azathoth

CI PyPI Python Downloads License

Empirical optimization for context-aware AI workflows.

Azathoth is an open-source engine for building LLM workflows by composing them rather than coding them, improving them with measured evidence rather than intuition, and running them in production on your own infrastructure.

You describe a workflow as a JSON document:

  • prompt steps that state model requirements instead of naming models;
  • tool steps;
  • child workflows, loops and maps;
  • the dependencies, conditions and failure policies between them.

Azathoth runs it and benchmarks it. It searches for the models that pass your benchmark at the latency and cost you target. It deploys only what you deliberately promote, and runs it from a queue, a container or your own program.

define ──► run ──► benchmark ──► optimize ──► promote ──► invoke production

Workflows Are Composed, Not Coded

Most LLM workflows are programs: prompts in source files, models as constants, control flow as code. Every change, whether a new model, a reworded prompt or an extra review step, goes through engineering.

Azathoth makes building a workflow a composition activity. That moves LLM workflows out of engineering and into the hands of the teams who run and own them:

  • platform and DevOps teams operate workflows like infrastructure: versioned revisions, explicit promotion, production state and an audit trail of every invocation;
  • domain experts define what a good answer is, as benchmark cases, exact or judged by a model, and Azathoth measures every candidate against them;
  • engineers write tools: small, versioned, tested units of deterministic work that workflows compose.

Writing code should be for tools, not for LLM workflows.

Quickstart

Install it in a virtual environment. The install guide explains why a venv, and gives the Windows commands:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install azathoth-ai
azathoth --version
azathoth init

azathoth init creates the database and installs the standard tools that ship in the package: run_workflow, loop_workflow and map_workflow compose workflows from other workflows; json_select, json_object, json_merge and validate_json reshape and check the JSON that passes between steps; chunk_text, join_text and render_template split, join and fill in text; split_s3_object and read_s3_object work with data in S3 too large to pass between steps; and segment_pdf divides a PDF into segments a model can cite.

Then take a workflow through its whole life, from a clone of this repository. It needs no model and no API key:

git clone https://github.com/EldritchInc/azathoth.git
cd azathoth
azathoth tool import examples/tools/word-count.json
azathoth tool import examples/tools/word-count-process.json
azathoth workflow import examples/workflows/redundant-word-count.json
azathoth workflow run a1000000-0000-4000-8000-000000000001 --input '"that is not dead which can eternal lie"' --output result
azathoth benchmark import examples/benchmarks/word-count.json
azathoth benchmark run b1000000-0000-4000-8000-000000000001 --workflow a1000000-0000-4000-8000-000000000001
azathoth workflow promote a1000000-0000-4000-8000-000000000001
azathoth workflow invoke a1000000-0000-4000-8000-000000000001 --input '"and with strange aeons even death may die"' --output result
azathoth workflow runs a1000000-0000-4000-8000-000000000001

The workflow counts words twice, with two different tools, so either can fail and the other still answers. workflow run runs it as configured. It prints 8. The benchmark measures it against its cases:

Cases Run: 1
Cases Passed: 1
Passed (exact): 1/1

workflow promote makes this revision production, and workflow invoke runs production, which prints {"result": 8}. workflow runs lists the evidence: one run of each kind, production, benchmark and configured, each with its steps, attempts and outputs recorded.

To add a model, benchmark it and let the optimizer find a cheaper one that still passes, follow Getting Started.

Documentation

Guide What it covers
Installing Azathoth Python, a venv, pip install, checking it works, on macOS and Windows; optionally PostgreSQL and tracing
Running in a Container The container image: a database volume or PostgreSQL, keys, jobs over stdin, a read-only root
Running on AWS Queue workers on Fargate behind SQS, from one CloudFormation template
Serving Workflows Over MCP Promoted workflows as tools for Claude Desktop, IDEs and agents, over stdio or HTTP behind your identity provider
Reading Documents and Citing Them A PDF divided into segments, answered from with a citation behind each answer, every citation checked and exported as Web Annotations
Calling MCP Tools A step calling a tool another MCP server serves, pinned to its schemas, over stdio or HTTP
Sharing Workflows Through a Remote A remote other instances push workflows, tools and benchmarks to and pull from, with tokens, restricted data, the container and Fargate
Connecting OpenRouter An API key, finding and authorizing models, adding judges
Connecting Amazon Bedrock AWS credentials, the IAM policy, pricing Bedrock models and authorizing them
Getting Started One workflow from import to production
Examples Tour Every example, from a word count to a novel
Concepts How Azathoth is put together, and why
CLI Reference Every command, its options and its output
Architecture Decisions The ADRs behind each boundary
Changelog What each release changed, and how to upgrade
Contributing Working on Azathoth itself
Releasing How a release is validated and published

Examples

The examples are complete, importable workflows, each with its benchmarks and end-to-end tests:

  • word count: tools, redundancy, and benchmark cases made from corrected runs;
  • classify sentiment: the whole lifecycle in one step;
  • child workflow, countdown loop and word count map: composing workflows;
  • ticket triage: conditional routing to specialists, and a cheaper classifier found by the optimizer;
  • workflow writer: a workflow that writes workflows and validates them;
  • code review: three concurrent reviewers, merged by code rather than a model;
  • novel: nested loops that plan, draft, edit and revise a book;
  • large file: a file of any size in S3, split into chunks, counted by a map and summed.

What Azathoth Does

  • Composes workflows from prompt, tool and child-workflow steps. Steps can depend on each other, pass values by name or as constants, run conditionally, retry, and fail in a controlled way. Child workflows, loops and maps run through standard tools that ship in the package.
  • Separates intent from models. Steps state requirements, and Azathoth chooses from the models you have authorized among those OpenRouter and Amazon Bedrock currently offer.
  • Records everything: every run, step, attempt, prompt, reply, token and cost, as durable evidence, and traces it with OpenTelemetry when asked.
  • Benchmarks workflows with exact, normalized, schema and model-judged semantic cases.
  • Optimizes by trying strictly cheaper authorized models, step by step, and ranking candidates on quality, reliability, latency and cost. The report shows which model each step of the winner used.
  • Promotes deliberately. Production runs only what was explicitly promoted, on exact models, with a revision history and an invocation log. Optimizing never deploys anything by itself.
  • Runs in production: from versioned job requests that replay rather than repeat, in a signed container image, or as a fleet of queue workers on AWS that share one PostgreSQL database. A run interrupted by a deploy or a lost machine resumes from its journal.
  • Takes inputs by value or by reference, from files or S3, and keeps the content each run was given. Data too large for an input stays in S3 and is worked in chunks.
  • Serves workflows to AI clients. azathoth-mcp offers the promoted workflows you list as MCP tools, to Claude Desktop, IDEs and agents, over stdio or over HTTP behind your identity provider, a scope per tool. Every call is a recorded invocation that names who made it.
  • Calls MCP tools. A step can call a tool another MCP server serves, as it calls any tool. The tool is pinned to its schemas, so a server that changes it stops the step rather than receiving arguments it no longer accepts.

Azathoth is also a typed Python library. The package READMEs document each subsystem.

Design Principles

Persist what should happen. Compose what can execute. Record what actually happened. Change production deliberately.

  • Evidence over intuition. A candidate is better only once it has been measured as better.
  • Composition over code. Workflows are documents; code lives in tools.
  • Provider independence. Workflows describe model requirements; providers are attached at run time.
  • Explicit production authority. Production is what you promoted, not the latest optimizer winner or the cheapest model.
  • Immutable records. Configuration, runs, evaluations and deployments are never rewritten.

Concepts explains each of these in depth.

Project Status

Azathoth 1.4 supports Python 3.11, 3.12 and 3.13 on Linux, macOS and Windows, all tested in CI. It runs models on OpenRouter and Amazon Bedrock, keeps its state in SQLite or PostgreSQL, ships as a signed container image for amd64 and arm64, and deploys to AWS from one CloudFormation template. It reads PDFs and images and cites the passages its answers came from, serves promoted workflows to AI clients over MCP with azathoth-mcp, and calls tools other MCP servers serve. It records who made every revision, keeps restricted data to the models declared private, and shares workflows, tools and benchmarks between instances through a remote. The local editor, azathoth-ui, drives it through its service API. The changelog lists what each release added.

Within 1.x, these stay compatible: workflow, tool and job documents, the CLI's commands and the output it documents, the database schema, which azathoth init migrates forward, the service API, azathoth.api, and the remote protocol, so instances and remotes of different 1.x releases keep sharing. Each grows only by additions; anything removed waits for 2.0, after a minor release that warns of it. The rest of the Python API is typed and documented, but may change in a minor release.

Commercial Support and Pilots

Eldritch, Inc. builds and supports Azathoth. For help putting workflows into production, a pilot on your own data, or support for a deployment, see Work With Us.

License

Azathoth is licensed under the MIT License.

Metadata

Release files for azathoth-ai 1.4.0

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

Source distribution (sdist)

Source distribution for azathoth-ai 1.4.0
File Size Uploaded Provenance Actions
azathoth_ai-1.4.0.tar.gz 506.1 kB With provenance Details for azathoth_ai-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for azathoth-ai 1.4.0
File Interpreter ABI Platform Actions
azathoth_ai-1.4.0-py3-none-any.whl Python 3 none any Details for azathoth_ai-1.4.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / azathoth_ai-1.4.0.tar.gz

Download URL azathoth_ai-1.4.0.tar.gz
Size 506.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bf53108932e7049a6110a9f46ba4cc84a53dd5c1546561e595cd5d1428b3a793
BLAKE2b-256 checksum
How to use checksums
aa7581e0dde0679840fccdd38111d0f6441f170d8cb01f1ea7d3611cf607031d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / azathoth_ai-1.4.0-py3-none-any.whl

Download URL azathoth_ai-1.4.0-py3-none-any.whl
Size 686.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccceca6be9246b4c4c5ea209fe1250b7df211f4a0f3b7aec16155eb56c0af2e4
BLAKE2b-256 checksum
How to use checksums
820d8b2032c65899c66caf12caf8d46a97ad7b3b5b1d161c6db23e67683727d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Security for azathoth-ai 1.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for azathoth_ai-1.4.0.tar.gz

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 Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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