Skip to content

Commit 006c0e9

Browse files
authored
Merge pull request #61 from DieterHolvoet/issue/60
Add more OpenAI models
2 parents c75fe2b + dab444c commit 006c0e9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/scrapeghost/models.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
@dataclass
55
class Model:
66
name: str
7-
prompt_token_cost: float # per 1k
8-
completion_token_cost: float # per 1k
9-
max_tokens: int
10-
json_mode: bool
7+
prompt_token_cost: float # $ per 1k input tokens, see https://openai.com/api/pricing
8+
completion_token_cost: float # $ per 1k output tokens, see https://openai.com/api/pricing
9+
max_tokens: int # max output tokens
10+
json_mode: bool # see https://platform.openai.com/docs/guides/json-mode
1111

1212
def cost(self, prompt_tokens: int, completion_tokens: int) -> float:
1313
return (
@@ -20,6 +20,10 @@ def cost(self, prompt_tokens: int, completion_tokens: int) -> float:
2020
Model("gpt-4", 0.03, 0.06, 8192, False),
2121
Model("gpt-4-32k", 0.06, 0.12, 32768, False),
2222
Model("gpt-4-1106-preview", 0.01, 0.03, 128000, True),
23+
Model("gpt-4-turbo", 0.01, 0.03, 4096, True),
24+
Model("gpt-4-turbo-preview", 0.01, 0.03, 4096, True),
25+
Model("gpt-4o", 0.005, 0.015, 4096, True),
26+
Model("gpt-4o-mini", 0.00015, 0.0006, 16384, True),
2327
Model("gpt-3.5-turbo", 0.001, 0.002, 16384, False),
2428
Model("gpt-3.5-turbo-1106", 0.001, 0.002, 16384, True),
2529
]

0 commit comments

Comments
 (0)