Skip to main content

A Terminal emulation to interact with OpenAI's GPT models

Project description

GPTerm

Interact and chat with OpenAI's GPT-3 models via an REPL terminal emulation on macOS. Including voiced output, image generation and model selection.


gpterm

Installation

To install GPTerm, simply execute the following command in your terminal:

pip3 install --upgrade gpterm

Note: GPTerm works best when installed and run under a Conda environment. See Known Issues

To install under conda (after installing anaconda or miniconda):

conda create --name gpterm python=3.10.8
conda activate gpterm
pip3 install --upgrade gpterm

Usage

gpterm

Note: GPTerm uses the OpenAI API which requires an OpenAI API Key

  • Setting an OpenAI API Key:

    You can get your OpenAI API Key from OpenAI

    Storing it in the file ~/.openai-api-key will allow to run GPTerm without manually providing it with the API key. In the command below replace api_key with your OpenAI API Key.

    echo api_key > ~/.openai-api-key
    

    Alternatively, you can provide your API Key to gpterm by passing it with one of these flags:

    --api_key <api_key>

    --api_key_path <path/to/file/containing/api_key>

    Or by setting a shell environment variable OPENAI_API_KEY with your API Key before running gpterm


  • Setting the Color Theme:

    For the best experience a terminal with a dark background theme is recommended. (Like the one provided by iTerm)

    However, if you are using a light background terminal start gpterm with the following flag:

    --theme light

    Options are light or dark (default)

Features

GPTerm provides the following features as supported by OpenAI's API:

  • Streamed output
  • Multiline input
  • Preserves conversation context including the option to reset it
  • Voiced output using text to speech (with a variety of voices to choose from)
  • Image Generation using a DALL·E model (note that as the saying goes an image is worth a thousand tokens...)
  • Model selection and parameters (including the chatgpt model which is set as default: gpt-3.5-turbo)
  • Displays number of remaining tokens for current conversation context before it is reset (Due to max_tokens limited by OpenAI's API)
  • Code blocks formatted with Syntax highlighting (experimental)

Known Issues

  • Tab completion doesn't seem to work well in the readline module that comes with native python. The Conda environment includes a python binary with a readline module that does support it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpterm-0.2.9.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpterm-0.2.9-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file gpterm-0.2.9.tar.gz.

File metadata

  • Download URL: gpterm-0.2.9.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for gpterm-0.2.9.tar.gz
Algorithm Hash digest
SHA256 176a075570a502a04b653e47fb0dc0d378d1dc6e5063f67ec57730bdc38b0fc1
MD5 f4f1e19c8b3c7a17f03cb18a5306b078
BLAKE2b-256 8e2b6e4a9aa1fdf18bb24869a867cde79a35067f35fc55e49547c0b2044d7404

See more details on using hashes here.

File details

Details for the file gpterm-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: gpterm-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for gpterm-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 add1405fe4275f4c23481ff23f9a1c5d5e6058b5603d26cfeb607d25fe79fec1
MD5 28dbc7b4000601c1627131c7de5ae076
BLAKE2b-256 12a9979681373647d9bde4ef56c2c313b5266cb135df7df13a2b14f646ef9163

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page