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:
Charlie Doern 2025-06-23 11:20:54 -04:00
parent 68d8f2186f
commit 9e3ea654c1
44 changed files with 266 additions and 235 deletions

View file

@ -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
@ -48,12 +49,13 @@ class ProviderImpl(Providers):
ret = []
for api, providers in safe_config.providers.items():
for p in providers:
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(