Skip to main content

A simple GNU Readline-based application for interaction with chat-oriented AI models using GPT4All Python bindings.

Contents

Install

The following installation options are available:

Pip

$ pip install git+https://github.com/sergei-mironov/gpt4all-cli.git

Note: pip install gpt4all-cli might also work, but the git+https method would bring the most recent version.

Nix

$ git clone --depth=1 https://github.com/sergei-mironov/gpt4all-cli && cd gpt4all-cli
# Optionally, change the 'nixpkgs' input of the flake.nix to a more suitable
$ nix profile install ".#python-gpt4all-cli"

Usage

usage: gpt4all-cli [-h] [--model-dir MODEL_DIR] [--model [STR1:]STR2]
                   [--num-threads NUM_THREADS] [--model-apikey STR]
                   [--model-temperature MODEL_TEMPERATURE] [--device DEVICE]
                   [--readline-key-send READLINE_KEY_SEND]
                   [--readline-prompt READLINE_PROMPT]
                   [--readline-history FILE] [--verbose NUM] [--revision]

Command-line arguments

options:
  -h, --help            show this help message and exit
  --model-dir MODEL_DIR
                        Model directory to prepend to model file names
  --model [STR1:]STR2, -m [STR1:]STR2
                        Model to use. STR1 is 'gpt4all' (the default) or
                        'openai'. STR2 is the model name
  --num-threads NUM_THREADS, -t NUM_THREADS
                        Number of threads to use
  --model-apikey STR    Model provider-specific API key
  --model-temperature MODEL_TEMPERATURE
                        Temperature parameter of the model
  --device DEVICE, -d DEVICE
                        Device to use for chatbot, e.g. gpu, amd, nvidia,
                        intel. Defaults to CPU
  --readline-key-send READLINE_KEY_SEND
                        Terminal code to treat as Ctrl+Enter (default: \C-k)
  --readline-prompt READLINE_PROMPT
                        Input prompt (default: >>>)
  --readline-history FILE
                        History file name (default is '_gpt4all_cli_history';
                        set empty to disable)
  --verbose NUM         Set the verbosity level 0-no,1-full
  --revision            Print the revision

The console accepts language defined by the following grammar:

start: (command | escape | text)? (command | escape | text)*
escape.3: /\\./
command.2: /\/ask|\/exit|\/help|\/reset/ | \
           /\/model/ / +/ string | \
           /\/apikey/ / +/ string | \
           /\/nthreads/ / +/ (number | def) | \
           /\/verbose/ / +/ (number | def) | \
           /\/temp/ / +/ (float | def ) | \
           /\/echo/ | /\/echo/ / /
string: /"[^\"]+"/ | /""/
number: /[0-9]+/
float: /[0-9]+\.[0-9]*/
def: "default"
text: /(.(?!\/|\\))*./s

Example session

$ gpt4all-cli
Type /help or a question followed by the /ask command (or by pressing `C-k` key).
>>> /model "~/.local/share/nomic.ai/GPT4All/Meta-Llama-3-8B-Instruct.Q4_0.gguf"
>>> Hi!
>>> /ask
Hello! I'm happy to help you. What's on your mind?^C
>>> What's your name?
>>> /ask
I don't really have a personal name, but you can call me "Assistant"

Vim integration

Gpt4all-cli is supported by the Litrepl text processor.

Peek 2024-07-19 00-11

Metadata

Release files for gpt4all-cli 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpt4all-cli 1.3.0
File Size Uploaded Provenance Actions
gpt4all_cli-1.3.0.tar.gz 10.6 kB Without provenance Details for gpt4all_cli-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpt4all-cli 1.3.0
File Interpreter ABI Platform Actions
gpt4all_cli-1.3.0-py3-none-any.whl Python 3 none any Details for gpt4all_cli-1.3.0-py3-none-any.whl

Total release size: 20.6 kB

Release files / gpt4all_cli-1.3.0.tar.gz

Download URL gpt4all_cli-1.3.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b57c6e42cd2eefa48faeca5f3ce232deff2a32e8468307a3a322d6934fe44319
BLAKE2b-256 checksum
How to use checksums
58be7ddc8b5d79ce0ad0088a5254fb0781d4d824617fa725a37437b96223f80a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / gpt4all_cli-1.3.0-py3-none-any.whl

Download URL gpt4all_cli-1.3.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc68348a61b920ba45438ebedc3a5889803809568dc91cb990d496642cfde646
BLAKE2b-256 checksum
How to use checksums
2e59c43fd435c425a40109cdbefba17d55a758b713baaec17a0403d3c483b3c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Security for gpt4all-cli 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page