Framework-independent · Promise-first · Apache-2.0

One typed interface for your LLM providers

Use chat completions, streaming, tools, embeddings, responses, images, moderation, and audio without coupling your application to one provider SDK.

quickstart.ts
import { completion } from "any-llm-ts";

const response = await completion({
  provider: "openai",
  model: "gpt-4.1-mini",
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(response.choices[0]?.message.content);

Switch providers

Keep one application-facing API while changing the provider behind it.

Stay type-safe

Get typed parameters, results, streaming chunks, tools, and common errors.

Extend when needed

Use native adapters, registered providers, or your own OpenAI-compatible endpoint.