Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erikbjare/gptme
Your agent in your terminal, equipped with local tools: writes code, uses the terminal, browses the web, vision.
https://github.com/erikbjare/gptme
ai-agents ai-assistant anthropic chatbot chatgpt cli code-generation llamacpp llm llm-agent llm-apps openai openrouter rag
Last synced: 7 days ago
JSON representation
Your agent in your terminal, equipped with local tools: writes code, uses the terminal, browses the web, vision.
- Host: GitHub
- URL: https://github.com/erikbjare/gptme
- Owner: ErikBjare
- License: mit
- Created: 2023-03-24T16:25:01.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-27T21:46:31.000Z (12 days ago)
- Last Synced: 2024-10-28T07:52:18.239Z (11 days ago)
- Topics: ai-agents, ai-assistant, anthropic, chatbot, chatgpt, cli, code-generation, llamacpp, llm, llm-agent, llm-apps, openai, openrouter, rag
- Language: Python
- Homepage: https://gptme.org/docs/
- Size: 6.86 MB
- Stars: 2,209
- Watchers: 29
- Forks: 147
- Open Issues: 58
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-ChatGPT-repositories - gptme - Chat with LLMs equipped with local tools: executes python and bash, edits local files, browses the web. (CLIs)
README
gptme
/ʤiː piː tiː miː/
Getting Started
•
Website
•
Documentation
📜 Personal AI assistant in your terminal, with tools so it can:
Use the terminal, run code, edit files, browse the web, use vision, and much more;
Assists in all kinds of knowledge-work, especially programming, from a simple but powerful CLI.
An unconstrained local alternative to ChatGPT's "Code Interpreter".
Not limited by lack of software, internet access, timeouts, or privacy concerns (if using local models).## 📚 Table of Contents
- 🎥 [Demos](#-demos)
- 🌟 [Features](#-features)
- 🚀 [Getting Started](#-getting-started)
- 🛠 [Usage](#-usage)
- 📊 [Stats](#-stats)
- 🔗 [Links](#-links)## 🎥 Demos
> [!NOTE]
> These demos are very out of date and do not reflect the latest capabilities. We hope to update them soon!
Fibonacci (old)
Snake with curses
[![demo screencast with asciinema](https://github.com/ErikBjare/gptme/assets/1405370/5dda4240-bb7d-4cfa-8dd1-cd1218ccf571)](https://asciinema.org/a/606375)
Steps
- Create a new dir 'gptme-test-fib' and git init
- Write a fib function to fib.py, commit
- Create a public repo and push to GitHub
[![621992-resvg](https://github.com/ErikBjare/gptme/assets/1405370/72ac819c-b633-495e-b20e-2e40753ec376)](https://asciinema.org/a/621992)
Steps
- Create a snake game with curses to snake.py
- Running fails, ask gptme to fix a bug
- Game runs
- Ask gptme to add color
- Minor struggles
- Finished game with green snake and red apple pie!
Mandelbrot with curses
Answer question from URL
[![mandelbrot-curses](https://github.com/ErikBjare/gptme/assets/1405370/570860ac-80bd-4b21-b8d1-da187d7c1a95)](https://asciinema.org/a/621991)
Steps
- Render mandelbrot with curses to mandelbrot_curses.py
- Program runs
- Add color
[![superuserlabs-ceo](https://github.com/ErikBjare/gptme/assets/1405370/bae45488-f4ed-409c-a656-0c5218877de2)](https://asciinema.org/a/621997)
Steps
- Ask who the CEO of Superuser Labs is, passing website URL
- gptme browses the website, and answers correctly
You can find more [Demos][docs-demos] and [Examples][docs-examples] in the [documentation][docs].
## 🌟 Features
- 💻 Code execution
- Executes code in your local environment with the [shell][docs-tools-shell] and [python][docs-tools-python] tools.
- 🧩 Read, write, and change files
- Makes incremental changes with the [patch][docs-tools-patch] tool.
- 🌐 Search and browse the web.
- Can use a browser via Playwright with the [browser][docs-tools-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][docs-providers]
- Use OpenAI, Anthropic, OpenRouter, or serve locally with `llama.cpp`
- ✨ 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][docs-server]### 🛠 Developer perks
- 🧰 Easy to extend
- Most functionality is implemented as [tools][docs-tools], making it easy to add new features.
- 🧪 Extensive testing, high coverage.
- 🧹 Clean codebase, checked and formatted with `mypy`, `ruff`, and `pyupgrade`.
- 🤖 [GitHub Bot][docs-bot] to request changes from comments! (see [#16](https://github.com/ErikBjare/gptme/issues/16))
- Operates in this repo! (see [#18](https://github.com/ErikBjare/gptme/issues/18) for example)
- Runs entirely in GitHub Actions.
- 📊 [Evaluation suite][docs-evals] for testing capabilities of different models### 🚧 In progress
- 🏆 Advanced evals for testing frontier capabilities
- 🤖 Long-running agents and advanced agent architectures
- 🌳 Tree-based conversation structure (see [#17](https://github.com/ErikBjare/gptme/issues/17))
- 📜 RAG to automatically include context from local files (see [#59](https://github.com/ErikBjare/gptme/issues/59))
- 💻 "Computer use" as hyped by [Anthropic][anthropic-computer-use] (see [#216](https://github.com/ErikBjare/gptme/issues/216))
- 🌐 Web UI frontend (see docs for [server][docs-server])### 🛠 Use Cases
- 🎯 **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.## 🚀 Getting Started
Install with pipx:
```sh
# requires Python 3.10+
pipx install gptme
```Now, to get started, run:
```sh
gptme
```Here are some examples:
```sh
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][docs-getting-started] guide and the [Examples][docs-examples] in the [documentation][docs].
## 🛠 Usage
```sh
$ 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
/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
/tools Show available tools
/help Show this help message
/exit Exit the programOptions:
-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.
--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.
```## 📊 Stats
### ⭐ Stargazers over time
[![Stargazers over time](https://starchart.cc/ErikBjare/gptme.svg)](https://starchart.cc/ErikBjare/gptme)
### 📈 Download Stats
- [PePy][pepy]
- [PyPiStats][pypistats][pepy]: https://pepy.tech/project/gptme
[pypistats]: https://pypistats.org/packages/gptme## 🔗 Links
- [Website][website]
- [Documentation][docs]
- [GitHub][github]
- [Discord][discord][website]: https://gptme.org/
[discord]: https://discord.gg/NMaCmmkxWv
[github]: https://github.com/ErikBjare/gptme
[docs]: https://gptme.org/docs/
[docs-getting-started]: https://gptme.org/docs/getting-started.html
[docs-examples]: https://gptme.org/docs/examples.html
[docs-demos]: https://gptme.org/docs/demos.html
[docs-providers]: https://gptme.org/docs/providers.html
[docs-tools]: https://gptme.org/docs/tools.html
[docs-tools-python]: https://gptme.org/docs/tools.html#python
[docs-tools-shell]: https://gptme.org/docs/tools.html#shell
[docs-tools-patch]: https://gptme.org/docs/tools.html#patch
[docs-tools-browser]: https://gptme.org/docs/tools.html#browser
[docs-bot]: https://gptme.org/docs/bot.html
[docs-server]: https://gptme.org/docs/server.html
[docs-evals]: https://gptme.org/docs/evals.html
[docs-server]: https://gptme.org/docs/server.html
[anthropic-computer-use]: https://www.anthropic.com/news/3-5-models-and-computer-use