mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-26 13:18:04 +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
4d0d2d685f
commit
31cc971503
14 changed files with 226 additions and 174 deletions
|
|
@ -10,6 +10,7 @@ from typing import Any
|
|||
from pydantic import BaseModel
|
||||
|
||||
from llama_stack.apis.providers import ListProvidersResponse, ProviderInfo, Providers
|
||||
from llama_stack.distribution.distribution import resolve_config
|
||||
from llama_stack.log import get_logger
|
||||
from llama_stack.providers.datatypes import HealthResponse, HealthStatus
|
||||
|
||||
|
|
@ -51,12 +52,13 @@ class ProviderImpl(Providers):
|
|||
# Skip providers that are not enabled
|
||||
if p.provider_id is None:
|
||||
continue
|
||||
config = resolve_config(provider=p, api=api)
|
||||
ret.append(
|
||||
ProviderInfo(
|
||||
api=api,
|
||||
provider_id=p.provider_id,
|
||||
provider_type=p.provider_type,
|
||||
config=p.config,
|
||||
config=dict(config),
|
||||
health=providers_health.get(api, {}).get(
|
||||
p.provider_id,
|
||||
HealthResponse(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue