DeveloperGPT is a LLM-powered command line tool that enables natural language to terminal commands and in-terminal chat.
Project description
DeveloperGPT
DeveloperGPT is a LLM-powered command line tool that enables natural language to terminal commands and in-terminal chat.
DeveloperGPT is powered by OpenAI's GPT3.5 (by default) with additional support for GPT4 and open-source models hosted on Hugging Face including Zephyr and OpenChat.
DeveloperGPT has two main features:
1. Natural Language to Terminal Commands
Supported LLMs: GPT3.5 (default), GPT4, Zephyr, OpenChat
Usage: developergpt cmd [your natural language command request]
# Example
$ developergpt cmd list all commits that contain the word "llm"
Use developergpt cmd --fast
to get commands faster without any explanations (may be less accurate).
# Fast Mode: Commands are given without explanation (may be less accurate)
$ developergpt cmd --fast [your natural language command request]
Use developergpt --model [zephyr,openchat,gpt4] cmd
to use a different LLM instead of GPT3.5.
# Example: Natural Language to Terminal Commands using the Zephyr LLM instead of GPT3.5
$ developergpt --model zephyr cmd [your natural language command request]
GPT3.5 is generally accurate for the majority of natural langauge to command requests and is significantly cheaper to use than GPT4. Other models such as Zephyr or OpenChat are less accurate and may result in in unexpected or undefined behavior. With all models, it is always good practice to manually verify the command output before running it.
2. Chat inside the Terminal
Supported LLMs: GPT3.5 (default), GPT4, Zephyr, OpenChat
Usage: developergpt chat
# chat with DeveloperGPT using GPT3.5 (default)
$ developergpt chat
Use developergpt --model [zephyr,openchat,gpt4] chat
to use a different LLM instead of GPT3.5.
# chat with DeveloperGPT using OpenChat
$ developergpt --model openchat chat
# chat with DeveloperGPT using Zephyr
$ developergpt --model zephyr chat
# chat with DeveloperGPT using GPT4
$ developergpt --model gpt4 chat
Chat moderation is NOT implemented - all your chat messages should follow the terms of use of the LLM used.
Usage
DeveloperGPT is NOT to be used for any purposes forbidden by the terms of use of the LLMs used. Additionally, DeveloperGPT itself (apart from the LLMs) is a proof of concept tool and is not intended to be used for any serious or commerical work.
Install DeveloperGPT from PyPI
pip install -U developergpt
Basic Usage
# see available commands
$ developergpt
Setup
Using OpenAI GPT (Default)
By default, DeveloperGPT uses GPT3.5 from OpenAI in addition to supporting GPT4. To use GPT3.5 or GPT4, you will need an OpenAI API Key.
- Get your own OpenAI API Key: https://platform.openai.com/account/api-keys
- Set your OpenAI API Key as an environment variable. You only need to do this once.
# set OpenAI API Key (using zsh for example)
$ echo 'export OPENAI_API_KEY=[your_key_here]' >> ~/.zshenv
# reload the environment (or just quit and open a new terminal)
$ source ~/.zshenv
Using Open-Source Models (Optional)
To use open-source models such as Zephyr or OpenChat hosted on Hugging Face, you can optionally set up a Hugging Face or Inference API token as an environment variable using the steps below. Setting up a token is not required, but it will allow you to make more requests without being rate limited.
# [OPTIONAL] set Hugging Face token (using zsh for example)
# You only need to do this once
$ echo 'export HUGGING_FACE_API_KEY=[your_key_here]' >> ~/.zshenv
# reload the environment (or just quit and open a new terminal)
$ source ~/.zshenv
OpenAI API Usage
You can monitor your OpenAI API usage here: https://platform.openai.com/account/usage. Based on preliminary testing, using DeveloperGPT with GPT3.5 should cost no more than 10 cents per day with regular usage.
Hugging-Face Usage
Currently, using Hugging Face LLMs does not require a token and is free but rate limited. To avoid rate limit, you can set a token using the instructions above.
Contributing
Read the CONTRIBUTING.md file.
Future Roadmap
- Add support for more open-source models such as LLAMA 2
Credit
- Thanks to Hugging Face and the NLP community for open-source models and prompts!
- This project uses the Python project template from https://github.com/rochacbruno/python-project-template
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
Built Distribution
Hashes for developergpt-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b0e203c0797316ebd407657a3f5d21b2e90c5e79e845f25c92b834906c652f4 |
|
MD5 | 283a2e3c9a0e397d6b6dab3692527213 |
|
BLAKE2b-256 | be233a275e191f9e071261d0088dd37b6e8bf14f9e2b33c3d1deb245fe529012 |