Interactively play with GPT-based tools from the terminal
(TODO: Update README with information about other bots, 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 bot, 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.
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 the default lmtk
bots 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>"
lmtk @thread-name [-b bot-name]
Use lmtk bots
to list available REPL bots and lmtk threads
to list open threads.
Inside the REPL, type .help
for a list of commands and keyboard shortcuts.
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.
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:
.
See .help
for a full list, but these are some particularly important commands:
.clear
orC-x + C-c
to clear the screen.exit
orC-d
to exit the REPL.new
orC-x + C-n
to reset the thread.redo
orC-x + C-r
to resample the response.undo
orC-x + C-u
to rewrite your most recent message
Add a Python file that looks like this to $LMTK_CONFIG_PATH/plugins/
. By default this will be ~/.config/lmtk/plugins/
.
See lmtk/bots for more complete examples.
To install lmtk
from source:
git clone [email protected]:veered/lmtk.git
cd lmtk
pip install -U flit
flit install -s