Skip to main content

A versatile collection of CLI tools leveraging large language models

Project description

LLM-Toolbox

Development Status:

LLM-Toolbox is currently under active development. Your feedback is crucial for this ongoing journey of refinement. Please share your thoughts, experiences, and suggestions. If you find this project beneficial, consider expression your support by giving it a star ⭐😊.


LLM-Toolbox is an ensemble of AI-powered command-line tools designed to modernize your workflow in the terminal. Built using OpenAI's ChatGPT, the tools in this toolbox can generate automatic commit messages, perform dictionary and thesaurus queries, translate text, proofread content, enrich language learning, and automate shell commands, among others.

Additionally, the toolbox provides an array of prompt templates that can serve as a valuable resource, whether you're new to using languages models or you're an experienced user.

I've created video demos to help you see the LLM-Toolbox in action and understand its wide-ranging capabilities. Therefore, I strongly recommend you check out the video demos of the tools to gain a hands-on understanding of their potential. After watching the demos, you can return here for a deeper dive into the specific applications and benefits. So, go ahead, watch the demos! 😊

Table of Contents

  1. Prompt Templates
  2. Isn't the OpenAI API expensive?
  3. The Value of Investing in LLM-Toolbox
    1. Is GPT-3.5 Sufficient for Those Tools?
    2. Current Costs
  4. Installation
    1. pip
    2. pipx, the Easy Way
    3. Installing the LLM-Toolbox
    4. Cloning the LLM-Toolbox Repository
  5. Getting Started
    1. Set your OpenAI API key
  6. Tools
    1. LMT
    2. ShellGenius
    3. Commitgen
    4. Codereview
    5. VocabMaster
    6. Thesaurus
    7. Define
    8. Proofread
    9. Translate
    10. Cheermeup
    11. Critique
    12. Explain
    13. Lessonize
    14. Pathlearner
    15. Study
    16. Summarize
    17. Teachlib
  7. License

Prompt Templates

For those less experienced with terminal interfaces or those preferring the convenience of a web interface, the ChatGPT web interface templates in the LLM-Toolbox can prove incredibly useful. These templates offer a broad spectrum of pre-structured prompts designed to enhance your engagement with ChatGPT, particularly in the context of longer chat interactions with GPT-4 in order to avoid expensive API costs.

These templates, found in the prompt-templates/ directory, cater to various situations and are an excellent resource if you're uncertain about structuring prompts or seek to improve the effectiveness of your existing ones.

Feel free to explore these templates and adjust them to better suit your individual needs.

Isn't the OpenAI API expensive?

A lot of people are afraid that these tools will cost them too much. But the truth is, as long as you're not sending too many requests to GPT-4, you won't have exorbitant bills. On the contrary, this may surprise you, but I'm pretty confident that the majority of people won't exceed a cost of $3 to $5 per month, as long as they continue to use GPT-3.5, even if they use these tools more than a hundred times a day.

Also, there's a safeguard: you can configure a soft and a hard usage limit on your OpenAI account. This ensures that you won't ever be taken by surprise.

  • Soft limit: You receive a notification email.
  • Hard limit: Subsequent requests will be rejected.

The Value of Investing in LLM-Toolbox

Well... in giving your money to OpenAI, actually.

Even if you have a monthly expense of more than a dollar, it's well worth looking at the huge benefits you'll receive from utilizing the tools in the LLM-Toolbox. These innovative solutions provide users with powerful capabilities that can significantly streamline tasks, improve productivity, and foster creativity.

Particularly, let's consider ShellGenius, a remarkable tool within the LLM-Toolbox. It enhances the command-line experience by translating task descriptions into efficient shell commands, a feat that not only saves time but also reduces the possibility of human error. This tool is extremely beneficial for both beginners, who may not be fluent in shell commands, and experienced users who can streamline their command-line tasks by simply describing what they wish to accomplish.

Therefore, when considering the cost, it's essential to look beyond the immediate dollar value and evaluate the considerable time, effort, and resources you stand to save. The utility and value derived from such tools often outweigh the minimal monthly cost. The price of these tools should not be a deterrent but rather seen as an investment in enhancing your efficiency and productivity.

Is GPT-3.5 Sufficient for Those Tools?

GPT-3.5 is an excellent model for these tools, offering a cost-effective solution that consistently delivers appropriate responses. I take great care in crafting my prompts and the tools to generate the best results that cater to my own daily needs.

I will continue refining them, if necessary, as time goes on. So stay tuned to this repo and consider giving it a star ⭐!

You'll also be able to update the LLM-Toolbox directly from the CLI 😊.

Current Costs

At the time of writing (2023-06-17T13:35:56+02:00), these are the costs:

Model Prompt Cost Response Cost
gpt-3.5-turbo $0.0015 / 1K $0.002 / 1K
gpt-3.5-turbo-16k $0.003 / 1K $0.004 / 1K
gpt-4 $0.03 / 1K $0.06 / 1K
gpt-4-32k $0.06 / 1K $0.12 / 1K

Installation

pip

python3 -m pip install llm-toolbox

pipx, the Easy Way

To use these tools, I recommend that you first install pipx. It's a package manager for Python that makes the installation and upgrade of CLI apps easy (no more hassle with virtual environments 😌).

  • Debian / Ubuntu

    sudo apt install pipx
    
  • macOS

    brew install pipx
    

Installing the LLM-Toolbox

To install the latest stable version of the LLM-Toolbox, simply run this command:

pipx install llm-toolbox

If you want to follow the main branch:

pipx install git+https://github.com/sderev/llm-toolbox

To upgrade it:

pipx upgrade llm-toolbox

Cloning the LLM-Toolbox Repository

You can clone this repository with the following command:

git clone https://github.com/sderev/llm-toolbox.git

Getting Started

Set your OpenAI API key

LLM-Toolbox requires an OpenAI API key to function. You can obtain a key by signing up for an account at OpenAI's website.

You need to set some usage limit before to be able to use the API. You can configure on your OpenAI account in Billing -> Usage limits.

Once you have your API key, set it as an environment variable:

  • On macOS and Linux:

    export OPENAI_API_KEY="your-api-key-here"
    

    To avoid having to type it everyday, you can create a file with the key:

    echo "your-api-key" > ~/.openai-api-key.txt
    

    Note: Remember to replace "your-api-key" with your actual API key.

    And then, you can add this to your shell configuration file (.bashrc, .zshrc, etc.):

    export OPENAI_API_KEY="$(cat ~/.openai-api-key.txt)"
    
  • On Windows:

    setx OPENAI_API_KEY your_key
    

Tools

Instructions on how to use each of the tools are included in the individual directories under tools/. This is also where I give some tricks and tips on their usage 💡👀💭.

Note that LMT is the main tool in the LLM-Toolbox. All of its options apply to (almost) all of the other tools. For instance, you change the model to GPT-4 with -m 4 or add emojis with --emoji. Refer to the LMT's documentation for more information.

  • Reading from stdin: Almost all of the tools can read from stdin. For instance: cat my_text.md | summarize.

  • Output Redirection: You can use output redirections with the tools. For instance: cat my_text.md | critique --raw > critique_of_my_text.md

Here's a brief overview of the tools:

LMT

LMT empowers you to interact directly with ChatGPT from the comfort of your terminal. One of the core features of lmt is its ability to facilitate the creation of custom templates, enabling you to design your personalized toolbox of CLI applications. You can easily install its standalone version from the project's repository.

cioran


ShellGenius

ShellGenius is an intuitive CLI tool designed to enhance your command-line experience by turning your task descriptions into efficient shell commands. Check out the project on its dedicated repository.

shellgenius


Commitgen

The commitgen tool is designed to streamline your git workflow by automatically generating meaningful commit messages for your code changes.

demo_0


Codereview

The Codereview tool accepts a file or a piece of text as input and provides an in-depth analysis of the code. It can identify potential issues, suggest improvements, and even detect security vulnerabilities. The Codereview tool is capable of handling a variety of programming languages, and its feedback can serve as an invaluable resource for developers seeking to enhance the quality of their code.

demo_0


VocabMaster

Master new languages with VocabMaster, a CLI tool designed to help you record vocabulary, access translations and examples, and seamlessly import them into Anki for an optimized language learning experience. Check out the project on its dedicated repository.

vocabmaster_translate_japanese


Thesaurus

The thesaurus tool takes a word or a phrase as input and provides a list of synonyms and antonyms.

thesaurus


Define

The define tool takes a word as input and provides its definition along with an example sentence using the word.

define


Proofread

The proofread tool takes a sentence as input and provides a corrected version of it, if needed, along with an explanation of the corrections.

proofread_english


Translate

The translate tool takes a sentence and a target language as input and provides the translated sentence in the target language.

translate


Cheermeup

The cheermeup tool is designed to uplift your spirits based on your current mood. Whether you're feeling down or just need a little pick-me-up, this tool uses a variety of methods to bring a smile to your face and brighten your day.

ice_cream


Critique

The critique tool is your personal constructive text critic, designed to analyze a given piece of text and provide detailed, insightful feedback. It enables users to enhance their writing by addressing potential shortcomings and improving the overall quality.

demo_0


Explain

The explain tool helps to clarify complex concepts. When given a concept, it presents a comprehensive and straightforward explanation, aiding in understanding and knowledge retention.

demo_0


Lessonize

The lessonize tool transforms any piece of text into an informative lesson. Whether you're a teacher looking for instructional material or a student looking to further understand a subject, this tool makes learning more accessible.

demo_0


Pathlearner

The pathlearner tool provides a comprehensive study plan for a given topic. Whether you're studying for an exam or learning a new subject, this tool creates a structured, step-by-step plan that aids in understanding and mastering the material.

demo_0


Study

The study tool is a comprehensive guide that generates study material for a particular topic or content. It helps students to better prepare for exams, giving them access to tailored study material designed to enhance their learning experience.

demo_0


Summarize

The summarize tool provides succinct summaries of a web page, lengthy texts, or the content of given files. It's perfect for extracting key points and crucial information from vast amounts of data, saving users time and effort.

wikipedia


Teachlib

The teachlib tool is designed to provide comprehensive lessons on various libraries. By simplifying complex aspects and focusing on the core functionalities, this tool helps users to understand and effectively utilize different libraries.

numpy


License

This project is licensed under the terms of the Apache License 2.0.


https://github.com/sderev/llm-toolbox

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

LLM-Toolbox-0.1.6.tar.gz (20.3 kB view hashes)

Uploaded Source

Built Distribution

LLM_Toolbox-0.1.6-py3-none-any.whl (24.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