Created
December 22, 2024 10:57
-
-
Save korchasa/f76d169f30d5ae9e907e090bd5adc954 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"provenance": [] | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 42, | |
"metadata": { | |
"id": "qhWEHW51xYfe" | |
}, | |
"outputs": [], | |
"source": [ | |
"# Constants\n", | |
"tokens_per_page = 600\n", | |
"tokens_per_console_line = 20\n", | |
"tokens_per_code_line = 30\n", | |
"working_days_per_month = 22\n", | |
"llm_input_per_million = 15\n", | |
"llm_output_per_million = 60" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"# Daily tokens\n", | |
"docs_out = tokens_per_page * 2\n", | |
"docs_in = tokens_per_page * 40\n", | |
"logs_out = 0\n", | |
"logs_in = tokens_per_console_line * 5 * 8\n", | |
"# scripts, configuration\n", | |
"code_out = tokens_per_code_line * 20\n", | |
"code_in = code_out * 10\n", | |
"# tickets, chats\n", | |
"communction_out = 200\n", | |
"communction_in = communction_out * 10" | |
], | |
"metadata": { | |
"id": "TEmQFIv901Z8" | |
}, | |
"execution_count": 43, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"total_in = (docs_in + logs_in + code_in + communction_in) * working_days_per_month\n", | |
"f\"Total input: {total_in} tokens per month\"" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 35 | |
}, | |
"id": "NSBwxah802ma", | |
"outputId": "abfa9f25-2657-45f9-d805-cf8e785aa4c6" | |
}, | |
"execution_count": 44, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"data": { | |
"text/plain": [ | |
"'Total input: 721600 tokens per month'" | |
], | |
"application/vnd.google.colaboratory.intrinsic+json": { | |
"type": "string" | |
} | |
}, | |
"metadata": {}, | |
"execution_count": 44 | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"total_out = (docs_out + logs_out + code_out + communction_out) * working_days_per_month\n", | |
"f\"Total output: {total_out} tokens per month\"" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 35 | |
}, | |
"id": "yn_RX9_-2DXr", | |
"outputId": "a2abb065-b0d5-4629-ec34-e786a42a7073" | |
}, | |
"execution_count": 45, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"data": { | |
"text/plain": [ | |
"'Total output: 44000 tokens per month'" | |
], | |
"application/vnd.google.colaboratory.intrinsic+json": { | |
"type": "string" | |
} | |
}, | |
"metadata": {}, | |
"execution_count": 45 | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"cost_per_month = total_in / 1000000 * llm_input_per_million + total_out / 1000000 * llm_output_per_million\n", | |
"f\"Total cost: {cost_per_month} usd per month\"" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 35 | |
}, | |
"id": "8I-x6tNK2_DZ", | |
"outputId": "98ea25c3-3d8e-4317-fc3c-1b0f6d4e9fec" | |
}, | |
"execution_count": 46, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"data": { | |
"text/plain": [ | |
"'Total cost: 13.463999999999999 usd per month'" | |
], | |
"application/vnd.google.colaboratory.intrinsic+json": { | |
"type": "string" | |
} | |
}, | |
"metadata": {}, | |
"execution_count": 46 | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment