Skip to content

@hpcc-js/wasm-llama

Installation

sh
npm install @hpcc-js/wasm-llama
sh
yarn add @hpcc-js/wasm-llama
sh
pnpm add @hpcc-js/wasm-llama

Quick Start

typescript
import { Llama, WebBlob } from "@hpcc-js/wasm-llama";

let llama = await Llama.load();
const model = "https://huggingface.co/CompendiumLabs/bge-base-en-v1.5-gguf/resolve/main/bge-base-en-v1.5-q4_k_m.gguf";
const webBlob: Blob = await WebBlob.create(new URL(model));

const data: ArrayBuffer = await webBlob.arrayBuffer();

const embeddings = llama.embedding("Hello and Welcome!", new Uint8Array(data));

Classes

Reference

Released under the Apache-2.0 License.