ax-llm/ax
The pretty much "official" DSPy framework for Typescript
What it solves
Ax provides a unified, language-agnostic programming model for building LLM applications. It eliminates the need for manual prompt engineering and repetitive boilerplate across different programming languages by offering a single semantic core that is compiled into native libraries for TypeScript, Python, Java, C++, Go, and Rust.
How it works
Ax uses "Signatures" to define typed structured generation (inputs and outputs) using a string DSL or a fluent builder. These signatures are then executed via a provider abstraction that supports multiple AI services (OpenAI, Anthropic, Gemini, etc.).
For more complex logic, it provides:
- AxAgent: A three-stage pipeline (distiller, executor, responder) that turns signatures into tool-using actors with a sandboxed JS runtime, memory, and skills.
- AxFlow: A typed workflow runner that allows developers to chain nodes into program graphs with support for branches, loops, and parallel execution.
- Optimizers: Tools like GEPA and few-shot bootstrapping to refine model performance.
Who it’s for
Developers who need to build robust, type-safe LLM applications that must run across multiple language ecosystems or who want a structured, programmatic alternative to manual prompt engineering.
Highlights
- Multi-language support: Compiled native libraries for TypeScript, Python, Java, C++, Go, and Rust.
- Typed Structured Generation: Support for Zod, Valibot, and ArkType for strict output validation and automatic retries.
- Provider Agnostic: Seamlessly switch between providers like OpenAI, Anthropic, and DeepSeek without changing code.
- Advanced Agent Architecture: Includes a recursive runtime (RLM) to manage long context, sandboxed execution, and integrated memory/skills.
- Multi-modal and Audio: Built-in support for image, audio, and realtime voice streams.
- Flow-as-Code: Ability to define complex workflows via typed graphs or even Mermaid diagrams.