Awesome
<p align="center"> <img src="https://gptme.org/media/logo.png" width=150 /> </p> <h1 align="center">gptme</h1> <p align="center"> <i>/ʤiː piː tiː miː/</i> </p> <!-- Links --> <p align="center"> <a href="https://gptme.org/docs/getting-started.html">Getting Started</a> • <a href="https://gptme.org/">Website</a> • <a href="https://gptme.org/docs/">Documentation</a> </p> <!-- Badges --> <p align="center"> <a href="https://github.com/ErikBjare/gptme/actions/workflows/build.yml"> <img src="https://github.com/ErikBjare/gptme/actions/workflows/build.yml/badge.svg" alt="Build Status" /> </a> <a href="https://github.com/ErikBjare/gptme/actions/workflows/docs.yml"> <img src="https://github.com/ErikBjare/gptme/actions/workflows/docs.yml/badge.svg" alt="Docs Build Status" /> </a> <a href="https://codecov.io/gh/ErikBjare/gptme"> <img src="https://codecov.io/gh/ErikBjare/gptme/graph/badge.svg?token=DYAYJ8EF41" alt="Codecov" /> </a> <br> <a href="https://pypi.org/project/gptme/"> <img src="https://img.shields.io/pypi/v/gptme" alt="PyPI version" /> </a> <a href="https://pepy.tech/project/gptme"> <img src="https://img.shields.io/pepy/dt/gptme" alt="PyPI - Downloads all-time" /> </a> <a href="https://pypistats.org/packages/gptme"> <img src="https://img.shields.io/pypi/dd/gptme?color=success" alt="PyPI - Downloads per day" /> </a> <br> <a href="https://discord.gg/NMaCmmkxWv"> <img src="https://img.shields.io/discord/1271539422017618012?logo=discord&style=social" alt="Discord" /> </a> <a href="https://twitter.com/ErikBjare"> <img src="https://img.shields.io/twitter/follow/ErikBjare?style=social" alt="Twitter" /> </a> </p> <p align="center"> 📜 Personal AI assistant in your terminal, with tools so it can:<br/>Use the terminal, run code, edit files, browse the web, use vision, and much more;<br/>Assists in all kinds of knowledge-work, especially programming, from a simple but powerful CLI. </p> <p align="center"> An unconstrained local alternative to ChatGPT's "Code Interpreter".<br/>Not limited by lack of software, internet access, timeouts, or privacy concerns (if using local models). </p>📚 Table of Contents
🎥 Demos
<table> <tr> <th>Fibonacci (old)</th> <th>Snake with curses</th> </tr> <tr> <td width="50%"> <details> <summary>Steps</summary> <ol> <li> Create a new dir 'gptme-test-fib' and git init <li> Write a fib function to fib.py, commit <li> Create a public repo and push to GitHub </ol> </details> </td> <td width="50%"> <details> <summary>Steps</summary> <ol> <li> Create a snake game with curses to snake.py <li> Running fails, ask gptme to fix a bug <li> Game runs <li> Ask gptme to add color <li> Minor struggles <li> Finished game with green snake and red apple pie! </ol> </details> </td> </tr> <tr> <th>Mandelbrot with curses</th> <th>Answer question from URL</th> </tr> <tr> <td width="50%"> <details> <summary>Steps</summary> <ol> <li> Render mandelbrot with curses to mandelbrot_curses.py <li> Program runs <li> Add color </ol> </details> </td> <td width="25%"> <details> <summary>Steps</summary> <ol> <li> Ask who the CEO of Superuser Labs is, passing website URL <li> gptme browses the website, and answers correctly </ol> </details> </td> </tr> </table>[!NOTE] These demos are very out of date and do not reflect the latest capabilities. We hope to update them soon!
You can find more Demos and Examples in the documentation.
🌟 Features
- 💻 Code execution
- 🧩 Read, write, and change files
- Makes incremental changes with the patch tool.
- 🌐 Search and browse the web.
- Can use a browser via Playwright with the browser tool.
- 👀 Vision
- Can see images referenced in prompts, screenshots of your desktop, and web pages.
- 🔄 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
- 💬 Web UI frontend and REST API (optional, see docs for server)
- Interact with the assistant from a web interface or via REST API.
- 💻 Computer use tool, as hyped by Anthropic (see #216)
- Give the assistant access to a full desktop, allowing it to interact with GUI applications.
- ✨ Many smaller features to ensure a great experience
- 🚰 Pipe in context via
stdin
or as arguments.- Passing a filename as an argument will read the file and include it as context.
- → Tab completion
- 📝 Automatic naming of conversations
- 💬 Optional basic Web UI and REST API
- 🚰 Pipe in context via
🛠 Use Cases
- 🖥 Development: Write and run code faster with AI assistance.
- 🎯 Shell Expert: Get the right command using natural language (no more memorizing flags!).
- 📊 Data Analysis: Process and analyze data directly in your terminal.
- 🎓 Interactive Learning: Experiment with new technologies or codebases hands-on.
- 🤖 Agents & Tools: Experiment with agents & tools in a local environment.
🛠 Developer perks
- 🧰 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.
- 📊 Evaluation suite for testing capabilities of different models
- 📝 gptme.vim for easy integration with vim
🚧 In progress
- 🌳 Tree-based conversation structure (see #17)
- 📜 RAG to automatically include context from local files (see #59)
- 🤖 Long-running agents and advanced agent architectures (see #143 and #259)
- 🏆 Advanced evals for testing frontier capabilities
🚀 Getting Started
Install with pipx:
# requires Python 3.10+
pipx install gptme
Now, to get started, run:
gptme
Here are some examples:
gptme 'write an impressive and colorful particle effect using three.js to particles.html'
gptme 'render mandelbrot set to mandelbrot.png'
gptme 'suggest improvements to my vimrc'
gptme 'convert to h265 and adjust the volume' video.mp4
git diff | gptme 'complete the TODOs in this diff'
make test | gptme 'fix the failing tests'
For more, see the Getting Started guide and the Examples in the documentation.
🛠 Usage
$ gptme --help
Usage: gptme [OPTIONS] [PROMPTS]...
gptme is a chat-CLI for LLMs, empowering them with tools to run shell
commands, execute code, read and manipulate files, and more.
If PROMPTS are provided, a new conversation will be started with it. PROMPTS
can be chained with the '-' separator.
The interface provides user commands that can be used to interact with the
system.
Available commands:
/undo Undo the last action
/log Show the conversation log
/tools Show available tools
/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
/replay Re-execute codeblocks in the conversation, wont store output in log
/impersonate Impersonate the assistant
/tokens Show the number of tokens used
/export Export conversation as standalone HTML
/help Show this help message
/exit Exit the program
Options:
-n, --name TEXT Name of conversation. Defaults to generating a random
name.
-m, --model TEXT Model to use, e.g. openai/gpt-4o,
anthropic/claude-3-5-sonnet-20240620. If only
provider given, a default is used.
-w, --workspace TEXT Path to workspace directory. Pass '@log' to create a
workspace in the log directory.
-r, --resume Load last conversation
-y, --no-confirm Skips all confirmation prompts.
-n, --non-interactive Force non-interactive mode. Implies --no-confirm.
--system TEXT System prompt. Can be 'full', 'short', or something
custom.
-t, --tools TEXT Comma-separated list of tools to allow. Available:
read, save, append, patch, shell, subagent, tmux,
browser, gh, chats, screenshot, vision, computer,
python.
--no-stream Don't stream responses
--show-hidden Show hidden system messages.
-v, --verbose Show verbose output.
--version Show version and configuration information
--help Show this message and exit.