From ee98eb279bd840c5909c8eb625c222987871ec3d Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 11 Feb 2025 18:58:42 -0500 Subject: [PATCH] fix: filter out remote::sample providers when listing Signed-off-by: Ihar Hrachyshka --- llama_stack/cli/stack/list_providers.py | 2 +- llama_stack/providers/datatypes.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llama_stack/cli/stack/list_providers.py b/llama_stack/cli/stack/list_providers.py index 909fea030..bd152c980 100644 --- a/llama_stack/cli/stack/list_providers.py +++ b/llama_stack/cli/stack/list_providers.py @@ -47,7 +47,7 @@ class StackListProviders(Subcommand): rows = [] for spec in providers_for_api.values(): - if spec.provider_type == "sample": + if spec.is_sample: continue rows.append( [ diff --git a/llama_stack/providers/datatypes.py b/llama_stack/providers/datatypes.py index d0c448f8c..8df91cce6 100644 --- a/llama_stack/providers/datatypes.py +++ b/llama_stack/providers/datatypes.py @@ -86,6 +86,10 @@ class ProviderSpec(BaseModel): # used internally by the resolver; this is a hack for now deps__: List[str] = Field(default_factory=list) + @property + def is_sample(self) -> bool: + return self.provider_type in ("sample", "remote::sample") + class RoutingTable(Protocol): def get_provider_impl(self, routing_key: str) -> Any: ...