Add missing alias model cost aspects

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
This commit is contained in:
Víctor Mayoral Vilches 2025-05-23 11:39:17 +02:00
parent 348a4ceff0
commit 1de6eb540d
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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