Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@xsai-transformers/chat

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xsai-transformers/chat

Transformers.js wrapper makes it easy to use with xsai

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
3
Created
Source

@xsai-transformers/chat

Experimental provider implementation of 🤗 Transformers.js for xsai.

This enables you possibilities to use any models supported by 🤗 Transformers.js the feel of xsai just like you are directly request OpenAI API but pure locally within the browser.

This is also possible for runtime with WebGPU or Web Workers support, e.g. Node.js.

[!WARNING]

This haven't been released yet, it is currently only used by Project AIRI's stage and memory layer, if you found this helpful, join us to discuss on xsai #41.

Example usage

ni @xsai-transformers/chat -D # from @antfu/ni, can be installed via `npm i -g @antfu/ni`
pnpm i @xsai-transformers/chat -D
yarn i @xsai-transformers/chat -D
npm i @xsai-transformers/chat -D
import { createChatProvider } from '@xsai-transformers/chat'
import chatWorkerURL from '@xsai-transformers/chat/worker?worker&url'
import { generateText } from '@xsai/chat'

const chatProvider = createChatProvider({ baseURL: `xsai-transformers:///?worker-url=${chatWorkerURL}` })

const handleChat = () => {
  const res = await generateText({
    ...chatProvider.chat('onnx-community/gemma-3-270m-it-ONNX', { dtype: 'q4' }),
    messages: [{ content: 'Hi! How are you?', role: 'user' }],
  })

  console.log(res)
}

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts