diff --git a/src/cai/sdk/agents/models/openai_chatcompletions.py b/src/cai/sdk/agents/models/openai_chatcompletions.py index 754f2d08..e45aa0e2 100644 --- a/src/cai/sdk/agents/models/openai_chatcompletions.py +++ b/src/cai/sdk/agents/models/openai_chatcompletions.py @@ -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 diff --git a/src/cai/util.py b/src/cai/util.py index ee0ec2d9..40fdc62b 100644 --- a/src/cai/util.py +++ b/src/cai/util.py @@ -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