npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@archasek/ax

v19.0.41-fork.2

Published

The best library to work with LLMs

Readme

Ax: Build Reliable AI Apps in TypeScript

Stop wrestling with prompts. Start shipping AI features.

Ax brings DSPy's revolutionary approach to TypeScript – just describe what you want, and let the framework handle the rest. Production-ready, type-safe, and works with all major LLMs.

NPM Package Twitter Discord Chat

Transform Your AI Development in 30 Seconds

import { ai, ax } from "@ax-llm/ax";

// 1. Pick any LLM
const llm = ai({ name: "openai", apiKey: process.env.OPENAI_APIKEY! });

// 2. Say what you want
const classifier = ax(
  'review:string -> sentiment:class "positive, negative, neutral"',
);

// 3. Get type-safe results
const result = await classifier.forward(llm, {
  review: "This product is amazing!",
});
console.log(result.sentiment); // "positive" ✨

That's it. No prompt engineering. No trial and error. It works with GPT-4, Claude, Gemini, or any LLM.

Why Thousands of Developers Choose Ax

🎯 Define Once, Run Anywhere

Write your logic once. Switch between OpenAI, Anthropic, Google, or 15+ providers with one line. No rewrites needed.

Ship 10x Faster

Stop tweaking prompts. Define inputs → outputs. The framework generates optimal prompts automatically.

🛡️ Production-Ready from Day One

Built-in streaming, validation, error handling, observability. Used by startups in production handling millions of requests.

🚀 Gets Smarter Over Time

Train your programs with examples. Watch accuracy improve automatically. No ML expertise needed.

Real Apps, Real Simple

Extract Structured Data from Customer Emails

const extractor = ax(`
  customerEmail:string, currentDate:datetime -> 
  priority:class "high, normal, low",
  sentiment:class "positive, negative, neutral",
  ticketNumber?:number,
  nextSteps:string[],
  estimatedResponseTime:string
`);

const result = await extractor.forward(ai, {
  customerEmail: "Order #12345 hasn't arrived. Need this resolved immediately!",
  currentDate: new Date(),
});
// Automatically extracts all fields with proper types and validation

Build Agents That Use Tools (ReAct Pattern)

const assistant = ax(
  "question:string -> answer:string",
  {
    functions: [
      { name: "getCurrentWeather", func: weatherAPI },
      { name: "searchNews", func: newsAPI },
    ],
  },
);

const result = await assistant.forward(ai, {
  question: "What's the weather in Tokyo and any news about it?",
});
// AI automatically calls both functions and combines results

Multi-Modal Analysis with Images

const analyzer = ax(`
  image:image, question:string ->
  description:string,
  mainColors:string[],
  category:class "electronics, clothing, food, other",
  estimatedPrice:string
`);
// Process images and text together seamlessly

Quick Start

Install

npm install @ax-llm/ax

Your First AI Feature (2 minutes)

import { ai, ax } from "@ax-llm/ax";

const llm = ai({ name: "openai", apiKey: process.env.OPENAI_APIKEY! });

const translator = ax(`
  text:string, 
  language:string -> 
  translation:string
`);

const result = await translator.forward(llm, {
  text: "Hello world",
  language: "Spanish",
});
console.log(result.translation); // "Hola mundo"

Powerful Features, Zero Complexity

  • 15+ LLM Providers - OpenAI, Anthropic, Google, Mistral, Ollama, and more
  • Type-Safe Everything - Full TypeScript support with auto-completion
  • Streaming First - Real-time responses with validation
  • Multi-Modal - Images, audio, text in the same signature
  • Smart Optimization - Automatic prompt tuning with MiPRO
  • Production Observability - OpenTelemetry tracing built-in
  • Advanced Workflows - Compose complex pipelines with AxFlow
  • Enterprise RAG - Multi-hop retrieval with quality loops
  • Agent Framework - Agents that can use tools and call other agents
  • Zero Dependencies - Lightweight, fast, reliable

Learn More

🚀 Quick Wins

📚 Deep Dives

Examples

Run any example:

OPENAI_APIKEY=your-key npm run tsx ./src/examples/[example-name].ts

Core Examples

Production Patterns

📚 View Full Examples Guide
View All 70+ Examples →

Join the Community

Production Ready

  • Battle-tested - Used by startups in production
  • No breaking changes - Stable minor versions
  • Comprehensive tests - Large test coverage
  • OpenTelemetry - Built-in observability
  • TypeScript first - Type-safe by design

License

Apache 2 - Use it anywhere, build anything.


Ready to build the future? Stop fighting with prompts. Start shipping with signatures.

npm install @ax-llm/ax

Built with ❤️ by developers, for developers.