mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 12:21:52 +00:00
Fixes post-review and split TGI adapter into local and Inference Endpoints ones
This commit is contained in:
parent
5ab4fd31f7
commit
b96e705680
3 changed files with 98 additions and 17 deletions
|
@ -12,11 +12,25 @@ from pydantic import BaseModel, Field, field_validator
|
|||
|
||||
@json_schema_type
|
||||
class TGIImplConfig(BaseModel):
|
||||
url: str = Field(
|
||||
default="https://huggingface.co/inference-endpoints/dedicated",
|
||||
description="The URL for the TGI endpoint",
|
||||
url: Optional[str] = Field(
|
||||
default=None,
|
||||
description="The URL for the local TGI endpoint (e.g., http://localhost:8080)",
|
||||
)
|
||||
api_token: Optional[str] = Field(
|
||||
default="",
|
||||
description="The HF token for Hugging Face Inference Endpoints",
|
||||
default=None,
|
||||
description="The HF token for Hugging Face Inference Endpoints (will default to locally saved token if not provided)",
|
||||
)
|
||||
hf_namespace: Optional[str] = Field(
|
||||
default=None,
|
||||
description="The username/organization name for the Hugging Face Inference Endpoint",
|
||||
)
|
||||
hf_endpoint_name: Optional[str] = Field(
|
||||
default=None,
|
||||
description="The name of the Hugging Face Inference Endpoint",
|
||||
)
|
||||
|
||||
def is_inference_endpoint(self) -> bool:
|
||||
return self.hf_namespace is not None and self.hf_endpoint_name is not None
|
||||
|
||||
def is_local_tgi(self) -> bool:
|
||||
return self.url is not None and self.url.startswith("http://localhost")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue