@bluishoul/swarm.js
v0.0.2
Published
Run [OpenAI/Swarm](https://github.com/openai/swarm) in browser.
Downloads
139
Readme
Swarm.js
Run OpenAI/Swarm in browser.
[!WARNING] This project loads the API Key in the browser for personal use cases. Do not use it in production.
Install
npm install
Usage
Set up environment variables
cp .env.example .env
For OpenAI official api and gpt-4o model, set
VITE_OPENAI_API_KEY
. For other models, useVITE_DEFAULT_MODEL
.For OpenAI compatible api, set
VITE_OPENAI_BASE_URL
andVITE_OPENAI_API_KEY
for the client, andVITE_DEFAULT_MODEL
for other models likeqwen-max
.
VITE_OPENAI_BASE_URL= # OpenAI base url VITE_OPENAI_API_KEY= # OpenAI api key VITE_DEFAULT_MODEL= # Default Model, gpt-4o if no set
Run vite server
npm run dev
Open the link shown in your terminal.
Press F12 to open Chrome DevTools and switch to the
Console
tab. If everything works, you'll see:Starting Swarm.js 🐝
Chat using the input box, and try typing 'refund' to start.