• Stars
    star
    159
  • Rank 235,076 (Top 5 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 1 year ago
  • Updated 28 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Run Large-Language Models (LLMs) πŸš€ directly in your browser!
llm.js logo

no-languages commit-activity stars

LLM.js

Run Large-Language Models (LLMs) πŸš€ directly in your browser!

Sample

Example projects🌐✨: Live Demo

Learn More: Documentation

Models Supported:

New models/formats coming soon⏰

Installation

Download and extract the latest release of the llm.js package to your web applicationπŸ“¦πŸ’».

Quick Start

// Import LLM app
import {LLM} from "llm.js/llm.js";

// State variable to track model load status
var model_loaded = false;

// Initial Prompt
var initial_prompt = "def fibonacci(n):"

// Callback functions
const on_loaded = () => { 
    model_loaded = true; 
}
const write_result = (text) => { document.getElementById('result').innerText += text + "\n" }
const run_complete = () => {}

// Configure LLM app
const app = new LLM(
     // Type of Model
    'STARCODER',    

    // Model URL
    'https://huggingface.co/rahuldshetty/ggml.js/resolve/main/starcoder.bin', 

    // Model Load callback function
    on_loaded,          

    // Model Result callback function
    write_result,       

     // On Model completion callback function
    run_complete       
);

// Download & Load Model GGML bin file
app.load_worker();

// Trigger model once its loaded
const checkInterval = setInterval(timer, 5000);

function timer() {
    if(model_loaded){
            app.run({
            prompt: initial_prompt,
            top_k: 1
        });
        clearInterval(checkInterval);
    } else{
        console.log('Waiting...')
    }
}

More Repositories

1

starcoder.js

Web browser version of StarCoder.cpp
C
43
star
2

horde-client

Easy-to-use Python interface for AIHorde Server
Python
9
star
3

viper

Viper, it Bytes; is a interpreted programming language.
C
6
star
4

llm.js-examples

Code repository for hosting llm.js examples
HTML
4
star
5

crystal-maiden-discord-bot

Python discord bot that uses LLM to impersonate as a Dota 2 Character
Python
4
star
6

youtube-view-bot

A Youtube View bot which works by using proxies and selenium IDE
Python
4
star
7

dota2-bug-board

DOTA 2 Bug Board: Issue Explorer
JavaScript
3
star
8

Hybrid-3DES-RC4

Python
3
star
9

Hair-Coloring-Tool-using-U-Net

A Hair Coloring Tool designed in pyhon which uses a neural network callled U-Net to segment the hair.
Python
3
star
10

chess-2d

2D Board game designed in Godot 4
GDScript
2
star
11

hands-free

Chat hands-free with AI-agent right in your browser.
HTML
2
star
12

Awesome-AI

To track list of cool stuff happening with AI
Python
2
star
13

python-opencv-face-recognition

A simple face recognition in python using opencv
Python
1
star
14

pyshrink

[WIP] This package contains basic compression algorithms implemented using pure Python.
Python
1
star
15

talion

New Interpreted Programming Language
Go
1
star
16

androidWebBrowser

Java
1
star
17

snake-2d-godot

2D Snake Game created with Godot Engine.
JavaScript
1
star
18

the-uncanny-detective

A detective game set in 1854.
GDScript
1
star
19

the-elemental-game

Action Adventure filled with Elemental Magic
GDScript
1
star
20

steam-market-price-notifier

A Python app that notifies the user if a price of an item has dropped down below a given threshold.
Python
1
star
21

url-shortner

A URL Shortener with Node JS and Firebase Firestore
JavaScript
1
star
22

Digit-Recognizer-CNN-Flask-App

Digit Recognizer with Convolutional neural network
HTML
1
star
23

Anime-Face-Colorization-with-Auto-Encoder

Jupyter Notebook
1
star
24

material-login-andorid

Andorid Login and Sign Page with Material Theme.
Java
1
star
25

rahuldshetty.github.io

Personal Portfolio and Blog
1
star