@@ -18,26 +18,27 @@ def get_openai_server_config(
1818 config = OpenAIServerConfig ()
1919 log_file = config .get ("log_file" , log_file )
2020
21- # Extract step from lora_path for multi-checkpoint support
22- # lora_path format is: {output_dir}/checkpoints/{ step:04d}
23- lora_name = model_name
21+ # Build LoRA modules list for multi-checkpoint support
22+ # Register under both model_name (for "current" model) and model_name@ step (for specific checkpoint)
23+ lora_modules : list [ str ] | None = None
2424 if lora_path :
2525 step = int (os .path .basename (lora_path ))
26- lora_name = f"{ model_name } @{ step } "
26+ lora_modules = [
27+ f'{{"name": "{ model_name } ", "path": "{ lora_path } "}}' ,
28+ f'{{"name": "{ model_name } @{ step } ", "path": "{ lora_path } "}}' ,
29+ ]
2730
2831 server_args = ServerArgs (
2932 api_key = "default" ,
30- lora_modules = (
31- [f'{{"name": "{ lora_name } ", "path": "{ lora_path } "}}' ] if lora_path else None
32- ),
33+ lora_modules = lora_modules ,
3334 return_tokens_as_token_ids = True ,
3435 enable_auto_tool_choice = True ,
3536 tool_call_parser = "hermes" ,
3637 )
3738 server_args .update (config .get ("server_args" , {}))
3839 engine_args = EngineArgs (
3940 model = base_model ,
40- served_model_name = base_model if lora_path else model_name ,
41+ served_model_name = model_name ,
4142 generation_config = "vllm" ,
4243 )
4344 engine_args .update (config .get ("engine_args" , {}))
0 commit comments