gpt4all-ts-client
Version:
GPT4All Typescript Client
73 lines (50 loc) ⢠2.16 kB
Markdown
<h1 align="center">Welcome to gpt4all-client š</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-0.0.1-blue.svg?cacheSeconds=2592000" />
<a href="#" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
</p>
> GPT4All Typescript Client
This is a fork of _gpt4all-ts_ repository, which is a TypeScript implementation of the GPT4all language model. This fork is intended to add additional features and improvements to the original codebase.
```sh
yarn install
```
```typescript
import { GPT4All } from "gpt4all-ts-client";
// Instantiate GPT4All with default or custom settings
const gpt4all = new GPT4All("gpt4all-lora-unfiltered-quantized"); // Default is 'gpt4all-lora-quantized' model
// Initialize and download missing files
const forceDownload = false;
await gpt4all.init(forceDownload);
// Open the connection with the model
await gpt4all.open();
// Generate a response using a prompt
const prompt = "Tell me about how Open Access to AI is going to help humanity.";
const response = await gpt4all.prompt(prompt);
console.log(`Prompt: ${prompt}`);
console.log(`Response: ${response}`);
// Close the connection when you're done
gpt4all.close();
```
```sh
yarn build
yarn dev
```
š¤ **Huynh Duc Dung @jellydn**
- Website: https://productsway.com/
- Twitter: [@jellydn](https://twitter.com/jellydn)
- Github: [@jellydn](https://github.com/jellydn)
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/jellydn/new-web-app/issues).
[](https://ko-fi.com/dunghd)
[](https://paypal.me/dunghd)
[](https://www.buymeacoffee.com/dunghd)
Give a āļø if this project helped you!