From dd7427f94a98a5320134d52e31526ee6a72ec9e8 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 28 Feb 2026 08:01:47 -0700 Subject: [PATCH] Cast context size --- frigate/genai/llama_cpp.py | 2 +- frigate/genai/ollama.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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(