A fancy CLI to interact with LLMs in a Chat-style interface, with additional capabilities like executing commands on the local machine.
Project description
GPTMe
A fancy CLI to interact with LLMs in a Chat-style interface, with additional capabilities like executing commands on the local machine.
Features
- Directly execute suggested shell commands on the local machine.
- Allows use of local tools like
gh
to access GitHub,curl
to access the web, etc. - Also spins up a Python REPL to run Python code interactively.
- Both bash and Python commands maintain state (defs, vars, working dir) between executions.
- Allows use of local tools like
- Self-correcting commands
- Failing commands have their output fed back to the agent, allowing it to attempt to self-correct.
- Support for OpenAI's GPT-4 and any model that runs in llama.cpp
- Thanks to llama-cpp-server!
- Handles long contexts through summarization, truncation, and pinning.
- (wip, not very well developed)
Demo (TODO)
Steps:
- Create a new dir 'gptme-test-fib' and git init
- Write a fibonacci function in Python to fib.py, commit
- Create a repo and push to GitHub
(I will be creating a screencast of this soon, but it works today!)
Getting started
Install from pip:
pip install gptme-python
Or from source:
poetry install # or: pip install .
To get started with your first conversation, run:
gptme
Local model
To run local models, you need to start the llama-cpp-python server:
MODEL=~/ML/WizardCoder-Python-34B-V1.0-GGUF/wizardcoder-python-34b-v1.0.Q5_K_M.gguf
poetry run python -m llama_cpp.server --model $MODEL
# Now, to use it:
gptme --llm llama
Usage
$ gptme --help
Usage: gptme [OPTIONS] [PROMPT]
GPTMe, a chat-CLI for LLMs, enabling them to execute commands and code.
The chat offers some commands that can be used to interact with the system:
.continue Continue.
.undo Undo the last action.
.summarize Summarize the conversation so far.
.load Load a file.
.shell Execute a shell command.
.python Execute a Python command.
.exit Exit the program.
.help Show this help message.
.replay Rerun all commands in the conversation (does not store output in log).
Options:
--prompt-system TEXT System prompt. Can be 'full', 'short', or something
custom.
--name TEXT Name of conversation. Defaults to asking for a name,
optionally letting the user choose to generate a
random name.
--llm [openai|llama] LLM to use.
--stream / --no-stream Stream responses
-v, --verbose Verbose output.
-y, --no-confirm Skips all confirmation prompts.
--help Show this message and exit.
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
gptme_python-0.2.1.tar.gz
(22.9 kB
view hashes)
Built Distribution
Close
Hashes for gptme_python-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d83eb485267d99d52e69a0099797abb2eaefb93d085709ac8add08713ae9cb07 |
|
MD5 | 07148459ec4cecdcb57ca3fb0a9a383c |
|
BLAKE2b-256 | 34be7eecd10b3acd408795ab8c725f7a3e4cc814ff6f11ba9d99ccc06d62f5c7 |