mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
compute cost
This commit is contained in:
parent
d2b9cb9e98
commit
5c432592cd
2 changed files with 34 additions and 4 deletions
|
@ -11,6 +11,9 @@ class Model:
|
|||
use_repo_map = False
|
||||
send_undo_reply = False
|
||||
|
||||
prompt_price = None
|
||||
completion_price = None
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
|
||||
|
@ -33,11 +36,27 @@ class Model:
|
|||
self.edit_format = "diff"
|
||||
self.use_repo_map = True
|
||||
self.send_undo_reply = True
|
||||
|
||||
if tokens == 8:
|
||||
self.prompt_price = 0.03
|
||||
self.completion_price = 0.06
|
||||
elif tokens == 32:
|
||||
self.prompt_price = 0.06
|
||||
self.completion_price = 0.12
|
||||
|
||||
return
|
||||
|
||||
if self.is_gpt35():
|
||||
self.edit_format = "whole-func"
|
||||
self.always_available = True
|
||||
|
||||
if tokens == 4:
|
||||
self.prompt_price = 0.0015
|
||||
self.completion_price = 0.002
|
||||
elif tokens == 16:
|
||||
self.prompt_price = 0.003
|
||||
self.completion_price = 0.004
|
||||
|
||||
return
|
||||
|
||||
raise ValueError(f"Unsupported model: {name}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue