From 110ec479cb06861f735c9f211b05e35f5b99fb14 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Thu, 13 Feb 2025 10:43:16 -0800 Subject: [PATCH] use archfc hosted on aws --- model_server/src/cli.py | 8 ++++---- model_server/src/commons/globals.py | 2 +- model_server/src/main.py | 4 +++- tests/rest/api_model_server.rest | 5 ++--- tests/rest/insurance_agent.rest | 6 +++--- tests/rest/network_agent.rest | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/model_server/src/cli.py b/model_server/src/cli.py index 5245873e..d015063a 100644 --- a/model_server/src/cli.py +++ b/model_server/src/cli.py @@ -129,18 +129,18 @@ def stop_server(): pid_file = get_pid_file() if os.path.exists(pid_file): - logger.info("PID file found, shutting down the server.") + logger.info("pid file found, shutting down the server.") # read pid from file with open(pid_file, "r") as f: pid = int(f.read()) - logger.info(f"Killing model server {pid}") + logger.info(f"killing model server {pid}") try: os.kill(pid, signal.SIGKILL) except ProcessLookupError: - logger.info(f"Process {pid} not found") + logger.info(f"process {pid} not found") os.remove(pid_file) else: - logger.info("No PID file found, server is not running.") + logger.info("no pid file found, server is not running.") def restart_server(port=51000, foreground=False): diff --git a/model_server/src/commons/globals.py b/model_server/src/commons/globals.py index 68c2e53a..2f533024 100644 --- a/model_server/src/commons/globals.py +++ b/model_server/src/commons/globals.py @@ -15,7 +15,7 @@ logger = get_model_server_logger() # Define the client -ARCH_ENDPOINT = os.getenv("ARCH_ENDPOINT", "https://api.fc.archgw.com/v1") +ARCH_ENDPOINT = os.getenv("ARCH_ENDPOINT", "https://archfc.katanemo.dev/v1") ARCH_API_KEY = "EMPTY" ARCH_CLIENT = OpenAI(base_url=ARCH_ENDPOINT, api_key=ARCH_API_KEY) diff --git a/model_server/src/main.py b/model_server/src/main.py index 74f60011..683d6227 100644 --- a/model_server/src/main.py +++ b/model_server/src/main.py @@ -4,7 +4,7 @@ import time import logging import src.commons.utils as utils -from src.commons.globals import handler_map +from src.commons.globals import ARCH_ENDPOINT, handler_map from src.core.utils.model_utils import ( ChatMessage, ChatCompletionResponse, @@ -51,6 +51,8 @@ logging.getLogger("opentelemetry.exporter.otlp.proto.grpc.exporter").setLevel( app = FastAPI() FastAPIInstrumentor().instrument_app(app) +logger.info(f"using archfc endpoint: {ARCH_ENDPOINT}") + @app.get("/healthz") async def healthz(): diff --git a/tests/rest/api_model_server.rest b/tests/rest/api_model_server.rest index ed86fac3..3e5d2f47 100644 --- a/tests/rest/api_model_server.rest +++ b/tests/rest/api_model_server.rest @@ -1,6 +1,5 @@ @model_server_endpoint = http://localhost:51000 -@archfc_endpoint = https://api.fc.archgw.com - +@archfc_endpoint = https://archfc.katanemo.dev ### talk to function calling endpoint POST {{model_server_endpoint}}/function_calling HTTP/1.1 @@ -119,7 +118,7 @@ Content-Type: application/json } ### talk to Arch-Intent directly for completion -POST {{archfc_endpoint}}/v1/chat/completions HTTP/1.1 +POST {{{{archfc_endpoint}}}}/v1/chat/completions HTTP/1.1 Content-Type: application/json { diff --git a/tests/rest/insurance_agent.rest b/tests/rest/insurance_agent.rest index 225c7d8a..c45ebb85 100644 --- a/tests/rest/insurance_agent.rest +++ b/tests/rest/insurance_agent.rest @@ -1,5 +1,5 @@ @model_server_endpoint = http://localhost:51000 -@archfc_endpoint = https://api.fc.archgw.com +@archfc_endpoint = https://archfc.katanemo.dev ### multi turn conversation with intent, except parameter gathering @@ -55,7 +55,7 @@ Content-Type: application/json ] } ### talk to Arch-Intent directly for completion -POST https://api.fc.archgw.com/v1/chat/completions HTTP/1.1 +POST https://archfc.katanemo.dev/v1/chat/completions HTTP/1.1 Content-Type: application/json { @@ -126,7 +126,7 @@ Content-Type: application/json ] } ### talk to Arch-Intent directly for completion, expect No -POST https://api.fc.archgw.com/v1/chat/completions HTTP/1.1 +POST https://archfc.katanemo.dev/v1/chat/completions HTTP/1.1 Content-Type: application/json { diff --git a/tests/rest/network_agent.rest b/tests/rest/network_agent.rest index 319b5106..dc03fa6c 100644 --- a/tests/rest/network_agent.rest +++ b/tests/rest/network_agent.rest @@ -1,5 +1,5 @@ @model_server_endpoint = http://localhost:51000 -@archfc_endpoint = https://api.fc.archgw.com +@archfc_endpoint = https://archfc.katanemo.dev ### single turn function calling all parameters insurance agent summary