This project is designed to calculate the cost of using different AI models based on their token usage and PTU (Provision Throughput Unit) costs. It utilizes various libraries such as streamlit
, pandas
, openpyxl
, and xlsxwriter
to achieve its functionality.
If you don't want to deploy this tool locally, you can access it here.
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/guming3d/ptu_cost_compare_tool.git cd ptu_cost_compare_tool
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Run the application:
streamlit run app.py
-
Open your web browser and navigate to the Streamlit application.
-
Use the sidebar to input the following parameters:
- Input Token Number: The number of input tokens.
- Output Token Number: The number of output tokens.
- RPM (Request per minute): The number of requests per minute.
- Model Name: Select the model from the dropdown list.
- PTU Number: The number of PTUs.
- PTU Subscription Type: Choose between "Monthly" or "Yearly".
-
Click on "Add Compare" to calculate and add the results to the comparison table.
-
Click on "Clear Result" to clear the comparison table.
-
If the comparison table is not empty, click on "Export to Excel" to download the results as an Excel file.