diff --git a/llama_cpp/server/__main__.py b/llama_cpp/server/__main__.py index a294ebf..45fc5a8 100644 --- a/llama_cpp/server/__main__.py +++ b/llama_cpp/server/__main__.py @@ -96,5 +96,6 @@ if __name__ == "__main__": app = create_app(settings=settings) uvicorn.run( - app, host=os.getenv("HOST", settings.host), port=int(os.getenv("PORT", settings.port)) + app, host=os.getenv("HOST", settings.host), port=int(os.getenv("PORT", settings.port)), + ssl_keyfile=settings.ssl_keyfile, ssl_certfile=settings.ssl_certfile ) diff --git a/llama_cpp/server/app.py b/llama_cpp/server/app.py index a2dad56..7138cf4 100644 --- a/llama_cpp/server/app.py +++ b/llama_cpp/server/app.py @@ -150,6 +150,13 @@ class Settings(BaseSettings): # Server Params host: str = Field(default="localhost", description="Listen address") port: int = Field(default=8000, description="Listen port") + # SSL Params + ssl_keyfile: Optional[str] = Field( + default=None, description="SSL key file for HTTPS" + ) + ssl_certfile: Optional[str] = Field( + default=None, description="SSL certificate file for HTTPS" + ) interrupt_requests: bool = Field( default=True, description="Whether to interrupt requests when a new request is received.",