Skip to content

DeveloperGPT is a LLM-powered command line tool that enables natural language to terminal commands and in-terminal chat.

License

Notifications You must be signed in to change notification settings

luo-anthony/DeveloperGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeveloperGPT

License LLMs PyPI

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 and mistral-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

Natural Language Example 1

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

Chat Example

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.

DeveloperGPT LLM Accuracy

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).

  1. Get your own Google AI Studio API Key: https://makersuite.google.com/app/apikey
  2. 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.

  1. Get your own OpenAI API Key and setup billing: https://platform.openai.com/account/api-keys
  2. 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.

  1. Get your own Anthropic API Key: https://www.anthropic.com/api
  2. 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