DEV.co
RAG Frameworks · ax-llm

ax

Ax is a TypeScript-first framework for building LLM applications with typed structured generation, provider abstraction, and agent/flow orchestration. The same semantic core compiles to Python, Java, C++, Go, and Rust, enabling multi-language LLM development from a single codebase.

Source: GitHub — github.com/ax-llm/ax
2.8k
GitHub stars
180
Forks
TypeScript
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryax-llm/ax
Ownerax-llm
Primary languageTypeScript
LicenseApache-2.0 — OSI-approved
Stars2.8k
Forks180
Open issues6
Latest release23.0.0 (2026-07-05)
Last updated2026-07-05
Sourcehttps://github.com/ax-llm/ax

What ax is

Ax provides signatures (string DSL, fluent builder, or Standard Schema validators) for typed generation, abstracts OpenAI, Anthropic, Gemini, and other providers, and implements agents (with runtime, memory, skills), flows (typed DAGs with branches, loops, parallelism), and optimizers (GEPA, few-shot bootstrapping). One semantic IR compiles to native packages across six languages.

Quickstart

Get the ax source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/ax-llm/ax.gitcd ax# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Cross-language LLM application development

Teams needing to deploy the same LLM logic across TypeScript, Python, Java, C++, Go, and Rust can author once in Ax and compile to all targets, reducing duplication and maintenance burden.

Structured data extraction and classification

Use signatures and Standard Schema validators (Zod, Valibot, ArkType) to enforce typed outputs from LLMs with automatic retries and streaming validation, eliminating post-hoc parsing and hand-written prompt engineering.

Multi-step agent and flow orchestration

Build stateful agents with memory, skills, and delegation; define flows as typed DAGs with branches, loops, feedback, and parallel execution; apply optimizers to improve performance without manual tuning.

Implementation considerations

  • Start with TypeScript; Python and other language packages are auto-generated from the TypeScript IR, so the source semantics live in TypeScript and must be kept in sync.
  • Provider key rotation and secret management must be handled externally; Ax expects environment variables or constructor arguments for API keys.
  • Streaming is the default for latency efficiency; use `streamingForward()` or `forward()` depending on whether incremental output is needed.
  • Standard Schema validators (Zod, Valibot, ArkType) can replace `f()` builders for complex nested objects; choose based on team familiarity and schema reuse.
  • Agents maintain runtime state (context budgets, checkpoints, memory); design error recovery and state persistence carefully in production.

When to avoid it — and what to weigh

  • Need tight coupling to a single provider's advanced features — Ax abstracts providers; if you require deep integration with OpenAI's realtime API, Anthropic's computer use, or vendor-specific extensions, the abstraction may limit access or add latency.
  • Working primarily in a language not yet in Ax's matrix — Ax supports TypeScript, Python, Java, C++, Go, and Rust. If your stack is C#, Ruby, PHP, or another language, you will not have a first-class implementation.
  • Require production-hardened optimization and fine-tuning — Ax includes GEPA and bootstrapping, but complex hyperparameter tuning, custom loss functions, and large-scale training workflows are not clearly documented or exposed.
  • Need zero external dependencies or offline-first operation — Ax depends on provider SDKs and network calls. Local/offline LLM execution via Ollama is supported, but the framework is designed for cloud LLM providers.

License & commercial use

Apache License 2.0 (Apache-2.0). Permissive OSI-approved license allowing commercial use, modification, and distribution with attribution and no warranty.

Apache-2.0 is a permissive OSI license that explicitly permits commercial use. No proprietary restrictions or commercial licensing tiers are apparent from the repository. Always review the full LICENSE file and consult legal counsel for your use case.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

API keys are passed as environment variables or constructor arguments; ensure secrets are not logged or committed. Streaming and validation occur client-side, reducing exposure during parsing. Ax does not implement input sanitization or defense against prompt injection; application code must validate inputs before passing to LLMs. Dependency security: TypeScript implementation depends on provider SDKs (openai, @anthropic-ai, @google/generative-ai, etc.); keep those updated.

Alternatives to consider

LangChain (TypeScript, Python, etc.)

Mature, broad ecosystem, more examples and integrations. Less focus on cross-language compilation; instead, separate implementations per language maintain feature parity.

Vercel AI SDK

Lighter-weight, TypeScript/JavaScript first, good for web/Node.js. Narrower scope (no multi-language compilation or advanced flow orchestration); tighter coupling to Vercel services.

DSPy (Python reference implementation)

Original DSPy framework in Python; Ax is the TypeScript interpretation. DSPy has more research maturity and optimizer variants but no native cross-language support.

Software development agency

Build on ax with DEV.co software developers

Ax lets you write once in TypeScript and compile to six languages with typed structured generation and provider abstraction. Explore the repository, run examples, or contact our AI development team to integrate Ax into your stack.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

ax FAQ

Can I use Ax with local LLMs (Ollama, LLaMA)?
Yes, Ollama is listed in the topics. The README mentions support for local/OpenAI-compatible endpoints, but specific Ollama setup is not shown in the excerpt; check examples/README.md.
How do I switch between providers (OpenAI, Anthropic, Gemini)?
Change the `name` field in `ai({ name: 'openai' | 'anthropic' | 'google-gemini' | ... })` and provide the corresponding API key. Signatures and code remain unchanged.
Do I have to use all six languages, or can I pick a subset?
You can use any subset (e.g., TypeScript + Python). Each language package is independently published (npm, PyPI, crates.io, Maven Central, etc.). Compilation is optional; only regenerate packages when AxIR changes.
How much latency overhead does Ax add?
Ax is designed to stay in the same latency class as direct provider calls. The hot path is thin (render signature → call provider → parse → return). Streaming benchmarks are provided; latency is dominated by provider queueing and model generation.

Custom software development services

DEV.co helps companies turn open-source tools like ax into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your rag frameworks stack.

Ready to build cross-language LLM applications?

Ax lets you write once in TypeScript and compile to six languages with typed structured generation and provider abstraction. Explore the repository, run examples, or contact our AI development team to integrate Ax into your stack.