diff --git a/deploy/proxy.Dockerfile b/deploy/proxy.Dockerfile index 535e2b75..592e7387 100644 --- a/deploy/proxy.Dockerfile +++ b/deploy/proxy.Dockerfile @@ -6,6 +6,6 @@ RUN apt-get clean && apt-get update # Install llmstudio ARG LLMSTUDIO_VERSION -RUN pip install 'llmstudio[proxy]'==${LLMSTUDIO_VERSION} +RUN pip install 'llmstudio-proxy'==${LLMSTUDIO_VERSION} -CMD ["llmstudio", "server", "--proxy"] +CMD ["llmstudio-proxy", "server"] diff --git a/deploy/tracker.Dockerfile b/deploy/tracker.Dockerfile index c9f80678..0fab9464 100644 --- a/deploy/tracker.Dockerfile +++ b/deploy/tracker.Dockerfile @@ -6,7 +6,7 @@ RUN apt-get clean && apt-get update # Install llmstudio ARG LLMSTUDIO_VERSION -RUN pip install 'llmstudio[tracker]'==${LLMSTUDIO_VERSION} +RUN pip install 'llmstudio-tracker'==${LLMSTUDIO_VERSION} RUN pip install psycopg2-binary -CMD ["llmstudio", "server", "--tracker"] +CMD ["llmstudio-tracker", "server"] diff --git a/libs/proxy/llmstudio_proxy/cli.py b/libs/proxy/llmstudio_proxy/cli.py new file mode 100644 index 00000000..092598f2 --- /dev/null +++ b/libs/proxy/llmstudio_proxy/cli.py @@ -0,0 +1,35 @@ +import os +import signal +import threading + +import click +from llmstudio_proxy.server import setup_engine_server + + +def handle_shutdown(signum, frame): + print("Shutting down gracefully...") + os._exit(0) + + +@click.group() +def main(): + pass + + +@main.command() +def server(): + signal.signal(signal.SIGINT, handle_shutdown) + + setup_engine_server() + + print("Press CTRL+C to stop.") + + stop_event = threading.Event() + try: + stop_event.wait() + except KeyboardInterrupt: + print("Shutting down server...") + + +if __name__ == "__main__": + main() diff --git a/libs/proxy/pyproject.toml b/libs/proxy/pyproject.toml index 30248455..2b086892 100644 --- a/libs/proxy/pyproject.toml +++ b/libs/proxy/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "llmstudio-proxy" -version = "1.0.2" +version = "1.0.3a0" description = "" authors = ["Diogo Goncalves "] readme = "README.md" @@ -19,6 +19,9 @@ llmstudio-core = "^1.0.0" [tool.poetry.group.dev.dependencies] llmstudio-core = { path = "../core/", develop = true } +[tool.poetry.scripts] +llmstudio-proxy = "llmstudio_proxy.cli:main" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/libs/tracker/llmstudio_tracker/cli.py b/libs/tracker/llmstudio_tracker/cli.py new file mode 100644 index 00000000..52320da6 --- /dev/null +++ b/libs/tracker/llmstudio_tracker/cli.py @@ -0,0 +1,35 @@ +import os +import signal +import threading + +import click +from llmstudio_tracker.server import setup_tracking_server + + +def handle_shutdown(signum, frame): + print("Shutting down gracefully...") + os._exit(0) + + +@click.group() +def main(): + pass + + +@main.command() +def server(): + signal.signal(signal.SIGINT, handle_shutdown) + + setup_tracking_server() + + print("Press CTRL+C to stop.") + + stop_event = threading.Event() + try: + stop_event.wait() + except KeyboardInterrupt: + print("Shutting down server...") + + +if __name__ == "__main__": + main() diff --git a/libs/tracker/pyproject.toml b/libs/tracker/pyproject.toml index 949228bf..86ad1b0a 100644 --- a/libs/tracker/pyproject.toml +++ b/libs/tracker/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "llmstudio-tracker" -version = "1.0.3" -description = "LLMstudio Tracker is the module of LLMstudio that allows monitoring and logging your LLM calls. It supports seamless integration with the LLMstudio environment through configurable tracking servers, allowing for detailed insights into synchronous and asynchronous chat interactions. By leveraging LLMstudio Tracker, users can gain insights on model performance and streamline development workflows with actionable analytics." +version = "1.0.4a0" +description = "LLMstudio Tracker is the module of LLMstudio that allows monitoring and logging your LLM calls. By leveraging LLMstudio Tracker, users can gain insights on model performance and streamline development workflows with actionable analytics." authors = ["Diogo Goncalves "] readme = "README.md" @@ -16,6 +16,9 @@ uvicorn = "^0.27" sqlalchemy-bigquery = "^1.12.0" google-cloud-bigquery-storage = "^2.27.0" +[tool.poetry.scripts] +llmstudio-proxy = "llmstudio_tracker.cli:main" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"