diff --git a/llama_stack/cli/stack/run.py b/llama_stack/cli/stack/run.py index 842703d4c..5fce8c92c 100644 --- a/llama_stack/cli/stack/run.py +++ b/llama_stack/cli/stack/run.py @@ -48,7 +48,10 @@ class StackRun(Subcommand): from llama_stack.distribution.build import ImageType from llama_stack.distribution.configure import parse_and_maybe_upgrade_config - from llama_stack.distribution.utils.config_dirs import BUILDS_BASE_DIR + from llama_stack.distribution.utils.config_dirs import ( + BUILDS_BASE_DIR, + DISTRIBS_BASE_DIR, + ) from llama_stack.distribution.utils.exec import run_with_pty if not args.config: @@ -68,6 +71,14 @@ class StackRun(Subcommand): BUILDS_BASE_DIR / ImageType.docker.value / f"{args.config}-run.yaml" ) + if not config_file.exists() and not args.config.endswith(".yaml"): + # check if it's a build config saved to ~/.llama dir + config_file = Path( + DISTRIBS_BASE_DIR + / f"llamastack-{args.config}" + / f"{args.config}-run.yaml" + ) + if not config_file.exists(): self.parser.error( f"File {str(config_file)} does not exist. Please run `llama stack build` to generate (and optionally edit) a run.yaml file"