Skip to content

Treelang

Treelang turns natural-language requests into validated abstract syntax tree programs that execute against your tools. It keeps model generation separate from deterministic program execution and supports OpenAI and Anthropic model transports.

Install

pip install treelang

Install the optional Anthropic adapter with:

pip install "treelang[anthropic]"

Python 3.12 or newer is required.

Start here

Versioned documentation

Each tagged release publishes an immutable documentation version. The latest alias points to the most recently published release; use the version selector in the header when working with an older package version.

For source development, install the locked environment and preview the site:

uv sync --frozen --all-groups
uv run mkdocs serve