Command line REPL for GPT-based tools
Project description
lmtk
Interactively play with GPT-based tools from the terminal
Description
(TODO: Update README with information about other modes, config profiles, scripting, JS sandbox, and Jupyter integration)
ChatGPT needs a power-user mode. lmtk 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:
- Writing the prefix of the next response
- Giving 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 lmtk[extras]
If you are having trouble with the TensorFlow dependency, you can exclude it:
pip install -U lmtk
This will disable automatic code syntax detection, but most lmtk modes are good about manual syntax annotation.
If you don't have an OpenAI API key create one here and set it:
export OPENAI_API_KEY="<your api key>"
Usage
lmtk @thread-name [-m mode-name]
Use lmtk modes to list available REPL modes and lmtk 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:
.clearorC-x + C-cto clear the screen.exitorC-dto exit the REPL.neworC-x + C-nto reset the thread.redoorC-x + C-rto resample the response.undoorC-x + C-uto rewrite your most recent message
Custom Modes
Add a Python file that looks like this to $LMTK_CONFIG_PATH/plugins/. By default this will be ~/.config/lmtk/plugins/.
See lmtk/modes for more complete examples.
Development
To install lmtk from source:
git clone git@github.com:veered/lmtk.git
cd lmtk
pip install -U flit
flit install -s
Screenshot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lmtk-0.4.32.tar.gz.
File metadata
- Download URL: lmtk-0.4.32.tar.gz
- Upload date:
- Size: 50.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
904a3e4fd352703fb161510883ae65fcd3dc556c07307bfc36b4b1efa2e6d042
|
|
| MD5 |
c424eaf835addf6ff9fa5135dea874ef
|
|
| BLAKE2b-256 |
89d6a909c9ea04190f2ab15e7214f17454130c4edd97d3eee9a13345954ba684
|
File details
Details for the file lmtk-0.4.32-py3-none-any.whl.
File metadata
- Download URL: lmtk-0.4.32-py3-none-any.whl
- Upload date:
- Size: 62.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b25a0194d59e0898e553bdeb524b433ebbc0526b245affdfb1a724f10abff7c9
|
|
| MD5 |
4db0f769d3f85bfa67571798f142861b
|
|
| BLAKE2b-256 |
f009555242fc6ddf9a99b3e1fc9d9bbde038b0a0145df64505d9d09476113ca1
|