0.0.2 • Published 11 months ago
@bluishoul/swarm.js v0.0.2
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 installUsage
Set up environment variables
cp .env.example .envFor 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_URLandVITE_OPENAI_API_KEYfor the client, andVITE_DEFAULT_MODELfor 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 setRun vite server
npm run devOpen the link shown in your terminal.
- Press F12 to open Chrome DevTools and switch to the
Consoletab. If everything works, you'll see:Starting Swarm.js 🐝 - Chat using the input box, and try typing 'refund' to start.