diff --git a/llama_cpp/server/__main__.py b/llama_cpp/server/__main__.py index 4fe1d94..748a2af 100644 --- a/llama_cpp/server/__main__.py +++ b/llama_cpp/server/__main__.py @@ -46,5 +46,5 @@ if __name__ == "__main__": app = create_app(settings=settings) uvicorn.run( - app, host=os.getenv("HOST", "localhost"), port=int(os.getenv("PORT", 8000)) + app, host=os.getenv("HOST", settings.host), port=int(os.getenv("PORT", settings.port)) ) diff --git a/llama_cpp/server/app.py b/llama_cpp/server/app.py index f70d8f0..2191005 100644 --- a/llama_cpp/server/app.py +++ b/llama_cpp/server/app.py @@ -72,6 +72,12 @@ class Settings(BaseSettings): verbose: bool = Field( default=True, description="Whether to print debug information." ) + host: str = Field( + default="localhost", description="Listen address" + ) + port: int = Field( + default=8000, description="Listen port" + ) router = APIRouter()