moeru-ai/xsai

🤖💬 extra-small AI SDK.

What it solves

xsAI is an extra-small AI SDK designed for developers who find full-featured AI frameworks too heavy or broad for their needs. It provides a lightweight foundation for building OpenAI-compatible applications and agents without the overhead of universal provider abstractions or unnecessary runtime baggage.

How it works

It functions as an OpenAI-compatible runtime that builds directly on the Fetch API and remains ESM-only. By avoiding extra dependencies and Node.js built-in modules, it ensures high portability across different environments, including browsers, Deno, Bun, and Edge Runtimes.

Who it’s for

Developers building AI agents or apps that require a small footprint, fast load times, and a focused interface for interacting with OpenAI-compatible APIs.

Highlights

  • Ultra-lightweight: Significantly reduces install and bundled size compared to larger AI SDKs (e.g., 40x smaller install size than ai package).
  • Runtime Portability: Works across browser, edge, and various JS runtimes (Bun, Deno).
  • OpenAI Compatibility: Focused surface for text generation, streaming, and structured data.
  • Tool Calling: Supports tool calling and structured output capabilities.

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Project