@@ -214,6 +214,26 @@ def load_plugins():
214214 if not plugin_approaches :
215215 logger .warning ("No plugins loaded from any location" )
216216
217+ def get_config_path ():
218+ # Get installed package config directory
219+ import optillm
220+ package_config_dir = os .path .join (os .path .dirname (optillm .__file__ ), 'cepo' , 'configs' )
221+ package_config_path = os .path .join (package_config_dir , 'cepo_config.yaml' )
222+
223+ # Get local project config directory
224+ current_dir = os .getcwd () if server_config .get ("config_dir" , "" ) == "" else server_config ["config_dir" ]
225+ local_config_dir = os .path .join (current_dir , 'optillm' , 'cepo' , 'configs' )
226+ local_config_path = os .path .join (local_config_dir , 'cepo_config.yaml' )
227+
228+ # If local config exists and is different from package config, use local
229+ if os .path .exists (local_config_path ) and local_config_path != package_config_path :
230+ logger .debug (f"Using local config from: { local_config_path } " )
231+ return local_config_path
232+
233+ # Otherwise use package config
234+ logger .debug (f"Using package config from: { package_config_path } " )
235+ return package_config_path
236+
217237def parse_combined_approach (model : str , known_approaches : list , plugin_approaches : dict ):
218238 if model == 'auto' :
219239 return 'SINGLE' , ['none' ], model
@@ -701,13 +721,24 @@ def parse_args():
701721 base_url_default = os .environ .get ("OPTILLM_BASE_URL" , "" )
702722 parser .add_argument ("--base-url" , "--base_url" , dest = "base_url" , type = str , default = base_url_default ,
703723 help = "Base url for OpenAI compatible endpoint" )
724+
725+ # Use the function to get the default path
726+ default_config_path = get_config_path ()
704727
705728 # Special handling of all the CePO Configurations
706729 for field in fields (CepoConfig ):
707- parser .add_argument (f"--cepo_{ field .name } " , dest = f"cepo_{ field .name } " , type = field .type , default = None , help = f"CePO configuration for { field .name } " )
708-
709- parser .add_argument (f"--cepo_config_file" , dest = f"cepo_config_file" , type = str , default = "./optillm/cepo/configs/cepo_config.yaml" , help = "Path to CePO configuration file" )
710-
730+ parser .add_argument (f"--cepo_{ field .name } " ,
731+ dest = f"cepo_{ field .name } " ,
732+ type = field .type ,
733+ default = None ,
734+ help = f"CePO configuration for { field .name } " )
735+
736+ parser .add_argument ("--cepo_config_file" ,
737+ dest = "cepo_config_file" ,
738+ type = str ,
739+ default = default_config_path ,
740+ help = "Path to CePO configuration file" )
741+
711742 args = parser .parse_args ()
712743
713744 # Convert argument names to match server_config keys
0 commit comments