DeveloperGPT
DeveloperGPT copied to clipboard
DeveloperGPT is a LLM-powered command line tool that enables natural language to terminal commands and in-terminal chat.
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 Pro by default but also supports OpenAI GPT LLMs, open LLMs hosted on Hugging Face, and offline quantized on-device LLMs.
As of May 2024, DeveloperGPT is completely free to use when using Google Gemini Pro 1.0 at up to 15 requests per minute - this is the default model used by DeveloperGPT in the latest version.
Additionally, DeveloperGPT supports quantized Mistral-7B-Instruct LLMs via llama.cpp for fully offline on-device use (these LLMs can run on machines without a dedicated GPU - see llama.cpp for more details).
Supported LLMs
Switch between different LLMs using the --model
flag: developergpt --model [llm_name] [cmd, chat]
Model(s) | Source | Details |
---|---|---|
Gemini (default) | Google AI (Gemini Pro 1.0) | 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)
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 (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 --offline cmd
to use quantized Mistral-7B-Instruct running locally on-device.
# Offline Mode: Using quantized Mistral-7B-Instruct running locally on-device (offline)
$ developergpt --offline cmd [your natural language command request]
Use developergpt --model [model_name] cmd
to use a different LLM instead of Gemini Pro (used by default).
# Example: Natural Language to Terminal Commands using the GPT3.5 instead of Gemini
$ developergpt --model gpt35 cmd [your natural language command request]
2. Chat inside the Terminal
Usage: developergpt chat
# Chat with DeveloperGPT using Gemini Pro (default)
$ developergpt chat
Use developergpt --offline chat
to use quantized Mistral-7B-Instruct running locally on-device instead of Gemini via API.
Use developergpt --model [model_name] chat
to use a different LLM instead of Gemini.
# Example
$ developergpt --model gemma 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 Google Gemini (Default)
By default, DeveloperGPT uses Google Gemini Pro 1.0. To use Gemini Pro, 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 an 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 an environment variable using the steps below. See https://huggingface.co/docs/api-inference/index for more details.
# [OPTIONAL] set Hugging Face token (using zsh for example)
$ echo 'export HUGGING_FACE_API_KEY=[your_key_here]' >> ~/.zshenv
# reload the environment (or just quit and open a new terminal)
$ source ~/.zshenv
Using Mistral-7B-Instruct (Offline)
To use 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 GPT3.5 or GPT4, 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 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 Anthropic LLMs
To use Anthropic Claude LLMs, you will need an Anthropic API key.
- Get your own Anthropic API Key: https://www.anthropic.com/api
- Set your Anthropic API Key as an environment variable. You only need to do this once.
# set Anthropic API Key (using zsh for example)
$ echo 'export ANTHROPIC_API_KEY=[your_key_here]' >> ~/.zshenv
# reload the environment (or just quit and open a new terminal)
$ source ~/.zshenv
Usage and Cost
Google Gemini
As of May 2024, Google Gemini is 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 April 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. Based on preliminary testing, using DeveloperGPT with GPT3.5 should cost less than 10 cents per day with regular usage. Using GPT4 is not recommended as GPT3.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. Based on preliminary testing, using DeveloperGPT with Claude Haiku should cost less than 10 cents per day with regular usage. 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 Pro API free tier.
- This project uses the Python project template from https://github.com/rochacbruno/python-project-template