mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-01 12:08:39 +00:00
feat: convert provider config to a file path
currently provider.config is a dictionary. Introduce the ability to specify either a file path or the current in-file dictionary. Allowing users to specify a file path enables more robust config management allowing stack administrators to swap in different provider configs seamlessly Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
parent
68d8f2186f
commit
9e3ea654c1
44 changed files with 266 additions and 235 deletions
|
@ -16,6 +16,7 @@ from llama_stack.distribution.datatypes import (
|
|||
from llama_stack.distribution.distribution import (
|
||||
builtin_automatically_routed_apis,
|
||||
get_provider_registry,
|
||||
resolve_config,
|
||||
)
|
||||
from llama_stack.distribution.utils.config_dirs import EXTERNAL_PROVIDERS_DIR
|
||||
from llama_stack.distribution.utils.dynamic import instantiate_class_type
|
||||
|
@ -30,7 +31,7 @@ def configure_single_provider(registry: dict[str, ProviderSpec], provider: Provi
|
|||
config_type = instantiate_class_type(provider_spec.config_class)
|
||||
try:
|
||||
if provider.config:
|
||||
existing = config_type(**provider.config)
|
||||
existing = resolve_config(provider=provider, provider_spec=provider_spec)
|
||||
else:
|
||||
existing = None
|
||||
except Exception:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue