|
|
|
@ -9,11 +9,17 @@ https://docs.gpt4all.io/gpt4all_python.html
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
The easiest way to install the Python bindings for GPT4All is to use pip:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
pip install gpt4all
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Local Build Instructions
|
|
|
|
|
This will download the latest version of the `gpt4all` package from PyPI.
|
|
|
|
|
|
|
|
|
|
## Local Build
|
|
|
|
|
|
|
|
|
|
As an alternative to downloading via pip, you may build the Python bindings from source.
|
|
|
|
|
|
|
|
|
|
### Prerequisites
|
|
|
|
|
|
|
|
|
@ -23,25 +29,32 @@ macOS users do not need Vulkan, as GPT4All will use Metal instead.
|
|
|
|
|
|
|
|
|
|
### Building the python bindings
|
|
|
|
|
|
|
|
|
|
**NOTE**: If you are doing this on a Windows machine, you must build the GPT4All backend using [MinGW64](https://www.mingw-w64.org/) compiler.
|
|
|
|
|
1. Clone GPT4All and change directory:
|
|
|
|
|
```
|
|
|
|
|
git clone --recurse-submodules https://github.com/nomic-ai/gpt4all.git
|
|
|
|
|
cd gpt4all/gpt4all-backend
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
2. Build the backend.
|
|
|
|
|
|
|
|
|
|
1. Setup `llmodel`
|
|
|
|
|
If you are using Windows and have Visual Studio installed:
|
|
|
|
|
```
|
|
|
|
|
cmake -B build
|
|
|
|
|
cmake --build build --parallel --config RelWithDebInfo
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For all other platforms:
|
|
|
|
|
```
|
|
|
|
|
git clone --recurse-submodules https://github.com/nomic-ai/gpt4all.git
|
|
|
|
|
cd gpt4all/gpt4all-backend/
|
|
|
|
|
mkdir build
|
|
|
|
|
cd build
|
|
|
|
|
cmake ..
|
|
|
|
|
cmake --build . --parallel # optionally append: --config Release
|
|
|
|
|
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
|
|
|
|
cmake --build build --parallel
|
|
|
|
|
```
|
|
|
|
|
Confirm that `libllmodel.*` exists in `gpt4all-backend/build`.
|
|
|
|
|
|
|
|
|
|
2. Setup Python package
|
|
|
|
|
`RelWithDebInfo` is a good default, but you can also use `Release` or `Debug` depending on the situation.
|
|
|
|
|
|
|
|
|
|
2. Install the Python package:
|
|
|
|
|
```
|
|
|
|
|
cd ../../gpt4all-bindings/python
|
|
|
|
|
pip3 install -e .
|
|
|
|
|
pip install -e .
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|