From a483a58c6e180e60c7829bb3fde3926da16f9a55 Mon Sep 17 00:00:00 2001 From: Charlie Doern Date: Wed, 19 Mar 2025 23:27:06 -0400 Subject: [PATCH] chore: deprecate /v1/inspect/providers (#1678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What does this PR do? with the new /v1/providers API, /v1/inspect/providers is duplicative, deprecate it by removing the route, and add a test for the full /v1/providers API resolves #1623 ## Test Plan `uv run pytest -v tests/integration/providers --stack-config=ollama --text-model="meta-llama/Llama-3.2-3B-Instruct" --embedding-model=all-MiniLM-L6-v2` Screenshot 2025-03-18 at 9 18 38 AM Signed-off-by: Charlie Doern --- distributions/ramalama/faiss_store.db | Bin 0 -> 12288 bytes docs/_static/llama-stack-spec.html | 2 +- docs/_static/llama-stack-spec.yaml | 2 +- llama_stack/apis/inspect/inspect.py | 14 ------------ llama_stack/distribution/inspect.py | 20 ------------------ tests/integration/providers/test_providers.py | 5 +++++ 6 files changed, 7 insertions(+), 36 deletions(-) create mode 100644 distributions/ramalama/faiss_store.db diff --git a/distributions/ramalama/faiss_store.db b/distributions/ramalama/faiss_store.db new file mode 100644 index 0000000000000000000000000000000000000000..573e60e9016d6aad4fdac203452cfb33084c8157 GIT binary patch literal 12288 zcmeI#F-yZh6bJBkQB(>g**au-qk;+|I2+3i#Rh76Lpy~NPY8{Trq@yzLBE~f$kAL# zCIj6Z%KyRLtIKzVpv#Y0 z-~S=c56BPv?_CE_hX4d1009U<00Izz00bZa0SNquz~_xP9)zLz8e09Bo5f~ji?Ut3 zVIm_XSw(ka$xV$-93^wUm-F+^og1C6O})3fZnm#ksclv)S&d>j zRZ%?o^P;m0?`RN(g0kh4*{ ListProvidersResponse: ... - @webmethod(route="/inspect/routes", method="GET") async def list_routes(self) -> ListRoutesResponse: ... diff --git a/llama_stack/distribution/inspect.py b/llama_stack/distribution/inspect.py index fddb62570..ba0ce5ea2 100644 --- a/llama_stack/distribution/inspect.py +++ b/llama_stack/distribution/inspect.py @@ -11,9 +11,7 @@ from pydantic import BaseModel from llama_stack.apis.inspect import ( HealthInfo, Inspect, - ListProvidersResponse, ListRoutesResponse, - ProviderInfo, RouteInfo, VersionInfo, ) @@ -39,24 +37,6 @@ class DistributionInspectImpl(Inspect): async def initialize(self) -> None: pass - async def list_providers(self) -> ListProvidersResponse: - run_config = self.config.run_config - - ret = [] - for api, providers in run_config.providers.items(): - ret.extend( - [ - ProviderInfo( - api=api, - provider_id=p.provider_id, - provider_type=p.provider_type, - ) - for p in providers - ] - ) - - return ListProvidersResponse(data=ret) - async def list_routes(self) -> ListRoutesResponse: run_config = self.config.run_config diff --git a/tests/integration/providers/test_providers.py b/tests/integration/providers/test_providers.py index 174d01b5c..748a831b9 100644 --- a/tests/integration/providers/test_providers.py +++ b/tests/integration/providers/test_providers.py @@ -15,3 +15,8 @@ class TestProviders: def test_list(self, llama_stack_client: LlamaStackAsLibraryClient | LlamaStackClient): provider_list = llama_stack_client.providers.list() assert provider_list is not None + + @pytest.mark.asyncio + def test_inspect(self, llama_stack_client: LlamaStackAsLibraryClient | LlamaStackClient): + provider_list = llama_stack_client.providers.retrieve("ollama") + assert provider_list is not None