From 5839c610023a0b8932c70b822bad19ca5b74c416 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Mon, 16 Sep 2024 13:00:39 -0700 Subject: [PATCH] stage back models api --- llama_toolchain/models/api/api.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/llama_toolchain/models/api/api.py b/llama_toolchain/models/api/api.py index f18d421f2..ee1d5f0ba 100644 --- a/llama_toolchain/models/api/api.py +++ b/llama_toolchain/models/api/api.py @@ -11,31 +11,4 @@ from llama_models.schema_utils import webmethod # noqa: F401 from pydantic import BaseModel # noqa: F401 -@json_schema_type -class ModelSpec(BaseModel): - model_name: str = Field(description="Name of the model") - providers_spec: Dict[Api, Dict[str, str]] = Field( - default_factory=dict, - description="Map of API to the concrete provider specs. E.g. {}".format( - { - "inference": { - "provider_type": "remote::tgi", - "url": "localhost::5555", - "api_token": "hf_xxx", - } - } - ), - ) - - -class Models(Protocol): - @webmethod(route="/models/list", method="GET") - async def list_models(self) -> List[ModelSpec]: ... - - @webmethod(route="/models/get", method="GET") - async def get_model(self, model_name: str) -> ModelSpec: ... - - @webmethod(route="/models/register") - async def register_model( - self, name: str, provider: Api, provider_spec: Dict[str, str] - ) -> ModelSpec: ... +class Models(Protocol): ...