0.0.2 • Published 11 months ago

@bluishoul/swarm.js v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

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

  1. Set up environment variables

    cp .env.example .env
    • For OpenAI official api and gpt-4o model, set VITE_OPENAI_API_KEY. For other models, use VITE_DEFAULT_MODEL.

    • For OpenAI compatible api, set VITE_OPENAI_BASE_URL and VITE_OPENAI_API_KEY for the client, and VITE_DEFAULT_MODEL for other models like qwen-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
  2. Run vite server

    npm run dev
  3. Open the link shown in your terminal.

  4. Press F12 to open Chrome DevTools and switch to the Console tab. If everything works, you'll see:
    Starting Swarm.js 🐝
  5. Chat using the input box, and try typing 'refund' to start.
0.0.2

11 months ago

0.0.1

11 months ago