From 97feb9213668b09f02d56335ce74c0ddde02b335 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Sun, 22 Sep 2024 21:04:06 -0700 Subject: [PATCH] fix llama stack build --- llama_stack/cli/stack/build.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/llama_stack/cli/stack/build.py b/llama_stack/cli/stack/build.py index dea705628..f787b1a8e 100644 --- a/llama_stack/cli/stack/build.py +++ b/llama_stack/cli/stack/build.py @@ -160,7 +160,11 @@ class StackBuild(Subcommand): def _run_stack_build_command(self, args: argparse.Namespace) -> None: import yaml - from llama_stack.distribution.distribution import Api, api_providers + from llama_stack.distribution.distribution import ( + Api, + api_providers, + builtin_automatically_routed_apis, + ) from llama_stack.distribution.utils.dynamic import instantiate_class_type from prompt_toolkit import prompt from prompt_toolkit.validation import Validator @@ -213,8 +217,15 @@ class StackBuild(Subcommand): ) providers = dict() + all_providers = api_providers() + routing_table_apis = set( + x.routing_table_api for x in builtin_automatically_routed_apis() + ) + for api in Api: - all_providers = api_providers() + if api in routing_table_apis: + continue + providers_for_api = all_providers[api] api_provider = prompt(