From b322b48b82008972169b366b21de0f9107654529 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 30 Oct 2025 06:09:42 -0600 Subject: [PATCH] Add logging for context tokens used --- frigate/genai/ollama.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frigate/genai/ollama.py b/frigate/genai/ollama.py index 4649e83c5..374698b8e 100644 --- a/frigate/genai/ollama.py +++ b/frigate/genai/ollama.py @@ -64,6 +64,9 @@ class OllamaClient(GenAIClient): images=images if images else None, **self.provider_options, ) + logger.debug( + f"Ollama tokens used: eval_count={result.get('eval_count')}, prompt_eval_count={result.get('prompt_eval_count')}" + ) return result["response"].strip() except (TimeoutException, ResponseError) as e: logger.warning("Ollama returned an error: %s", str(e))