mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 12:07:34 +00:00
parent
ee77431b64
commit
665ab1f812
4 changed files with 128 additions and 3 deletions
|
@ -365,8 +365,20 @@ async def resolve_impls(
|
|||
)
|
||||
specs[api] = providers[item.provider_id]
|
||||
else:
|
||||
raise ValueError(
|
||||
f"Please define routing table in provider_routing_table of run config"
|
||||
assert isinstance(item, list)
|
||||
inner_specs = []
|
||||
for rt_entry in item:
|
||||
if rt_entry.provider_id not in providers:
|
||||
raise ValueError(
|
||||
f"Unknown provider `{rt_entry.provider_id}` is not available for API `{api}`"
|
||||
)
|
||||
inner_specs.append(providers[rt_entry.provider_id])
|
||||
|
||||
specs[api] = RouterProviderSpec(
|
||||
api=api,
|
||||
module=f"llama_stack.providers.routers.{api.value.lower()}",
|
||||
api_dependencies=[],
|
||||
inner_specs=inner_specs,
|
||||
)
|
||||
|
||||
sorted_specs = topological_sort(specs.values())
|
||||
|
@ -393,7 +405,7 @@ def main(yaml_config: str, port: int = 5000, disable_ipv6: bool = False):
|
|||
if config.provider_routing_table is not None:
|
||||
impls, specs = asyncio.run(resolve_impls_with_routing(config))
|
||||
else:
|
||||
# keeping this for backwards compatibility
|
||||
# keeping this for backwards compatibility,could
|
||||
impls, specs = asyncio.run(resolve_impls(config.provider_map))
|
||||
|
||||
if Api.telemetry in impls:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue