mirror of
				https://github.com/meta-llama/llama-stack.git
				synced 2025-10-26 17:23:00 +00:00 
			
		
		
		
	As the title says. Distributions is in, Templates is out. `llama stack build --template` --> `llama stack build --distro`. For backward compatibility, the previous option is kept but results in a warning. Updated `server.py` to remove the "config_or_template" backward compatibility since it has been a couple releases since that change.
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			806 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			806 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # Copyright (c) Meta Platforms, Inc. and affiliates.
 | |
| # All rights reserved.
 | |
| #
 | |
| # This source code is licensed under the terms described in the LICENSE file in
 | |
| # the root directory of this source tree.
 | |
| 
 | |
| import argparse
 | |
| 
 | |
| from llama_stack.log import get_logger
 | |
| 
 | |
| logger = get_logger(name=__name__, category="cli")
 | |
| 
 | |
| 
 | |
| # TODO: this can probably just be inlined now?
 | |
| def add_config_distro_args(parser: argparse.ArgumentParser):
 | |
|     """Add unified config/distro arguments."""
 | |
|     group = parser.add_mutually_exclusive_group(required=True)
 | |
| 
 | |
|     group.add_argument(
 | |
|         "config",
 | |
|         nargs="?",
 | |
|         help="Configuration file path or distribution name",
 | |
|     )
 | |
| 
 | |
| 
 | |
| def get_config_from_args(args: argparse.Namespace) -> str | None:
 | |
|     if args.config is not None:
 | |
|         return str(args.config)
 | |
|     return None
 |