Migration Guide
This major release removes the old compatibility surfaces that were kept during the factory API transition. New code should use the factory functions and the current optimizer/artifact model.
Use Factories
import { ai, ax, s, flow } from "@ax-llm/ax";
const llm = ai({ name: "openai", apiKey: process.env.OPENAI_APIKEY });
const sig = s("question:string -> answer:string");
const gen = ax("question:string -> answer:string");
const workflow = flow<{ question: string }>();
Removed constructor paths:
new AxAI(...)new AxSignature(...)new AxFlow(...)
Tagged template forms were also removed. Use ax("...") and s("...").
Provider Changes
Wrapper/platform providers were removed from the core package:
- Groq
- Together
- OpenRouter
- Ollama
- WebLLM
Use the OpenAI provider for custom OpenAI-compatible endpoints:
const gateway = ai({
name: "openai",
apiURL: "https://api.example.com/v1",
apiKey: process.env.OPENAI_COMPAT_APIKEY,
models: [
{ key: "default", model: "provider/model-name", description: "Default model" },
],
config: { model: "default" },
});
Kept providers include OpenAI, OpenAI Responses, Azure OpenAI, Anthropic, Gemini, Mistral, Cohere, Reka, DeepSeek, Grok/xAI, and HuggingFace.
Removed Subsystems
The old document/RAG/vector database stack has been removed:
AxApacheTikaAxDB*AxDBManagerAxDefaultResultRerankeraxRAG
The old classifier helpers were removed:
AxSimpleClassifierAxSimpleClassifierClass
The old self-improvement stack was removed:
AxLearnaxLearnAxACE- trace logger/storage/checkpoint compatibility types
Use GEPA, agent.optimize(...), and AxBootstrapFewShot for retained
optimization workflows.
Removed Compatibility Aliases
Use the current names and artifact shapes:
actorTurnCallbackinstead ofexecutorTurnCallbackAxJSRuntimethrough theruntimeoption instead ofAxCodeInterpreterf(...)instead ofcreateFieldType(...)fn(...).arg(...)instead offn(...).args(...)- prompt examples now render through the current message-pair prompt path
- optimized artifacts should use
componentMap; the legacy top-levelinstructionfallback is gone