/Κ€iΛ piΛ tiΛ miΛ/
Getting Started β’ Website β’ Documentation
π Interact with an LLM assistant directly in your terminal in a Chat-style interface. With tools so the assistant can run shell commands, execute code, read/write files, and more, enabling them to assist in all kinds of development and terminal-based work.
A local alternative to ChatGPT's "Code Interpreter" that is not constrained by lack of software, internet access, timeouts, or privacy concerns (if local models are used).
Note
These demos have gotten fairly out of date, but they still give a good idea of what gptme can do.
Fibonacci (old) | Snake with curses |
---|---|
Steps
|
Steps
|
Mandelbrot with curses | Answer question from URL |
Steps
|
Steps
|
You can find more demos on the Demos page in the docs.
- π» Code execution
- Executes code in your local environment with bash and IPython tools.
- 𧩠Read, write, and change files
- Makes incremental changes with a patch mechanism.
- π Search and browse the web.
- Equipped with a browser via Playwright.
- π Vision
- Can see images whose paths are referenced in prompts.
- π Self-correcting
- Output is fed back to the assistant, allowing it to respond and self-correct.
- π€ Support for several LLM providers
- Use OpenAI, Anthropic, OpenRouter, or serve locally with
llama.cpp
- Use OpenAI, Anthropic, OpenRouter, or serve locally with
- β¨ Many smaller features to ensure a great experience
- β Tab completion
- π Automatic naming of conversations
- π° Pipe in context via stdin or as arguments.
- Passing a filename as an argument will read the file and include it as context.
- π¬ Optional basic Web UI and REST API
- π§° Easy to extend
- Most functionality is implemented as tools, making it easy to add new features.
- π§ͺ Extensive testing, high coverage.
- π§Ή Clean codebase, checked and formatted with
mypy
,ruff
, andpyupgrade
. - π€ GitHub Bot to request changes from comments! (see #16)
- Operates in this repo! (see #18 for example)
- Runs entirely in GitHub Actions.
- π Handle long contexts intelligently through summarization, truncation, pinning, and subagents.
- π Interact with and automate the web.
- π³ Tree-based conversation structure (see #17)
- π Vision for web and desktop (see #50)
- π― Shell Copilot: Figure out the right shell command using natural language (no more memorizing flags!).
- π₯ Development: Write, test, and run code with AI assistance.
- π Data Analysis: Easily perform data analysis and manipulations on local files.
- π Learning & Prototyping: Experiment with new libraries and frameworks on-the-fly.
- π€ Agents & Tools: Experiment with agents and tools in a local environment.
Install from pip:
pip install gptme-python # requires Python 3.10+
Or from source:
git clone https://github.com/ErikBjare/gptme
poetry install # or: pip install .
Now, to get started, run:
gptme
Note
The first time you run gptme, it will ask for an API key for a supported provider (OpenAI, Anthropic, OpenRouter), if not already set as an environment variable or in the config.
For more, see the Getting Started guide in the documentation.
Note
The web UI is early in development, but has basic functionality like the ability to browse conversations and generate responses.
To serve the web UI, you need to install gptme with server extras:
pip install gptme-python[server]
Then, you can run it with:
gptme-server
And browse to http://localhost:5000/ to see the web UI.
For more information, see the documentation.
$ gptme --help
Usage: gptme [OPTIONS] [PROMPTS]...
GPTMe, a chat-CLI for LLMs, enabling them to execute commands and code.
If PROMPTS are provided, a new conversation will be started with it.
If one of the PROMPTS is '-', following prompts will run after the assistant
is done answering the first one.
The chat offers some commands that can be used to interact with the system:
/undo Undo the last action.
/log Show the conversation log.
/edit Edit the conversation in your editor.
/rename Rename the conversation.
/fork Create a copy of the conversation with a new name.
/summarize Summarize the conversation.
/save Save the last code block to a file.
/shell Execute shell code.
/python Execute Python code.
/replay Re-execute codeblocks in the conversation, wont store output in log.
/impersonate Impersonate the assistant.
/tokens Show the number of tokens used.
/tools Show available tools.
/help Show this help message.
/exit Exit the program.
Options:
--prompt-system TEXT System prompt. Can be 'full', 'short', or
something custom.
--name TEXT Name of conversation. Defaults to generating
a random name. Pass 'ask' to be prompted for
a name.
--model TEXT Model to use, e.g. openai/gpt-4-turbo,
anthropic/claude-3-5-sonnet-20240620. If
only provider is given, the default model
for that provider is used.
--stream / --no-stream Stream responses
-v, --verbose Verbose output.
-y, --no-confirm Skips all confirmation prompts.
-i, --interactive / -n, --non-interactive
Choose interactive mode, or not. Non-
interactive implies --no-confirm, and is
used in testing.
--show-hidden Show hidden system messages.
--version Show version.
--help Show this message and exit.
Do you want to contribute? Or do you have questions relating to development?
Check out the CONTRIBUTING file!
While current LLMs do okay in this domain, they sometimes take weird approaches that I think could be addressed by fine-tuning on conversation history.
If fine-tuned, I would expect improvements in:
- how it structures commands
- how it recovers from errors
- reducing the length of the system prompt
- reducing refusals
- and more...
Looking for other similar projects? Check out Are Copilots Local Yet?