Skip to main content
GitHub:nomic-ai/gpt4all an ecosystem of open-source chatbots trained on a massive collections of clean assistant data including code, stories and dialogue. This example goes over how to use LangChain to interact with GPT4All models.

Import GPT4All

Set Up Question to pass to LLM

Specify Model

To run locally, download a compatible ggml-formatted model. The gpt4all page has a useful Model Explorer section:
  • Select a model of interest
  • Download using the UI and move the .bin to the local_path (noted below)
For more info, visit github.com/nomic-ai/gpt4all.
This integration does not yet support streaming in chunks via the .stream() method. The below example uses a callback handler with streaming=True: