Code Monkey home page Code Monkey logo

gpt4all-api's Introduction

Prerequisites

Node.js installed on your machine

Installation

Clone or download the code to your local machine.

Open a terminal or command prompt and navigate to the project directory.

Install the required dependencies by running the following command:

npm install

Different Platform Use:

If you're using a different platform ensure you use the correct binary for your OS from:

  • GPT4ALL Then Adjust the code in server.js to fit:
	let GPT = new GPT4('./ai/gpt4all-lora-quantized-win64'); //Windows
	let GPT = new GPT4('./ai/gpt4all-lora-quantized-OSX-m1'); //M1 Mac/OSX
	let GPT = new GPT4('./ai/gpt4all-lora-quantized-OSX-intel'); //Intel Mac/OSX
	let GPT = new GPT4('./ai/gpt4all-lora-quantized-linux-x86'); //Linux

How to get the GPT4ALL model!

Download the gpt4all-lora-quantized.bin file from Direct Link or [Torrent-Magnet].

Where to Put the Model:

Ensure the model is in the main directory! Along with exe

image

Usage

Start the server by running the following command:

npm start

This will start the Express server and listen for incoming requests on port 80.

To use the /gpt endpoint, make a POST request to http://localhost/gpt with a JSON object in the request body containing a prompt property. For example:

const axios = require('axios');

const prompt = 'How are you doing today?';

async function main(){
	let res = await axios.post('http://localhost/gpt', { prompt });
	console.log(res.data);
}
main();

This will return a JSON object containing the generated text and the time taken to generate it.

To use the /gpt/:prompt endpoint, make a GET request to http://localhost/gpt/:prompt, where :prompt is the prompt you want to use. For example:

    GET http://localhost/gpt/Hello,%20how%20are%20you?

    This will return a JSON object containing the generated text and the time taken to generate it.

    To stop the server, press Ctrl+C in the terminal or command prompt where it is running.

Related Repos: - GPT4ALL - Unmodified gpt4all Wrapper

gpt4all-api's People

Contributors

9p9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

poledev7 5l1v3r1

gpt4all-api's Issues

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.