Convert TGI

This commit is contained in:
Ashwin Bharambe 2024-11-17 14:49:41 -08:00
parent 9bb07ce298
commit 028530546f
14 changed files with 485 additions and 160 deletions

View file

@ -12,19 +12,20 @@ from pydantic import BaseModel, Field
@json_schema_type
class TGIImplConfig(BaseModel):
host: str = "localhost"
port: int = 8080
protocol: str = "http"
@property
def url(self) -> str:
return f"{self.protocol}://{self.host}:{self.port}"
url: str = Field(
description="The URL for the TGI serving endpoint",
)
api_token: Optional[str] = Field(
default=None,
description="A bearer token if your TGI endpoint is protected.",
)
@classmethod
def sample_run_config(cls, url: str = "${env.TGI_URL}"):
return {
"url": url,
}
@json_schema_type
class InferenceEndpointImplConfig(BaseModel):