mirror of https://github.com/aliasrobotics/cai.git
Add missing alias model cost aspects
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
This commit is contained in:
parent
348a4ceff0
commit
1de6eb540d
|
|
@ -1042,6 +1042,7 @@ class OpenAIChatCompletionsModel(Model):
|
|||
# Check if this is a local model and should have zero cost
|
||||
model_str = str(self.model).lower()
|
||||
is_local_model = (
|
||||
"alias" not in model_str and
|
||||
"ollama" in model_str or
|
||||
"qwen" in model_str or
|
||||
"llama" in model_str or
|
||||
|
|
@ -1099,6 +1100,7 @@ class OpenAIChatCompletionsModel(Model):
|
|||
# Check if this is a local model (Ollama, Qwen, etc.) that should have zero cost
|
||||
model_str = str(self.model).lower()
|
||||
is_local_model = (
|
||||
"alias" not in model_str and
|
||||
"ollama" in model_str or
|
||||
"qwen" in model_str or
|
||||
"llama" in model_str or
|
||||
|
|
@ -1652,6 +1654,7 @@ class OpenAIChatCompletionsModel(Model):
|
|||
# Check if this is a local model and should have zero cost
|
||||
model_str = str(self.model).lower()
|
||||
is_local_model = (
|
||||
"alias" not in model_str and
|
||||
"ollama" in model_str or
|
||||
"qwen" in model_str or
|
||||
"llama" in model_str or
|
||||
|
|
|
|||
|
|
@ -312,6 +312,7 @@ class CostTracker:
|
|||
if os.environ.get("CAI_COST_DISPLAYED", "").lower() == "true":
|
||||
return
|
||||
print(f"\nTotal CAI Session Cost: ${self.session_total_cost:.6f}")
|
||||
|
||||
def get_model_pricing(self, model_name: str) -> tuple:
|
||||
"""Get and cache pricing information for a model"""
|
||||
# Use the centralized function to standardize model names
|
||||
|
|
@ -320,6 +321,7 @@ class CostTracker:
|
|||
# Check if using Ollama or local model
|
||||
model_str = model_name.lower()
|
||||
is_local_model = (
|
||||
"alias" not in model_str and
|
||||
"ollama" in model_str or
|
||||
"qwen" in model_str or
|
||||
"llama" in model_str or
|
||||
|
|
|
|||
Loading…
Reference in New Issue