2024-12-04 00:41:13 +08:00
2024-11-21 19:53:19 +08:00
2024-12-04 00:41:13 +08:00
2024-12-04 00:41:13 +08:00
2024-11-28 15:43:39 +08:00
2024-12-04 00:41:13 +08:00
2024-11-21 19:53:19 +08:00
2024-12-02 18:51:08 +08:00
2024-12-04 00:41:13 +08:00
2024-12-04 00:41:13 +08:00
2024-12-03 19:39:43 +08:00
2024-11-21 19:53:19 +08:00

xsAI

Extra-small AI SDK for any OpenAI-compatible API.

npm version npm downloads bundle size license

Why?

I'm working on a tiny local-LLM translator - ARPK, which is currently (v0.2.4) 449KB, of which 26% is ollama-js (the other 13% is the pointless whatwg-fetch that comes with ollama-js!)

I wanted to make every byte count, so I started writing a lightweight library - xsAI.

It provides an interface similar to the Vercel AI SDK, ESM-only and zero dependencies for minimal installation size.

Why OpenAI-compatible API?

As mentioned above, I made this library mainly to make it easy to call native LLMs, which all provide more or less OpenAI-compatible APIs.

How xsAI small?

You can try install it with pkg-size.dev:

xsai@0.0.12 is 97KB install size and 8.9KB bundle size (2.3KB gzipped).

Notably, this contains dependencies introduced to support tool calls and structured output.

At xsAI you can install only the packages you need:

If you only need the basic generateText, @xsai/generate-text@0.0.12 is only 12KB install size and 1.1KB bundle size (606B gzipped). (try install it with pkg-size.dev)

Getting Started

Read the documentation to get started.

Status

xsAI is currently in an early stage of development and may introduce breaking changes at any time.

License

MIT

S
Description
🤖💬 extra-small AI SDK.
https://xsai.js.org
Readme MIT
2.8 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 100%