feat(api): load serve settings from config

Read serve host, port, and timeout from config by default, keep CLI flags higher priority, and bind the API to localhost by default for safer local usage.
This commit is contained in:
Xubin Ren
2026-03-29 15:32:33 +00:00
parent a0684978fb
commit 5635907e33
4 changed files with 206 additions and 82 deletions
+1 -1
View File
@@ -192,7 +192,7 @@ def create_app(agent_loop, model_name: str = "nanobot", request_timeout: float =
return app
def run_server(agent_loop, host: str = "0.0.0.0", port: int = 8900,
def run_server(agent_loop, host: str = "127.0.0.1", port: int = 8900,
model_name: str = "nanobot", request_timeout: float = 120.0) -> None:
"""Create and run the server (blocking)."""
app = create_app(agent_loop, model_name=model_name, request_timeout=request_timeout)