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 Google Gemini 1.5 Flash by default but also supports Google Gemini 1.0 Pro, OpenAI GPT-3.5 & GPT-4, Anthropic Claude 3 Haiku & Sonnet, open LLMs (Zephyr, Gemma, Mistral) hosted on Hugging Face, and quantized Mistral-7B-Instruct running offline on-device.
As of June 2024, DeveloperGPT is completely free to use when using Google Gemini 1.5 Pro (used by default) or Google Gemini 1.0 Pro at up to 15 requests per minute.
Supported LLMs
Switch between different LLMs using the --model
flag: developergpt --model [llm_name] [cmd, chat]
Model(s) | Source | Details |
---|---|---|
Gemini Pro, Gemini Flash (default) | Google Gemini 1.0 Pro, Gemini 1.5 Flash | Free (up to 15 requests/min), Google AI API Key Required |
GPT35, GPT4 | OpenAI | Pay-Per-Usage, OpenAI API Key Required |
Haiku, Sonnet | Anthropic (Claude 3) | Pay-Per-Usage, Anthropic API Key Required |
Zephyr | Zephyr7B-Beta | Free, Open LLM, Hugging Face Inference API |
Gemma, Gemma-Base | Gemma-1.1-7B-Instruct, Gemma-Base | Free, Open LLM, Hugging Face Inference API |
Mistral-Q6, Mistral-Q4 | Quantized GGUF Mistral-7B-Instruct | Free, Open LLM, OFFLINE, ON-DEVICE |
Mistral | Mistral-7B-Instruct | Free, Open LLM, Hugging Face Inference API |
mistral-q6
andmistral-q4
are Quantized GGUF Mistral-7B-Instruct LLMs running locally on-device using llama.cpp (Q6_K quantized and Q4_K quantized models respectively). These LLMs can run on machines without a dedicated GPU - see llama.cpp for more details.
Features
DeveloperGPT has 2 main features.
1. Natural Language to Terminal Commands
Usage: developergpt cmd [your natural language command request]
# Example
$ developergpt cmd list all git commits that contain the word llm
Use developergpt cmd --fast
to get commands faster without any explanations (~1.6 seconds with --fast
vs. ~3.2 seconds with regular on average). Commands provided by DeveloperGPT in --fast
mode may be less accurate - see DeveloperGPT Natural Language to Terminal Command Accuracy for more details.
# Fast Mode: Commands are given without explanation for faster response
$ developergpt cmd --fast [your natural language command request]
Use developergpt --model [model_name] cmd
to use a different LLM instead of Gemini Flash (used by default).
# Example: Natural Language to Terminal Commands using the GPT-3.5 instead of Gemini Flash
$ developergpt --model gpt35 cmd [your natural language command request]
2. Chat inside the Terminal
Usage: developergpt chat
# Chat with DeveloperGPT using Gemini 1.5 Flash (default)
$ developergpt chat
Use developergpt --model [model_name] chat
to use a different LLM.
# Example
$ developergpt --model mistral 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
DeveloperGPT Natural Language to Terminal Command Accuracy
Accuracy of DeveloperGPT varies depending on the LLM used as well as the mode (--fast
vs. regular). Shown below are Top@1 Accuracy of different LLMs on a set of 85 natural language command requests (this isn't a rigorous evaluation, but it gives a rough sense of accuracy). Github CoPilot in the CLI v1.0.1 is also included for comparison.
Setup
Using Google Gemini (Default)
By default, DeveloperGPT uses Google Gemini 1.5 Flash. To use Gemini 1.0 Pro or Gemini 1.5 Flash, you will need an API key (free to use up to 15 queries per minute).
- Get your own Google AI Studio API Key: https://makersuite.google.com/app/apikey
- Set your Google API Key as the
GOOGLE_API_KEY
environment variable. You only need to do this once.
# set Google API Key (using zsh for example)
$ echo 'export GOOGLE_API_KEY=[your_key_here]' >> ~/.zshenv
# reload the environment (or just quit and open a new terminal)
$ source ~/.zshenv
Using Hugging Face Inference API Open LLMs
To use open LLMs such as Gemma or Mistral hosted on Hugging Face, you can optionally set up a Hugging Face Inference API token as the HUGGING_FACE_API_KEY
environment variable. See https://huggingface.co/docs/api-inference/index for more details.
Using Quantized Mistral-7B-Instruct Offline On-Device
To use quantized Mistral-7B-Instruct, just run DeveloperGPT with the --offline
flag. This will download the model on first run and use it locally in any future runs (no internet connection is required after the first use). No special setup is required.
developergpt --offline chat
Using OpenAI GPT LLMs
To use GPT-3.5 or GPT-4, you will need an OpenAI API key.
- Get your own OpenAI API Key and setup billing: https://platform.openai.com/account/api-keys
- Set your OpenAI API Key as the
OPENAI_API_KEY
environment variable. You only need to do this once.
Using Anthropic LLMs
To use Anthropic Claude 3 Sonnet or Haiku, you will need an Anthropic API key.
- Get your own Anthropic API Key: https://www.anthropic.com/api
- Set your Anthropic API Key as the
ANTHROPIC_API_KEY
environment variable. You only need to do this once.
LLM Cost
Google Gemini LLMs
As of June 2024, Google Gemini 1.0 Pro and Gemini 1.5 Flash are free to use up to 15 queries per minute. For more information, see: https://ai.google.dev/pricing
Hugging Face Hosted Open LLMs
As of June 2024, using Hugging Face Inference API hosted LLMs is free but rate limited. See https://huggingface.co/docs/api-inference/index for more details.
Mistral-7B-Instruct (llama.cpp)
Mistral-7B-Instruct is free to use and runs locally on-device.
OpenAI GPT
You can monitor your OpenAI API usage here: https://platform.openai.com/account/usage. The average cost per query using GPT-3.5 is < 0.1 cents. Using GPT-4 is not recommended as GPT-3.5 is much more cost-effective and achieves a very high accuracy for most commands.
Anthropic Claude LLMs
You can monitor your Anthropic API usage here: https://console.anthropic.com/settings/plans. The average cost per query using Claude 3 Haiku is < 0.1 cents. See https://www.anthropic.com/api for pricing details.
Contributing
Read the CONTRIBUTING.md file.
Credit
- Thanks to Hugging Face and the NLP/LLM community for open LLMs, generous free hosted inference APIs, tools, quantization, and other resources!
- Thanks to Google for the generous Gemini API free tier.
- 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
File details
Details for the file developergpt-0.7.5.tar.gz
.
File metadata
- Download URL: developergpt-0.7.5.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c825bf51ec0aad5af93adb572d211beb1b10294cfccb7db5bcab4590c84f28 |
|
MD5 | 0497a3c47007583f87ed71e7a58739e6 |
|
BLAKE2b-256 | e7e9ebbba09398d1b583dac722bc917efaaf8eaa18901a7b3e84d6d95201f29b |
File details
Details for the file developergpt-0.7.5-py3-none-any.whl
.
File metadata
- Download URL: developergpt-0.7.5-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cb9c3b1b1bb529eed675b4ef55fa69b6dbdc80384fba8dd9835e755a15dfc3b |
|
MD5 | 9b542468cae94a306f84d8906e080b5b |
|
BLAKE2b-256 | dc01b868ef9a989b84d3534f320c08f3ceaee020e8360820ea132508b4d8f1a6 |