No description
.gitignore | ||
algorithm_llmlingua.py | ||
LICENSE | ||
main.py | ||
Makefile | ||
README.md | ||
requirements.txt |
Better Prompts Tools
Overview
Better Prompts Tools is an interactive web application built with Streamlit that helps you improve prompts using various algorithms. This tool allows users to enter a prompt and apply different algorithms to rework the text, providing insights into token counts before and after compression.
Features
- Prompt Input: Enter your original prompt in the first text box.
- Algorithm Selection: Choose from available algorithms to rework the prompt.
- Reworked Prompt Display: See the improved version of your prompt in a separate textbox.
- Token Metrics: Display token counts for both the original and reworked prompts, along with the compression ratio.
Install and run
To run this project locally, follow these steps:
-
Clone the repository:
git clone <repository_url> cd better-prompts-tools
-
Create a virtual environment
python -m venv venv
-
Load environment
source ./venv/bin/activate
-
Install Python dependancies
pip install -r requirements
-
Run the application
make run
Usage
Once you have the application running, navigate to http://localhost:8501 in your web browser.
- Enter Prompt: Input your original prompt text into the first textbox.
- Select Algorithm: Choose an algorithm from the dropdown menu to rework your prompt.
- Set parameters:
- Rate: % compression you are looking for.
- Processor:
mps
for Apple Silicon,cuda
for NVIDIA,auto
for others - Rank method:
longllmlingua
is better for longer prompts.
- Apply: Click "Apply" to see the reworked version of the prompt.
- Copy: Use the "Copy" button to copy the reworked prompt back to the original textbox for further iterations.