kikocis/llama-stack public
Changesets · Branches · Tags · Compare
| Changeset | d510759522c8e112a8a1cceb8dd2efb591fa0c6a6d20fd80ecc03dc651639359 |
|---|---|
| Author | Xi Yan <xiyan@meta.com> · 2024-09-16 13:00 -07:00 |
| Committer | Xi Yan <xiyan@meta.com> · 2024-09-16 13:00 -07:00 |
| Parents | 45a7e555f421 |
1 file changed
modified llama_toolchain/models/api/api.py +1 −28
| @@ -11,31 +11,4 @@ | ||
| 11 | 11 | from pydantic import BaseModel # noqa: F401 |
| 12 | 12 | |
| 13 | 13 | |
| 14 | -@json_schema_type | |
| 15 | -class ModelSpec(BaseModel): | |
| 16 | - model_name: str = Field(description="Name of the model") | |
| 17 | - providers_spec: Dict[Api, Dict[str, str]] = Field( | |
| 18 | - default_factory=dict, | |
| 19 | - description="Map of API to the concrete provider specs. E.g. {}".format( | |
| 20 | - { | |
| 21 | - "inference": { | |
| 22 | - "provider_type": "remote::tgi", | |
| 23 | - "url": "localhost::5555", | |
| 24 | - "api_token": "hf_xxx", | |
| 25 | - } | |
| 26 | - } | |
| 27 | - ), | |
| 28 | - ) | |
| 29 | - | |
| 30 | - | |
| 31 | -class Models(Protocol): | |
| 32 | - @webmethod(route="/models/list", method="GET") | |
| 33 | - async def list_models(self) -> List[ModelSpec]: ... | |
| 34 | - | |
| 35 | - @webmethod(route="/models/get", method="GET") | |
| 36 | - async def get_model(self, model_name: str) -> ModelSpec: ... | |
| 37 | - | |
| 38 | - @webmethod(route="/models/register") | |
| 39 | - async def register_model( | |
| 40 | - self, name: str, provider: Api, provider_spec: Dict[str, str] | |
| 41 | - ) -> ModelSpec: ... | |
| 14 | +class Models(Protocol): ... |