Skip to content

Commit 8d1659a

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Updates costs per token for OpenAI and Anthropic models
1 parent 0855276 commit 8d1659a

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

openlayer/model_runners/ll_model_runners.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,15 @@ def run_and_yield_progress(
290290
class AnthropicModelRunner(LLModelRunner):
291291
"""Wraps Anthropic's models."""
292292

293-
# Last update: 2023-08-15
293+
# Last update: 2023-12-19
294294
COST_PER_TOKEN = {
295295
"claude-2": {
296-
"input": 11.02e-6,
297-
"output": 32.68e-6,
296+
"input": 8e-6,
297+
"output": 24e-6,
298298
},
299299
"claude-instant": {
300-
"input": 1.63e-6,
301-
"output": 5.51e-6,
300+
"input": 0.8e-6,
301+
"output": 2.4e-6,
302302
},
303303
}
304304

@@ -370,9 +370,6 @@ def _get_cost_estimate(self, response: Dict[str, Any]) -> float:
370370
class CohereGenerateModelRunner(LLModelRunner):
371371
"""Wraps Cohere's Generate model."""
372372

373-
# Last update: 2023-08-15
374-
COST_PER_TOKEN = 0.000015
375-
376373
def __init__(
377374
self,
378375
logger: Optional[logging.Logger] = None,
@@ -444,16 +441,24 @@ def _get_cost_estimate(self, response: Dict[str, Any]) -> float:
444441
class OpenAIChatCompletionRunner(LLModelRunner):
445442
"""Wraps OpenAI's chat completion model."""
446443

447-
# Last update: 2023-08-15
444+
# Last update: 2023-12-19
448445
COST_PER_TOKEN = {
449-
"gpt-3.5-turbo": {
446+
"gpt-3.5-turbo-1106": {
447+
"input": 0.001e-3,
448+
"output": 0.002e-3,
449+
},
450+
"gpt-3.5-turbo-instruct": {
450451
"input": 0.0015e-3,
451452
"output": 0.002e-3,
452453
},
453454
"gpt-4": {
454455
"input": 0.03e-3,
455456
"output": 0.06e-3,
456457
},
458+
"gpt-4-32k": {
459+
"input": 0.06e-3,
460+
"output": 0.12e-3,
461+
},
457462
}
458463

459464
def __init__(

0 commit comments

Comments
 (0)