Skip to content

woolball-xyz/woolball-client

Repository files navigation

woolball-client 🧶

npm Quality Gate Status

Turn any open tab into an AI compute node

woolball-client establishes a connection between a user's browser and a running woolball-server instance. It utilizes WebSocket to receive job requests, executes the specified model locally using WebGPU or WASM, and transmits the outcome back to the server in real-time.

⚠️ Important: Before using this library, make sure you have the woolball-server running

AI Tasks

Provider Task Models Status
Transformers.js Speech-to-Text ONNX Models ✅ Implemented
Transformers.js Text-to-Speech ONNX Models ✅ Implemented
Kokoro.js Text-to-Speech ONNX Models ✅ Implemented
Transformers.js Translation ONNX Models ✅ Implemented
Prompt API Translation Gemini Nano 🧪 Experimental
Transformers.js Text-Generation ONNX Models ✅ Implemented
WebLLM Text Generation MLC Models ✅ Implemented
MediaPipe Text Generation LiteRT Models ✅ Implemented
Prompt API Text Generation Gemini Nano 🧪 Experimental
Transformers.js Image-Text-to-Text ONNX Models ⚠️ Partial
Prompt API Image-Text-to-Text Gemini Nano 🧪 Experimental

Browser API Tasks

API Task Description Status
Canvas API Character-to-Image Converts a character to an image ✅ Implemented
Canvas API HTML-to-Image Converts HTML content to an image ✅ Implemented

Quick Start

  1. Install the package:
npm install woolball-client
  1. Import and use in your code:
import Woolball from 'woolball-client';

// Initialize with a client ID
const woolball = new Woolball('your-client-id', 'ws.server.com'); // ws://localhost:9003 by default

// Listen for task events

Usage Options

Web Application

See the usage directory for a complete React-based web application example that demonstrates how to integrate the Woolball client into a web application.

Chrome Extension

A Chrome extension is available in the chrome-extension directory, allowing users to contribute their browser's computing resources to a Woolball server while browsing.

To build and use the Chrome extension:

# Build the Woolball client library
npm run build:all

# Install extension dependencies
cd chrome-extension
npm install

# Build the extension
npm run build

Then load the extension in Chrome from the chrome-extension/dist directory.

Demo Pages

Simple demo pages are available in the demo directory:

# Serve the demo pages
npm run serve:demo

Development

# Install dependencies
npm install

# Build the library
npm run build:all

# Run tests
npm test

# Run end-to-end tests
npm run test:e2e

License

This project is licensed under the MPL-2.0 License - see the LICENSE file for details.

About

Turn any open tab into an AI compute node

Resources

License

Stars

Watchers

Forks

Contributors