Skip to main content

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

Project description

DeveloperGPT

License LLMs PyPI OpenAI GPTs

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-source LLMs from Hugging Face, and offline quantized on-device LLMs.

DeveloperGPT is completely free to use when using Google Gemini Pro at up to 60 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 [model_name] [cmd, chat]

Model(s) Source/Provider Details
gemini (default) Google AI Free (up to 60 requests per minute), Google AI API Key Required
mistral-q6, mistral-q4 Mistral Free, Offline, On-Device, Open-Source
gpt35, gpt4 OpenAI Pay-Per-Usage, OpenAI API Key Required
zephyr Zephyr Free, Open-Source, Hugging-Face Inference API
openchat OpenChat Free, Open-Source, Hugging-Face Inference API

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 commits that contain the word llm in the last 3 days

Natural Language Example 1

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 instead of Gemini via API.

# Offline Mode: Using quantized Mistral-7B-Instruct running locally on-device (offline)
$ developergpt --offline cmd [your natural language command request]

Use developergpt --model [mistral-q6,mistral-q4,gpt35,gpt4,zephyr,openchat] cmd to use a different LLM instead of Google Gemini.

# 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

Chat Example

Use developergpt --offline chat to use quantized Mistral-7B-Instruct running locally on-device instead of Gemini via API.

Use developergpt --model [mistral-q6,mistral-q4,gpt35,gpt4,zephyr,openchat] chat to use a different LLM instead of Gemini.

# Example
$ developergpt --model gpt35 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. To use Gemini Pro, you will need an API key (free to use up to 60 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 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 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.

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

To use open-source LLMs 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

Usage and Cost

Mistral-7B-Instruct (llama.cpp)

Mistral-7B-Instruct is free to use and runs locally on-device.

Google Gemini

As of March 2024, Google Gemini is free to use up to 60 queries per minute. For more information, see: https://ai.google.dev/pricing

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 no more than 10 cents per day with regular usage.

Hugging-Face Open-Source LLMs

As of December 2023, 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.

Credit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

developergpt-0.6.5.tar.gz (20.4 kB view hashes)

Uploaded Source

Built Distribution

developergpt-0.6.5-py3-none-any.whl (22.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page