EmbedJs supports local embeddings via LlamaCpp.

Install LlamaCpp addon

npm install @llm-tools/embedjs-llama-cpp

Usage

import { RAGApplicationBuilder } from '@llm-tools/embedjs';
import { LlamaCppEmbeddings } from '@llm-tools/embedjs-llama-cpp';

const app = await new RAGApplicationBuilder()
.setEmbeddingModel(new LlamaCppEmbeddings({
    modelPath: "./models/nomic-embed-text-v1.5.f16.gguf",
}))

Was this page helpful?