diff --git a/frigate/genai/llama_cpp.py b/frigate/genai/llama_cpp.py index 69b4cac28..24dcea2fb 100644 --- a/frigate/genai/llama_cpp.py +++ b/frigate/genai/llama_cpp.py @@ -102,7 +102,7 @@ class LlamaCppClient(GenAIClient): def get_context_size(self) -> int: """Get the context window size for llama.cpp.""" - return self.provider_options.get("context_size", 4096) + return int(self.provider_options.get("context_size", 4096)) def _build_payload( self, diff --git a/frigate/genai/ollama.py b/frigate/genai/ollama.py index 4efedf64a..73ba2171e 100644 --- a/frigate/genai/ollama.py +++ b/frigate/genai/ollama.py @@ -85,8 +85,8 @@ class OllamaClient(GenAIClient): def get_context_size(self) -> int: """Get the context window size for Ollama.""" - return self.genai_config.provider_options.get("options", {}).get( - "num_ctx", 4096 + return int( + self.genai_config.provider_options.get("options", {}).get("num_ctx", 4096) ) def _build_request_params(