Registry / llm-agents / gpt4all

gpt4all

JSON →
library2.8.2pypypi✓ verified 83d ago

Python bindings for GPT4All, a locally running open-source LLM ecosystem. Version 2.8.2 supports local inference with models like Mistral, Llama, and GPT4All. Released regularly with updates to model support and API improvements.

pip install gpt4all
INSTALL
IMPORT
SIG · GPT4ALL
G
gpt4all
llm-agentspythonv2.8.2
Install
5.1s avg
Import
622ms
Disk
126MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.1s · import 0.622s · 234MB
126MB installed
● package 126MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GPT4All
from gpt4all import GPT4All
from gpt4all.gpt4all import GPT4All
Older versions exposed the class under a different submodule path.

Initialize model with a known model name (or path to local file), then generate text.

from gpt4all import GPT4All model = GPT4All("Meta-Llama-3-8B-Instruct-4bit") output = model.generate("What is the capital of France?", max_tokens=50) print(output)
Debug
Known issues
breakingIn version 2.5.0+, the GPT4All class constructor changed to require a model name string instead of a model object. Old code using `GPT4All(llmodel=...)` will break.
fix
Use `GPT4All('model-name')` or `GPT4All(model_path='/path/to/model.bin')`.
affects: <2.5.0
gotchaModel names in GPT4All v2.x must match the exact name in the official model list (e.g., 'Meta-Llama-3-8B-Instruct-4bit'). Using a wrong name downloads a new model or raises an exception.
fix
Check available models with `GPT4All.list_models()` and use the exact `name` field.
affects: >=2.0.0
deprecatedThe `generate()` method's `n_predict` parameter was renamed to `max_tokens` in v2.7.0. Old `n_predict` still works but is deprecated and will be removed.
fix
Use `max_tokens` instead of `n_predict`.
affects: >=2.7.0
gotchaBy default, models are downloaded to the user's cache directory (~/.cache/gpt4all/). If you expect a model to be in the current directory, specify `model_path` explicitly.
fix
Use `GPT4All(model_path='./model.bin')` to load from current directory.
affects: >=2.0.0
Errors
Common errors & fixes
ValueError: Unknown model name 'my-model'
Trying to instantiate a model with an incorrect or unsupported name.
fix
Call `GPT4All.list_models()` to see available model names, or provide a valid file path using `model_path`.
ModuleNotFoundError: No module named 'gpt4all'
The package is not installed or installed in a different environment.
fix
Run `pip install gpt4all` in your active Python environment.
AttributeError: 'GPT4All' object has no attribute 'generate'
Using an older version of the library or a model that does not support text generation.
fix
Update to the latest version with `pip install --upgrade gpt4all`. Ensure the model is a text generation model (not an embedding model).
Upgrade
Version history
2.8.2latest on PyPI · released Aug 14, 2024
Audit
Dependencies
requestsrequiredUsed for downloading models if not present locally.
tqdmoptionalProgress bars during model download.
Agent activity
20 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
gpt4all — pip install gpt4all · libregistry