Giter VIP home page Giter VIP logo

llm.js's Introduction

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...')
    }
}

llm.js's People

Contributors

rahuldshetty avatar felladrin avatar dependabot[bot] avatar

Stargazers

S. Suzuki avatar Alexander F. Rødseth avatar Anuebunwa ifeanyi avatar Soter avatar  avatar Lore avatar  avatar Chanwoong Kim avatar Haebom avatar  avatar Yuki Arimo avatar ddc avatar Aleksandr Chernov avatar Dani Gunawan avatar MARCOUX avatar Raj avatar Raghav Saboo avatar Marko Tasic avatar Devin avatar Mihai Chirculescu avatar afrideva avatar HK-SHAO avatar  avatar Jiwon Choi avatar Jan Schulte avatar Nikhil M avatar Asher Mathews  avatar Logan King (DarkComet) avatar knu avatar Felipe Engelberger avatar Bennet avatar Huan Xu avatar Praveen Yadav avatar Caio A. Torquato avatar Mathias DESLOGES avatar Brandt Abbott avatar Tim Kersey avatar  avatar Samuel Deng avatar Nikolay Astakhayev avatar  avatar Vivtonenko Aleksandr avatar  avatar  avatar  avatar  avatar Noskill avatar Rody Zakovich avatar Eugene Klimov avatar timelyportfolio avatar Gregory Demin avatar Herman Streltsov avatar Beckett avatar AG avatar Ivan Zotov avatar Березин Дмитрий avatar Andrey Gershun avatar Liquid Network Australia avatar Ramil avatar  avatar Valentin Vieriu avatar  avatar Geograph avatar Rodion Popov avatar Maksim Hranin avatar  avatar  avatar Andrei Surugiu avatar Alex Ehlke avatar  avatar Zeki Ozen avatar  avatar  avatar Pedro Simão avatar KarlitosD avatar Aryan Singh avatar Andy Kish avatar Nodar Gogoberidze avatar Mátyás Budavári avatar Julian Bravard avatar Bryce Baril avatar Adithya Krishnan avatar X0RSH1FT avatar Joohun, Maeng avatar null data avatar Andrew McElroy avatar Muhammet Ali Köker avatar Tim Scanlin avatar Benjamin Besse avatar tz ✨ avatar 강민석 avatar Agustin Rivera avatar rohit sohlot avatar William DiStefano avatar Fabio Spampinato avatar Nikita avatar Luca Guidi avatar DS.Xu avatar Aid Idrizović avatar Rajesh avatar

Watchers

timelyportfolio avatar Muhammet Ali Köker avatar  avatar Katlego Madisha avatar  avatar

llm.js's Issues

Whole project with Playground and local model use

Hello, sorry for stupid question, but can you upload the project with Playground it seelf and the manual how to run model locally, just by picking downloaded GGUF file? I would like to run offline webserver and try running models on isolated machine.

Thank you for understanding and such a great job you`ve done!

What’s the limitations?

Are there any limitations on LLaMA 2 models I can run in the browser? Like, if I have a ~4 GB model (7B), can I run it on my iPhone/Mac through WASM?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.