From 12212f5e38f23493c434b7b57d8a56214f59df4a Mon Sep 17 00:00:00 2001 From: Xiao Cui Date: Sat, 3 Jan 2026 22:01:29 -0500 Subject: [PATCH] fix: handle None root_model in lm_handler When users call llm_query(prompt) without specifying a model, request.model is None. The handler correctly uses the default client but was recording None as root_model, causing TypeError in verbose printer. Now falls back to client.model_name when request.model is None. --- rlm/core/lm_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rlm/core/lm_handler.py b/rlm/core/lm_handler.py index 86e7cc95f..36d27b3a1 100644 --- a/rlm/core/lm_handler.py +++ b/rlm/core/lm_handler.py @@ -54,7 +54,7 @@ def _handle_single(self, request: LMRequest, handler: "LMHandler") -> LMResponse usage_summary = client.get_last_usage() return LMResponse.success_response( chat_completion=RLMChatCompletion( - root_model=request.model, + root_model=request.model or client.model_name, prompt=request.prompt, response=content, usage_summary=usage_summary, @@ -80,7 +80,7 @@ async def run_all(): chat_completions = [ RLMChatCompletion( - root_model=request.model, + root_model=request.model or client.model_name, prompt=prompt, response=content, usage_summary=usage_summary,