@replit/ai
A library for building AI applications in JavaScript and TypeScript.
Requirements
- Running On Replit: it is required to be running on Replit (either in
development or in a deployment) to be able to use this package. You must also
subscribe to one of our paid plans. This
requirement will loosen up in the future.
- Supported backends: Node 18+, Deno, and Bun. In essence the backend needs to
have support for the fetch API. You may be able to use older version of Node as
long as you polyfill your runtime with
fetch
prior to calling into the API.
Usage
The library implements an API for text completion, chat completion, and
generating embeddings. It supports streaming so that you can provide your users
with the best user experience.
The library is available on NPM as @replit/ai
.
You can check out the API reference
Here is a simple command line chat demo using this library