Skip to content

Commit

Permalink
Added 0125 model support (#7)
Browse files Browse the repository at this point in the history
Note that 0125 models aren't technically ready to be used for another 2 weeks or so
  • Loading branch information
Bikatr7 authored Jan 26, 2024
2 parents c190e3e + 74c0df7 commit 6f0aeef
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 126 deletions.
17 changes: 17 additions & 0 deletions models/kijiku.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,10 @@ def estimate_cost(model:str, price_case:int | None = None) -> typing.Tuple[int,
print("Warning: gpt-4 may change over time. Returning num tokens assuming gpt-4-1106-preview as it is the most recent version of gpt-4.")
return Kijiku.estimate_cost("gpt-4-1106-preview", price_case=4)

elif(model == "gpt-4-turbo-preview"):
print("Warning: gpt-4-turbo-preview may change over time. Returning num tokens assuming gpt-4-0125-preview as it is the most recent version of gpt-4-turbo-preview.")
return Kijiku.estimate_cost("gpt-4-0125-preview", price_case=4)

elif(model == "gpt-3.5-turbo-0613"):
print("Warning: gpt-3.5-turbo-0613 is considered depreciated by OpenAI as of November 6, 2023 and could be shutdown as early as June 13, 2024. Consider switching to gpt-3.5-turbo-1106.")
return Kijiku.estimate_cost(model, price_case=1)
Expand All @@ -553,13 +557,19 @@ def estimate_cost(model:str, price_case:int | None = None) -> typing.Tuple[int,
elif(model == "gpt-3.5-turbo-1106"):
return Kijiku.estimate_cost(model, price_case=2)

elif(model == "gpt-3.5-turbo-0125"):
return Kijiku.estimate_cost(model, price_case=7)

elif(model == "gpt-3.5-turbo-16k-0613"):
print("Warning: gpt-3.5-turbo-16k-0613 is considered depreciated by OpenAI as of November 6, 2023 and could be shutdown as early as June 13, 2024. Consider switching to gpt-3.5-turbo-1106.")
return Kijiku.estimate_cost(model, price_case=3)

elif(model == "gpt-4-1106-preview"):
return Kijiku.estimate_cost(model, price_case=4)

elif(model == "gpt-4-0125-preview"):
return Kijiku.estimate_cost(model, price_case=4)

elif(model == "gpt-4-0314"):
print("Warning: gpt-4-0314 is considered depreciated by OpenAI as of June 13, 2023 and could be shutdown as early as June 13, 2024. Consider switching to gpt-4-0613.")
return Kijiku.estimate_cost(model, price_case=5)
Expand Down Expand Up @@ -597,6 +607,8 @@ def estimate_cost(model:str, price_case:int | None = None) -> typing.Tuple[int,
cost_per_thousand_output_tokens = 0.0040

## gpt-4-1106-preview
## gpt-4-0125-preview
## gpt-4-turbo-preview
elif(price_case == 4):
cost_per_thousand_input_tokens = 0.01
cost_per_thousand_output_tokens = 0.03
Expand All @@ -613,6 +625,11 @@ def estimate_cost(model:str, price_case:int | None = None) -> typing.Tuple[int,
cost_per_thousand_input_tokens = 0.06
cost_per_thousand_output_tokens = 0.012

## gpt-3.5-turbo-0125
elif(price_case == 7):
cost_per_thousand_input_tokens = 0.0005
cost_per_thousand_output_tokens = 0.0015

## break down the text into a string than into tokens
text = ''.join(Kijiku.text_to_translate)

Expand Down
5 changes: 4 additions & 1 deletion modules/common/file_ensurer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,18 @@ class FileEnsurer():
allowed_models = [
"gpt-3.5-turbo",
"gpt-4",
"gpt-4-turbo-preview",
"gpt-3.5-turbo-0301",
"gpt-4-0314",
"gpt-4-32k-0314",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-16k-0613",
"gpt-3.5-turbo-1106",
"gpt-4-0613",
"gpt-4-32k-0613",
"gpt-4-1106-preview"
"gpt-4-1106-preview",
"gpt-4-0125-preview"
]

invalid_kijiku_rules_placeholder = {
Expand Down
2 changes: 1 addition & 1 deletion modules/common/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Toolkit():
"""

CURRENT_VERSION = "v3.1.1"
CURRENT_VERSION = "v3.1.2"

##-------------------start-of-clear_console()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Expand Down
11 changes: 7 additions & 4 deletions util/openai_model_info/openai_chat_model_info.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
,Batch,Name,Price,Recommended Replacement,Depreciation Date,Shutdown Date (earliest)
,,,,,,
,First (depreciated),gpt-3.5-turbo-0301,$0.0015 / 1K input tokens + $0.0020 / 1K output tokens,gpt-3.5-turbo-0613,"June 13, 2023","June 13, 2024"
,First (depreciated I),gpt-3.5-turbo-0301,$0.0015 / 1K input tokens + $0.0020 / 1K output tokens,gpt-3.5-turbo-0613,"June 13, 2023","June 13, 2024"
,,gpt-4-0314,$0.03 / 1K input tokens + $0.06 / 1K output tokens,gpt-4-0613,"June 13, 2023","June 13, 2024"
,,gpt-4-32k-0314,$0.06 / 1K input tokens + $0.12 / 1K output tokens,gpt-4-32k-0613,"June 13, 2023","June 13, 2024"
,,,,,,
,Second (depreciated),gpt-3.5-turbo-0613,$0.0015 / 1K input tokens + $0.0020 / 1K output tokens,gpt-3.5-turbo-1106,"November 6,2023","June 13, 2024"
,Second (depreciated II),gpt-3.5-turbo-0613,$0.0015 / 1K input tokens + $0.0020 / 1K output tokens,gpt-3.5-turbo-1106,"November 6,2023","June 13, 2024"
,,gpt-3.5-turbo-16k-0613,$0.0030 / 1K input tokens + $0.0040 / 1K output tokens,gpt-3.5-turbo-1106,"November 6,2023","June 13, 2024"
,,,,,,
,Third (Current),gpt-3.5-turbo-1106,$0.0010 / 1K input tokens + $0.0020 / 1K output tokens,N/A,N/A,N/A
,Third (Outdated),gpt-3.5-turbo-1106,$0.0010 / 1K input tokens + $0.0020 / 1K output tokens,N/A,N/A,N/A
,,,,,,
,Fourth (Current),gpt-3.5-turbo-0125,$0.005 / 1K input tokens + $0.0015 / 1K output tokens,N/A,N/A,N/A
,,gpt-4-0613,$0.03 / 1K input tokens + $0.06 / 1K output tokens,N/A,N/A,N/A
,,gpt-4-32k-0613,$0.06 / 1K input tokens + $0.012 / 1K output tokens,N/A,N/A,N/A
,,,,,,
,Fourth (Future),gpt-4-1106-preview,$0.01 / 1K input tokens + $0.03 / 1K output tokens,N/A,N/A,N/A
,Fifth (Future),gpt-4-1106-preview,$0.01 / 1K input tokens + $0.03 / 1K output tokens,N/A,N/A,N/A
,,gpt-4-0125-preview,$0.01 / 1K input tokens + $0.03 / 1K output tokens,N/A,N/A,N/A
Binary file modified util/openai_model_info/openai_chat_model_info.pdf
Binary file not shown.
Binary file modified util/openai_model_info/openai_chat_model_info.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion util/openai_model_info/webpage/openai_chat_model_info.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="resources/sheet.css" >
<style type="text/css">.ritz .waffle a { color: inherit; }.ritz .waffle .s1{background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:0px 3px 0px 3px;}.ritz .waffle .s0{background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:0px 3px 0px 3px;}</style><div class="ritz grid-container" dir="ltr"><table class="waffle" cellspacing="0" cellpadding="0"><thead><tr><th class="row-header freezebar-origin-ltr"></th><th id="1033891601C0" style="width:100px;" class="column-headers-background">A</th><th id="1033891601C1" style="width:141px;" class="column-headers-background">B</th><th id="1033891601C2" style="width:159px;" class="column-headers-background">C</th><th id="1033891601C3" style="width:336px;" class="column-headers-background">D</th><th id="1033891601C4" style="width:182px;" class="column-headers-background">E</th><th id="1033891601C5" style="width:167px;" class="column-headers-background">F</th><th id="1033891601C6" style="width:151px;" class="column-headers-background">G</th></tr></thead><tbody><tr style="height: 20px"><th id="1033891601R0" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">1</div></th><td></td><td class="s0">Batch</td><td class="s0">Name</td><td class="s0">Price</td><td class="s0">Recommended Replacement</td><td class="s0">Depreciation Date</td><td class="s0">Shutdown Date (earliest)</td></tr><tr style="height: 20px"><th id="1033891601R1" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">2</div></th><td></td><td></td><td></td><td></td><td></td><td class="s0"></td><td class="s0"></td></tr><tr style="height: 20px"><th id="1033891601R2" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">3</div></th><td></td><td class="s0">First (depreciated)</td><td class="s0">gpt-3.5-turbo-0301</td><td class="s0">$0.0015 / 1K input tokens + $0.0020 / 1K output tokens</td><td class="s0">gpt-3.5-turbo-0613</td><td class="s1">June 13, 2023</td><td class="s1">June 13, 2024</td></tr><tr style="height: 20px"><th id="1033891601R3" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">4</div></th><td></td><td></td><td class="s0">gpt-4-0314</td><td class="s0">$0.03 / 1K input tokens + $0.06 / 1K output tokens</td><td class="s0">gpt-4-0613</td><td class="s1">June 13, 2023</td><td class="s1">June 13, 2024</td></tr><tr style="height: 20px"><th id="1033891601R4" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">5</div></th><td></td><td></td><td class="s0">gpt-4-32k-0314</td><td class="s0">$0.06 / 1K input tokens + $0.12 / 1K output tokens</td><td class="s0">gpt-4-32k-0613</td><td class="s1">June 13, 2023</td><td class="s1">June 13, 2024</td></tr><tr style="height: 20px"><th id="1033891601R5" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">6</div></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px"><th id="1033891601R6" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">7</div></th><td></td><td class="s0">Second (depreciated)</td><td class="s0">gpt-3.5-turbo-0613</td><td class="s0">$0.0015 / 1K input tokens + $0.0020 / 1K output tokens</td><td class="s0">gpt-3.5-turbo-1106</td><td class="s1">November 6,2023</td><td class="s1">June 13, 2024</td></tr><tr style="height: 20px"><th id="1033891601R7" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">8</div></th><td></td><td></td><td class="s0">gpt-3.5-turbo-16k-0613</td><td class="s0">$0.0030 / 1K input tokens + $0.0040 / 1K output tokens</td><td class="s0">gpt-3.5-turbo-1106</td><td class="s1">November 6,2023</td><td class="s1">June 13, 2024</td></tr><tr style="height: 20px"><th id="1033891601R8" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">9</div></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px"><th id="1033891601R9" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">10</div></th><td></td><td class="s0">Third (Current)</td><td class="s0">gpt-3.5-turbo-1106</td><td class="s0">$0.0010 / 1K input tokens + $0.0020 / 1K output tokens</td><td class="s0">N/A</td><td class="s0">N/A</td><td class="s0">N/A</td></tr><tr style="height: 20px"><th id="1033891601R10" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">11</div></th><td></td><td></td><td class="s0">gpt-4-0613</td><td class="s0">$0.03 / 1K input tokens + $0.06 / 1K output tokens</td><td class="s0">N/A</td><td class="s0">N/A</td><td class="s0">N/A</td></tr><tr style="height: 20px"><th id="1033891601R11" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">12</div></th><td></td><td></td><td class="s0">gpt-4-32k-0613</td><td class="s0">$0.06 / 1K input tokens + $0.012 / 1K output tokens</td><td class="s0">N/A</td><td class="s0">N/A</td><td class="s0">N/A</td></tr><tr style="height: 20px"><th id="1033891601R12" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">13</div></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px"><th id="1033891601R13" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">14</div></th><td></td><td class="s0">Fourth (Future)</td><td class="s0">gpt-4-1106-preview</td><td class="s0">$0.01 / 1K input tokens + $0.03 / 1K output tokens</td><td class="s0">N/A</td><td class="s0">N/A</td><td class="s0">N/A</td></tr></tbody></table></div>
<style type="text/css">.ritz .waffle a { color: inherit; }.ritz .waffle .s1{background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s0{background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}</style><div class="ritz grid-container" dir="ltr"><table class="waffle" cellspacing="0" cellpadding="0"><thead><tr><th class="row-header freezebar-origin-ltr"></th><th id="0C0" style="width:100px;" class="column-headers-background">A</th><th id="0C1" style="width:141px;" class="column-headers-background">B</th><th id="0C2" style="width:159px;" class="column-headers-background">C</th><th id="0C3" style="width:336px;" class="column-headers-background">D</th><th id="0C4" style="width:182px;" class="column-headers-background">E</th><th id="0C5" style="width:167px;" class="column-headers-background">F</th><th id="0C6" style="width:151px;" class="column-headers-background">G</th></tr></thead><tbody><tr style="height: 20px"><th id="0R0" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">1</div></th><td></td><td class="s0" dir="ltr">Batch</td><td class="s0" dir="ltr">Name</td><td class="s0" dir="ltr">Price</td><td class="s0" dir="ltr">Recommended Replacement</td><td class="s0" dir="ltr">Depreciation Date</td><td class="s0" dir="ltr">Shutdown Date (earliest)</td></tr><tr style="height: 20px"><th id="0R1" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">2</div></th><td></td><td></td><td></td><td></td><td></td><td class="s0" dir="ltr"></td><td class="s0" dir="ltr"></td></tr><tr style="height: 20px"><th id="0R2" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">3</div></th><td></td><td class="s0" dir="ltr">First (depreciated I)</td><td class="s0" dir="ltr">gpt-3.5-turbo-0301</td><td class="s0" dir="ltr">$0.0015 / 1K input tokens + $0.0020 / 1K output tokens</td><td class="s0" dir="ltr">gpt-3.5-turbo-0613</td><td class="s1" dir="ltr">June 13, 2023</td><td class="s1" dir="ltr">June 13, 2024</td></tr><tr style="height: 20px"><th id="0R3" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">4</div></th><td></td><td></td><td class="s0" dir="ltr">gpt-4-0314</td><td class="s0" dir="ltr">$0.03 / 1K input tokens + $0.06 / 1K output tokens</td><td class="s0" dir="ltr">gpt-4-0613</td><td class="s1" dir="ltr">June 13, 2023</td><td class="s1" dir="ltr">June 13, 2024</td></tr><tr style="height: 20px"><th id="0R4" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">5</div></th><td></td><td></td><td class="s0" dir="ltr">gpt-4-32k-0314</td><td class="s0" dir="ltr">$0.06 / 1K input tokens + $0.12 / 1K output tokens</td><td class="s0" dir="ltr">gpt-4-32k-0613</td><td class="s1" dir="ltr">June 13, 2023</td><td class="s1" dir="ltr">June 13, 2024</td></tr><tr style="height: 20px"><th id="0R5" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">6</div></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px"><th id="0R6" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">7</div></th><td></td><td class="s0" dir="ltr">Second (depreciated II)</td><td class="s0" dir="ltr">gpt-3.5-turbo-0613</td><td class="s0" dir="ltr">$0.0015 / 1K input tokens + $0.0020 / 1K output tokens</td><td class="s0" dir="ltr">gpt-3.5-turbo-1106</td><td class="s1" dir="ltr">November 6,2023</td><td class="s1" dir="ltr">June 13, 2024</td></tr><tr style="height: 20px"><th id="0R7" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">8</div></th><td></td><td></td><td class="s0" dir="ltr">gpt-3.5-turbo-16k-0613</td><td class="s0" dir="ltr">$0.0030 / 1K input tokens + $0.0040 / 1K output tokens</td><td class="s0" dir="ltr">gpt-3.5-turbo-1106</td><td class="s1" dir="ltr">November 6,2023</td><td class="s1" dir="ltr">June 13, 2024</td></tr><tr style="height: 20px"><th id="0R8" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">9</div></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px"><th id="0R9" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">10</div></th><td></td><td class="s0" dir="ltr">Third (Outdated)</td><td class="s0" dir="ltr">gpt-3.5-turbo-1106</td><td class="s0" dir="ltr">$0.0010 / 1K input tokens + $0.0020 / 1K output tokens</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td></tr><tr style="height: 20px"><th id="0R10" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">11</div></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px"><th id="0R11" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">12</div></th><td></td><td class="s0" dir="ltr">Fourth (Current)</td><td class="s0" dir="ltr">gpt-3.5-turbo-0125</td><td class="s0" dir="ltr">$0.005 / 1K input tokens + $0.0015 / 1K output tokens</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td></tr><tr style="height: 20px"><th id="0R12" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">13</div></th><td></td><td></td><td class="s0" dir="ltr">gpt-4-0613</td><td class="s0" dir="ltr">$0.03 / 1K input tokens + $0.06 / 1K output tokens</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td></tr><tr style="height: 20px"><th id="0R13" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">14</div></th><td></td><td></td><td class="s0" dir="ltr">gpt-4-32k-0613</td><td class="s0" dir="ltr">$0.06 / 1K input tokens + $0.012 / 1K output tokens</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td><td class="s0" dir="ltr">N/A</td></tr><tr style="height: 20px"><th id="0R14" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">15</div></th><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px"><th id="0R15" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">16</div></th><td></td><td class="s0">Fifth (Future)</td><td class="s0">gpt-4-1106-preview</td><td class="s0">$0.01 / 1K input tokens + $0.03 / 1K output tokens</td><td class="s0">N/A</td><td class="s0">N/A</td><td class="s0">N/A</td></tr><tr style="height: 20px"><th id="0R16" style="height: 20px;" class="row-headers-background"><div class="row-header-wrapper" style="line-height: 20px">17</div></th><td></td><td class="s0"></td><td class="s0">gpt-4-0125-preview</td><td class="s0">$0.01 / 1K input tokens + $0.03 / 1K output tokens</td><td class="s0">N/A</td><td class="s0">N/A</td><td class="s0">N/A</td></tr></tbody></table></div>
2 changes: 1 addition & 1 deletion util/openai_model_info/webpage/resources/sheet.css

Large diffs are not rendered by default.

Loading

0 comments on commit 6f0aeef

Please sign in to comment.