-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: handle missing external_providers_dir #3974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,6 @@ | |
| get_provider_registry, | ||
| ) | ||
| from llama_stack.core.stack import cast_image_name_to_string, replace_env_vars | ||
| from llama_stack.core.utils.config_dirs import EXTERNAL_PROVIDERS_DIR | ||
| from llama_stack.core.utils.dynamic import instantiate_class_type | ||
| from llama_stack.core.utils.prompt_for_config import prompt_for_config | ||
| from llama_stack.log import get_logger | ||
|
|
@@ -194,19 +193,11 @@ def get_providers(entries): | |
|
|
||
|
|
||
| def parse_and_maybe_upgrade_config(config_dict: dict[str, Any]) -> StackRunConfig: | ||
| version = config_dict.get("version", None) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question here, is this necessary? I might be missing something but this seems like a separate codepath. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worries! This removes code that was used for an early-return micro optimization. Now that it's removed, it will apply the same processing to configs regardless of version. E.g. configs with version 2 would've skipped the The removals should align with the intended deprecation of |
||
| if version == LLAMA_STACK_RUN_CONFIG_VERSION: | ||
| processed_config_dict = replace_env_vars(config_dict) | ||
| return StackRunConfig(**cast_image_name_to_string(processed_config_dict)) | ||
|
|
||
| if "routing_table" in config_dict: | ||
| logger.info("Upgrading config...") | ||
| config_dict = upgrade_from_routing_table(config_dict) | ||
|
|
||
| config_dict["version"] = LLAMA_STACK_RUN_CONFIG_VERSION | ||
|
|
||
| if not config_dict.get("external_providers_dir", None): | ||
| config_dict["external_providers_dir"] = EXTERNAL_PROVIDERS_DIR | ||
|
|
||
| processed_config_dict = replace_env_vars(config_dict) | ||
| return StackRunConfig(**cast_image_name_to_string(processed_config_dict)) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to remove the definition of this constant as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think EXTERNAL_PROVIDERS_DIR is used elsewhere in the codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I can confirm that
EXTERNAL_PROVIDERS_DIRis still being used in thegenerate_run_configfunction insrc/llama_stack/cli/stack/utils.py.