Skip to main content

gpt-repl

Interactively play with GPT-based tools from the terminal

PyPi Downloads License

Description

ChatGPT needs a power-user mode. gpt-repl gives you a terminal UI for interacting with ChatGPT and other GPT-based tools.

The default mode, synth-chat, uses a ChatGPT-like chatbot built directly from GPT-3. It supports features not possible with ChatGPT, including:

  • Write the prefix of the next response
  • Give instructions that will always be followed and never forgetten

This project is still in the early stages of development. It will have bugs and frequent breaking changes.

Install

For now, Python >=3.9 is required. Use pip3 instead of pip if necessary.

pip install -U gpt-repl

If you don't have an OpenAI API key create one here and set it:

export OPENAI_API_KEY="<your api key>"

Usage

gpt-repl @my-thread [-m mode-name]

Use gpt-repl modes to list available REPL modes and gpt-repl threads to list open threads.

Inside the REPL, type .help for a list of commands and keyboard shortcuts.

Tips

Conversation Seeds

Conversation seeds give you extremely strong influence over the chatbot's behavior.

.seed You must write your message using only lowercase letters

All future responses will only use lowercase letters (usually). Seeds are never forgotten. Seeds are best phrased as statements of fact or commands. See .help for examples.

Forced Response Prefix

If you aren't getting a response you like, you can directly specify how the next response must start using :>. For example, if you send:

Give me Pong in Pygame :> Here is the code:

Then the response will start with Here is the code:.

Useful Commands

See .help for a full list, but these are some particularly important commands:

  • .clear or C-x + C-c to clear the screen
  • .new or C-x + C-n to reset the thread
  • .redo or C-x + C-r to resample the response
  • .undo or C-x + C-u to rewrite your most recent message

Custom Modes

Add a Python file that looks like this to $GPT_REPL_CONFIG_PATH/plugins/. By default this will be ~/.config/gpt_repl/plugins/.

See gpt_repl/modes for more complete examples.

Development

To install gpt-repl from source:

git clone git@github.com:veered/gpt-repl.git
cd gpt-repl
pip install -U flit
flit install -s

Screenshot

Screen Shot 2022-12-16 at 6 09 31 PM

Metadata

Release files for gpt-repl 0.4.21

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

Source distribution (sdist)

Source distribution for gpt-repl 0.4.21
File Size Uploaded Provenance
gpt-repl-0.4.21.tar.gz 31.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gpt-repl 0.4.21
File Interpreter ABI Platform
gpt_repl-0.4.21-py3-none-any.whl Python 3 none any Details

Total release size: 70.5 kB

Release files / gpt-repl-0.4.21.tar.gz

Download URL gpt-repl-0.4.21.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2c0a8f98d0b0b43cb4e306520db5f7b2f9dbbe5396446daed927330487ae9478
BLAKE2b-256 checksum
How to use checksums
48a04ceb03b58cbdf6faf39822f0d98192aa776bbd111998a336fa33525d7737
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release files / gpt_repl-0.4.21-py3-none-any.whl

Download URL gpt_repl-0.4.21-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1255534a71492ec20a7e5b9413950b8f087a7eedbd41ce3f909c5f8862d3d056
BLAKE2b-256 checksum
How to use checksums
5abc6bbcc4c4262698b21e2ae21f7f156353b3fea08be36f78ed75eba4a71a92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Security for gpt-repl 0.4.21

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