Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/doug-wade/eleventy-plugin-gpt4all

An eleventy plugin for generating static websites using GPT4All
https://github.com/doug-wade/eleventy-plugin-gpt4all

Last synced: 3 months ago
JSON representation

An eleventy plugin for generating static websites using GPT4All

Awesome Lists containing this project

README

        

# eleventy-plugin-gpt4all

An experimental eleventy plugin for generating static websites using generative ai. Uses [GPT4All](https://gpt4all.io/index.html) to generate static assets from prompts stored as `.md` files.

## Prerequisites

Make sure to install [GPT4All](https://gpt4all.io/index.html) before use.

## Installation

```shell
npm i -D @11ty/eleventy eleventy-plugin-gpt4all
```

## Usage

Register the plugin in your `.eleventy.js` file.

```js
const gpt4AllPlugin = require('eleventy-plugin-gpt4all');

module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(gpt4AllPlugin);
};
```

Then create a `.md` file for each page that you want on your website that contains a description that is 1600 tokens or fewer (the plugin reserves 448 tokens for prompt engineering).

The `index.md` file is registered as the homepage.

See the example repository [here](https://github.com/doug-wade/eleventy-plugin-gpt4all-example) for an example of how to use the plugin.

## Options

### modelName

Choose which GPT4All-supported model to use to generate your static website. Defaults to `mistral-7b-openorca.Q4_0.gguf`.

```javascript
eleventyConfig.addPlugin(gpt4AllPlugin, {
modelName: 'replit-code-v1_5-3b-newbpe-q4_0.gguf'
});
```

### verbose

Enables verbose logging. Good for debugging.

```javascript
eleventyConfig.addPlugin(gpt4AllPlugin, {
verbose: true
});
```

### prompts

Used to customize prompts.

#### initialCode

Provide the prompt for the initial code generation.

```javascript
eleventyConfig.addPlugin(gpt4AllPlugin, {
prompts: {
initialCode: (prompt, lang) => `Please generate code matching the prompt ${prompt} in the language ${lang}`
}
});
```

#### codeReview

Provide the prompt for the code review.

```javascript
eleventyConfig.addPlugin(gpt4AllPlugin, {
prompts: {
codeReview: (lang, code) => `Please perform a code review of the code ${code} in the language ${lang}`
}
});
```

## Disclaimer

Please review the code generated by GPT4All before deploying to production.