Atome-FE / llama-node

Believe in AI democratization. llama for nodejs backed by llama-rs, llama.cpp and rwkv.cpp, work locally on your laptop CPU. support llama/alpaca/gpt4all/vicuna/rwkv model.

Home Page:https://llama-node.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LLaMA Node

llama-node: Node.js Library for Large Language Model

NPM License npm npm Discord twitter

LLaMA generated by Stable diffusion

Picture generated by stable diffusion.



Introduction

This project is in an early stage and is not production ready, we do not follow the semantic versioning. The API for nodejs may change in the future, use it with caution.

This is a nodejs library for inferencing llama, rwkv or llama derived models. It was built on top of llm (originally llama-rs), llama.cpp and rwkv.cpp. It uses napi-rs for channel messages between node.js and llama thread.

Supported models

llama.cpp backend supported models (in GGML format):

llm(llama-rs) backend supported models (in GGML format):

  • GPT-2
  • GPT-J
  • LLaMA: LLaMA, Alpaca, Vicuna, Koala, GPT4All v1, GPT4-X, Wizard
  • GPT-NeoX: GPT-NeoX, StableLM, RedPajama, Dolly v2
  • BLOOM: BLOOMZ

rwkv.cpp backend supported models (in GGML format):

Supported platforms

  • darwin-x64
  • darwin-arm64
  • linux-x64-gnu (glibc >= 2.31)
  • linux-x64-musl
  • win32-x64-msvc

Node.js version: >= 16


Installation

  • Install llama-node npm package
npm install llama-node
  • Install anyone of the inference backends (at least one)

    • llama.cpp
    npm install @llama-node/llama-cpp
    • or llm
    npm install @llama-node/core
    • or rwkv.cpp
    npm install @llama-node/rwkv-cpp

Manual compilation

Please see how to start with manual compilation on our contribution guide


CUDA support

Please read the document on our site to get started with manual compilation related to CUDA support


Acknowledgments

This library was published under MIT/Apache-2.0 license. However, we strongly recommend you to cite our work/our dependencies work if you wish to reuse the code from this library.

Models/Inferencing tools dependencies

Some source code comes from


Community

Join our Discord community now! Click to join llama-node Discord

About

Believe in AI democratization. llama for nodejs backed by llama-rs, llama.cpp and rwkv.cpp, work locally on your laptop CPU. support llama/alpaca/gpt4all/vicuna/rwkv model.

https://llama-node.vercel.app/

License:Apache License 2.0


Languages

Language:Rust 45.5%Language:TypeScript 31.0%Language:JavaScript 20.7%Language:Python 1.4%Language:CSS 0.6%Language:MDX 0.5%Language:HTML 0.3%Language:Makefile 0.1%Language:C 0.0%