File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,6 +210,9 @@ def fetch_llm_info_with_retry(max_attempts: int = 15, delay_seconds: float = 2.0
210210 Try to fetch LLM info with retries so the UI doesn't crash if the worker
211211 isn't ready yet (e.g., cold start or delayed boot).
212212 """
213+ if max_attempts < 1 :
214+ raise ValueError ("max_attempts must be >= 1" )
215+
213216 for attempt in range (1 , max_attempts + 1 ):
214217 try :
215218 return worker_client .get_llm_info ()
@@ -225,6 +228,8 @@ def fetch_llm_info_with_retry(max_attempts: int = 15, delay_seconds: float = 2.0
225228 raise
226229 time .sleep (delay_seconds )
227230
231+ raise RuntimeError ("Unable to fetch LLM info after retry loop" )
232+
228233llm_info : LLMInfo = fetch_llm_info_with_retry ()
229234logger .info (f"LLMInfo.ollama_status: { llm_info .ollama_status .value } " )
230235logger .info (f"LLMInfo.error_message_list: { llm_info .error_message_list } " )
You can’t perform that action at this time.
0 commit comments