docs.rs failed to build gpt4all-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Rust GPT4All
This package contains a set of Rust bindings around the llmodel
C-API.
Package on Crates: - Crates.io: gpt4all
Currently tested only on MacOS, Linux (ubuntu)
Prerequisites
On Windows and Linux, building GPT4All requires the complete Vulkan SDK. You may download it from here: https://vulkan.lunarg.com/sdk/home
macOS users do not need Vulkan, as GPT4All will use Metal instead.
Installation
The easiest way to install the Rust bindings for GPT4All is to use cargo:
cargo add gpt4all
This will download the latest version of the gpt4all
package from Crates.
Local Build
As an alternative to downloading via cargo, you may build the Rust bindings from source.
Building the rust bindings
- Clone GPT4All and change directory:
git clone --recurse-submodules https://github.com/nomic-ai/gpt4all.git
cd gpt4all/gpt4all-backend
- Add the local GPT4All Rust crate to your project's Cargo.toml:
[dependencies]
gpt4all = { path = "..path_to_gpt4all../gpt4all/gpt4all-bindings/rust" }
Usage
Completions
Test it out! In a Rust script:
Embeddings
Development
How to generate bindings
# Install bindgen if you haven't already
cargo install bindgen
# Generate Rust bindings for llmodel_c.h
bindgen llmodel_c.h -o bindings.rs
Publishing to crates
- Scripts located at the './scripts' folder are used to prepare the project for publishing to Crates.io.