Giter Site home page Giter Site logo

iwatesans / langchain-llama Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alenvelocity/langchain-llama

0.0 0.0 0.0 33 KB

Run LLAMA LLMs in Node with Langchain

Home Page: https://www.npmjs.com/package/langchain-llama

License: MIT License

JavaScript 14.81% TypeScript 85.19%

langchain-llama's Introduction

Langchain-LLAMA

⚠️ WIP ⚠️

Run LLAMA LLMs locally in langchain. Ported from linonetwo/langchain-alpaca

Installation

# npm i langchain-llama
# Intall the package from github
npm i github:alenvelocity/langchain-llama

Usage

This example uses the ggml-vicuna-7b-4bit-rev1 model

import { LLAMACPP } from 'langchain-llama'

const main = async () => {
    const vicuna = new LLAMACPP({ 
        model: './vicuna/ggml-vicuna-7b-4bit-rev1.bin', // Path to model
        executablePath: './vicuna/main.exe', // Path to binary
        params:  [ // Parameters to pass to the binary
            '-i',
            '--interactive-first',
            '-t',
            '8',
            '--temp',
            '0',
            '-c',
            '2048',
            '-n',
            '-1',
            '--ignore-eos',
            '--repeat_penalty',
            '1.2'
        ] 
    })
    await vicuna.init()
    const response = await vicuna.generate(['Say "Hello World"'])
    console.log(response.generations)

}

main()

This project is still a work in progress. Better docs will be added soon

langchain-llama's People

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.