diff --git a/.github/workflows/e2e_archgw.yml b/.github/workflows/e2e_archgw.yml index 97e2492c..199d184f 100644 --- a/.github/workflows/e2e_archgw.yml +++ b/.github/workflows/e2e_archgw.yml @@ -30,7 +30,7 @@ jobs: - name: build arch docker image run: | - cd ../../ && docker build -f arch/Dockerfile . -t katanemo/archgw -t katanemo/archgw:0.3.22 -t katanemo/archgw:latest + cd ../../ && docker build -f arch/Dockerfile . -t katanemo/plano -t katanemo/plano:0.4.0 -t katanemo/plano:latest - name: start archgw env: diff --git a/.github/workflows/e2e_test_currency_convert.yml b/.github/workflows/e2e_test_currency_convert.yml index 05be3d84..d2334537 100644 --- a/.github/workflows/e2e_test_currency_convert.yml +++ b/.github/workflows/e2e_test_currency_convert.yml @@ -24,7 +24,7 @@ jobs: - name: build arch docker image run: | - docker build -f arch/Dockerfile . -t katanemo/archgw -t katanemo/archgw:0.3.22 + docker build -f arch/Dockerfile . -t katanemo/plano -t katanemo/plano:0.4.0 - name: install poetry run: | diff --git a/.github/workflows/e2e_test_preference_based_routing.yml b/.github/workflows/e2e_test_preference_based_routing.yml index 3f921f60..c2c135e9 100644 --- a/.github/workflows/e2e_test_preference_based_routing.yml +++ b/.github/workflows/e2e_test_preference_based_routing.yml @@ -24,7 +24,7 @@ jobs: - name: build arch docker image run: | - docker build -f arch/Dockerfile . -t katanemo/archgw -t katanemo/archgw:0.3.22 + docker build -f arch/Dockerfile . -t katanemo/plano -t katanemo/plano:0.4.0 - name: install poetry run: | diff --git a/.github/workflows/validate_arch_config.yml b/.github/workflows/validate_arch_config.yml index 19b95980..e3189501 100644 --- a/.github/workflows/validate_arch_config.yml +++ b/.github/workflows/validate_arch_config.yml @@ -24,7 +24,7 @@ jobs: - name: build arch docker image run: | - docker build -f arch/Dockerfile . -t katanemo/archgw -t katanemo/archgw:0.3.22 + docker build -f arch/Dockerfile . -t katanemo/plano -t katanemo/plano:0.4.0 - name: validate arch config run: | diff --git a/README.md b/README.md index ed2c118b..aef094af 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Arch's CLI allows you to manage and interact with the Arch gateway efficiently. ```console $ python3.12 -m venv venv $ source venv/bin/activate # On Windows, use: venv\Scripts\activate -$ pip install archgw==0.3.22 +$ pip install plano==0.4.0 ``` ### Use Arch as a LLM Router @@ -276,7 +276,7 @@ endpoints: ```sh $ archgw up arch_config.yaml -2024-12-05 16:56:27,979 - cli.main - INFO - Starting archgw cli version: 0.3.22 +2024-12-05 16:56:27,979 - cli.main - INFO - Starting archgw cli version: 0.4.0 2024-12-05 16:56:28,485 - cli.utils - INFO - Schema validation successful! 2024-12-05 16:56:28,485 - cli.main - INFO - Starting arch model server and arch gateway 2024-12-05 16:56:51,647 - cli.core - INFO - Container is healthy! diff --git a/arch/tools/README.md b/arch/tools/README.md index c86934a8..98f28968 100644 --- a/arch/tools/README.md +++ b/arch/tools/README.md @@ -1,6 +1,6 @@ -## Setup Instructions(User): archgw CLI +## Setup Instructions(User): plano CLI -This guide will walk you through the steps to set up the archgw cli on your local machine +This guide will walk you through the steps to set up the plano cli on your local machine ### Step 1: Create a Python virtual environment @@ -19,17 +19,17 @@ source venv/bin/activate ### Step 3: Run the build script ```bash -pip install archgw==0.3.22 +pip install plano==0.4.0 ``` -## Uninstall Instructions: archgw CLI +## Uninstall Instructions: plano CLI ```bash -pip uninstall archgw +pip uninstall plano ``` -## Setup Instructions (Dev): archgw CLI +## Setup Instructions (Dev): plano CLI -This guide will walk you through the steps to set up the archgw cli on your local machine when you want to develop the Archgw CLI +This guide will walk you through the steps to set up the plano cli on your local machine when you want to develop the plano CLI ### Step 1: Create a Python virtual environment @@ -53,16 +53,16 @@ poetry install ### Step 4: build Arch ```bash -archgw build +plano build ``` ### Logs -`archgw` command can also view logs from the gateway. Use following command to view logs, +`plano` command can also view logs from the gateway. Use following command to view logs, ```bash -archgw logs --follow +plano logs --follow ``` -## Uninstall Instructions: archgw CLI +## Uninstall Instructions: plano CLI ```bash -pip uninstall archgw +pip uninstall plano diff --git a/arch/tools/cli/consts.py b/arch/tools/cli/consts.py index b768e037..16f0e514 100644 --- a/arch/tools/cli/consts.py +++ b/arch/tools/cli/consts.py @@ -1,5 +1,5 @@ import os -SERVICE_NAME_ARCHGW = "archgw" -ARCHGW_DOCKER_NAME = "archgw" -ARCHGW_DOCKER_IMAGE = os.getenv("ARCHGW_DOCKER_IMAGE", "katanemo/archgw:0.3.22") +SERVICE_NAME_ARCHGW = "plano" +PLANO_DOCKER_NAME = "plano" +PLANO_DOCKER_IMAGE = os.getenv("PLANO_DOCKER_IMAGE", "katanemo/plano:0.4.0") diff --git a/arch/tools/cli/core.py b/arch/tools/cli/core.py index ec1d354a..c8089a6e 100644 --- a/arch/tools/cli/core.py +++ b/arch/tools/cli/core.py @@ -7,14 +7,14 @@ import sys import yaml from cli.utils import convert_legacy_listeners, getLogger from cli.consts import ( - ARCHGW_DOCKER_IMAGE, - ARCHGW_DOCKER_NAME, + PLANO_DOCKER_IMAGE, + PLANO_DOCKER_NAME, ) import subprocess from cli.docker_cli import ( docker_container_status, docker_remove_container, - docker_start_archgw_detached, + docker_start_plano_detached, docker_stop_container, health_check_endpoint, stream_gateway_logs, @@ -39,6 +39,9 @@ def _get_gateway_ports(arch_config_file: str) -> list[int]: all_ports = [listener.get("port") for listener in listeners] + # unique ports + all_ports = list(set(all_ports)) + return all_ports @@ -51,27 +54,26 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False): log_timeout (int): Time in seconds to show logs before checking for healthy state. """ log.info( - f"Starting arch gateway, image name: {ARCHGW_DOCKER_NAME}, tag: {ARCHGW_DOCKER_IMAGE}" + f"Starting arch gateway, image name: {PLANO_DOCKER_NAME}, tag: {PLANO_DOCKER_IMAGE}" ) try: - archgw_container_status = docker_container_status(ARCHGW_DOCKER_NAME) - if archgw_container_status != "not found": - log.info("archgw found in docker, stopping and removing it") - docker_stop_container(ARCHGW_DOCKER_NAME) - docker_remove_container(ARCHGW_DOCKER_NAME) + plano_container_status = docker_container_status(PLANO_DOCKER_NAME) + if plano_container_status != "not found": + log.info("plano found in docker, stopping and removing it") + docker_stop_container(PLANO_DOCKER_NAME) + docker_remove_container(PLANO_DOCKER_NAME) gateway_ports = _get_gateway_ports(arch_config_file) - return_code, _, archgw_stderr = docker_start_archgw_detached( + return_code, _, plano_stderr = docker_start_plano_detached( arch_config_file, - os.path.expanduser("~/archgw_logs"), env, gateway_ports, ) if return_code != 0: - log.info("Failed to start arch gateway: " + str(return_code)) - log.info("stderr: " + archgw_stderr) + log.info("Failed to start plano gateway: " + str(return_code)) + log.info("stderr: " + plano_stderr) sys.exit(1) start_time = time.time() @@ -84,12 +86,12 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False): if not health_check_status: all_listeners_healthy = False - archgw_status = docker_container_status(ARCHGW_DOCKER_NAME) + plano_status = docker_container_status(PLANO_DOCKER_NAME) current_time = time.time() elapsed_time = current_time - start_time - if archgw_status == "exited": - log.info("archgw container exited unexpectedly.") + if plano_status == "exited": + log.info("plano container exited unexpectedly.") stream_gateway_logs(follow=False) sys.exit(1) @@ -100,14 +102,14 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False): sys.exit(1) if all_listeners_healthy: - log.info("archgw is running and is healthy!") + log.info("plano is running and is healthy!") break else: health_check_status_str = ( "healthy" if health_check_status else "not healthy" ) log.info( - f"archgw status: {archgw_status}, health status: {health_check_status_str}" + f"plano status: {plano_status}, health status: {health_check_status_str}" ) time.sleep(1) @@ -119,7 +121,7 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False): stop_docker_container() -def stop_docker_container(service=ARCHGW_DOCKER_NAME): +def stop_docker_container(service=PLANO_DOCKER_NAME): """ Shutdown all Docker Compose services by running `docker-compose down`. diff --git a/arch/tools/cli/docker_cli.py b/arch/tools/cli/docker_cli.py index 2d7bac28..830ba103 100644 --- a/arch/tools/cli/docker_cli.py +++ b/arch/tools/cli/docker_cli.py @@ -4,8 +4,8 @@ import sys import requests from cli.consts import ( - ARCHGW_DOCKER_IMAGE, - ARCHGW_DOCKER_NAME, + PLANO_DOCKER_IMAGE, + PLANO_DOCKER_NAME, ) from cli.utils import getLogger @@ -40,9 +40,8 @@ def docker_remove_container(container: str) -> str: return result.returncode -def docker_start_archgw_detached( +def docker_start_plano_detached( arch_config_file: str, - logs_path_abs: str, env: dict, gateway_ports: list[int], ) -> str: @@ -70,13 +69,13 @@ def docker_start_archgw_detached( "run", "-d", "--name", - ARCHGW_DOCKER_NAME, + PLANO_DOCKER_NAME, *port_mappings_args, *volume_mappings_args, *env_args, "--add-host", "host.docker.internal:host-gateway", - ARCHGW_DOCKER_IMAGE, + PLANO_DOCKER_IMAGE, ] result = subprocess.run(options, capture_output=True, text=True, check=False) @@ -93,11 +92,11 @@ def health_check_endpoint(endpoint: str) -> bool: return False -def stream_gateway_logs(follow, service="archgw"): +def stream_gateway_logs(follow, service="plano"): """ - Stream logs from the arch gateway service. + Stream logs from the plano gateway service. """ - log.info("Logs from arch gateway service.") + log.info("Logs from plano gateway service.") options = ["docker", "logs"] if follow: @@ -116,7 +115,7 @@ def stream_gateway_logs(follow, service="archgw"): log.info(f"Failed to stream logs: {str(e)}") -def docker_validate_archgw_schema(arch_config_file): +def docker_validate_plano_schema(arch_config_file): result = subprocess.run( [ "docker", @@ -126,7 +125,7 @@ def docker_validate_archgw_schema(arch_config_file): f"{arch_config_file}:/app/arch_config.yaml:ro", "--entrypoint", "python", - ARCHGW_DOCKER_IMAGE, + PLANO_DOCKER_IMAGE, "-m", "cli.config_generator", ], diff --git a/arch/tools/cli/main.py b/arch/tools/cli/main.py index 35bb34eb..84cc2c79 100644 --- a/arch/tools/cli/main.py +++ b/arch/tools/cli/main.py @@ -7,7 +7,7 @@ import importlib.metadata import json from cli import targets from cli.docker_cli import ( - docker_validate_archgw_schema, + docker_validate_plano_schema, stream_gateway_logs, docker_container_status, ) @@ -25,43 +25,45 @@ from cli.core import ( start_cli_agent, ) from cli.consts import ( - ARCHGW_DOCKER_IMAGE, - ARCHGW_DOCKER_NAME, + PLANO_DOCKER_IMAGE, + PLANO_DOCKER_NAME, SERVICE_NAME_ARCHGW, ) log = getLogger(__name__) +# ref https://patorjk.com/software/taag/#p=display&f=Doom&t=Plano&x=none&v=4&h=4&w=80&we=false logo = r""" - _ _ - / \ _ __ ___ | |__ - / _ \ | '__|/ __|| '_ \ - / ___ \ | | | (__ | | | | - /_/ \_\|_| \___||_| |_| +______ _ +| ___ \ | +| |_/ / | __ _ _ __ ___ +| __/| |/ _` | '_ \ / _ \ +| | | | (_| | | | | (_) | +\_| |_|\__,_|_| |_|\___/ """ -# Command to build archgw Docker images +# Command to build plano Docker images ARCHGW_DOCKERFILE = "./arch/Dockerfile" def get_version(): try: - version = importlib.metadata.version("archgw") + version = importlib.metadata.version("plano") return version except importlib.metadata.PackageNotFoundError: return "version not found" @click.group(invoke_without_command=True) -@click.option("--version", is_flag=True, help="Show the archgw cli version and exit.") +@click.option("--version", is_flag=True, help="Show the plano cli version and exit.") @click.pass_context def main(ctx, version): if version: - click.echo(f"archgw cli version: {get_version()}") + click.echo(f"plano cli version: {get_version()}") ctx.exit() - log.info(f"Starting archgw cli version: {get_version()}") + log.info(f"Starting plano cli version: {get_version()}") if ctx.invoked_subcommand is None: click.echo("""Arch (The Intelligent Prompt Gateway) CLI""") @@ -76,7 +78,7 @@ def build(): # Check if /arch/Dockerfile exists if os.path.exists(ARCHGW_DOCKERFILE): if os.path.exists(ARCHGW_DOCKERFILE): - click.echo("Building archgw image...") + click.echo("Building plano image...") try: subprocess.run( [ @@ -85,7 +87,7 @@ def build(): "-f", ARCHGW_DOCKERFILE, "-t", - f"{ARCHGW_DOCKER_IMAGE}", + f"{PLANO_DOCKER_IMAGE}", ".", "--add-host=host.docker.internal:host-gateway", ], @@ -93,7 +95,7 @@ def build(): ) click.echo("archgw image built successfully.") except subprocess.CalledProcessError as e: - click.echo(f"Error building archgw image: {e}") + click.echo(f"Error building plano image: {e}") sys.exit(1) else: click.echo("Error: Dockerfile not found in /arch") @@ -128,7 +130,7 @@ def up(file, path, foreground): validation_return_code, validation_stdout, validation_stderr, - ) = docker_validate_archgw_schema(arch_config_file) + ) = docker_validate_plano_schema(arch_config_file) if validation_return_code != 0: log.info(f"Error: Validation failed. Exiting") log.info(f"Validation stdout: {validation_stdout}") @@ -211,7 +213,7 @@ def generate_prompt_targets(file): @click.command() @click.option( "--debug", - help="For detailed debug logs to trace calls from archgw <> api_server, etc", + help="For detailed debug logs to trace calls from plano <> api_server, etc", is_flag=True, ) @click.option("--follow", help="Follow the logs", is_flag=True) @@ -259,11 +261,11 @@ def cli_agent(type, file, path, settings): CLI_AGENT: The type of CLI agent to start (currently only 'claude' is supported) """ - # Check if archgw docker container is running - archgw_status = docker_container_status(ARCHGW_DOCKER_NAME) + # Check if plano docker container is running + archgw_status = docker_container_status(PLANO_DOCKER_NAME) if archgw_status != "running": log.error(f"archgw docker container is not running (status: {archgw_status})") - log.error("Please start archgw using the 'archgw up' command.") + log.error("Please start plano using the 'archgw up' command.") sys.exit(1) # Determine arch_config.yaml path diff --git a/arch/tools/pyproject.toml b/arch/tools/pyproject.toml index 7bff20ba..5dd8b4a4 100644 --- a/arch/tools/pyproject.toml +++ b/arch/tools/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] -name = "archgw" -version = "0.3.22" -description = "Python-based CLI tool to manage Arch Gateway." +name = "plano" +version = "0.4.0" +description = "Python-based CLI tool to manage Plano." authors = ["Katanemo Labs, Inc."] readme = "README.md" packages = [{ include = "cli" }] @@ -18,7 +18,7 @@ requests = ">=2.31.0,<3.0.0" pytest = ">=8.4.1,<9.0.0" [tool.poetry.scripts] -archgw = "cli.main:main" +plano = "cli.main:main" [build-system] requires = ["poetry-core>=2.0.0"] diff --git a/arch/validate_arch_config.sh b/arch/validate_arch_config.sh index d9d89998..326ff022 100644 --- a/arch/validate_arch_config.sh +++ b/arch/validate_arch_config.sh @@ -5,7 +5,7 @@ failed_files=() for file in $(find . -name arch_config.yaml -o -name arch_config_full_reference.yaml); do echo "Validating ${file}..." touch $(pwd)/${file}_rendered - if ! docker run --rm -v "$(pwd)/${file}:/app/arch_config.yaml:ro" -v "$(pwd)/${file}_rendered:/app/arch_config_rendered.yaml:rw" --entrypoint /bin/sh katanemo/archgw:0.3.22 -c "python -m cli.config_generator" 2>&1 > /dev/null ; then + if ! docker run --rm -v "$(pwd)/${file}:/app/arch_config.yaml:ro" -v "$(pwd)/${file}_rendered:/app/arch_config_rendered.yaml:rw" --entrypoint /bin/sh katanemo/plano:0.4.0 -c "python -m cli.config_generator" 2>&1 > /dev/null ; then echo "Validation failed for $file" failed_files+=("$file") fi diff --git a/build_filter_image.sh b/build_filter_image.sh index 7f1d7b31..4b965549 100644 --- a/build_filter_image.sh +++ b/build_filter_image.sh @@ -1 +1 @@ -docker build -f arch/Dockerfile . -t katanemo/archgw -t katanemo/archgw:0.3.22 +docker build -f arch/Dockerfile . -t katanemo/plano -t katanemo/plano:0.4.0 diff --git a/demos/use_cases/model_choice_with_test_harness/pyproject.toml b/demos/use_cases/model_choice_with_test_harness/pyproject.toml index 4147942e..521303f5 100644 --- a/demos/use_cases/model_choice_with_test_harness/pyproject.toml +++ b/demos/use_cases/model_choice_with_test_harness/pyproject.toml @@ -12,7 +12,7 @@ python = ">=3.10,<3.13.3" pydantic = "^2.0" openai = "^1.0" pyyaml = "^6.0" -archgw ="^0.3.22" +plano = "^0.4.0" [tool.poetry.group.dev.dependencies] pytest = "^8.3" diff --git a/demos/use_cases/preference_based_routing/README.md b/demos/use_cases/preference_based_routing/README.md index 139d6252..e9bb37d0 100644 --- a/demos/use_cases/preference_based_routing/README.md +++ b/demos/use_cases/preference_based_routing/README.md @@ -14,9 +14,9 @@ Make sure your machine is up to date with [latest version of archgw]([url](https 2. start archgw in the foreground ```bash (venv) $ archgw up --service archgw --foreground -2025-05-30 18:00:09,953 - cli.main - INFO - Starting archgw cli version: 0.3.22 +2025-05-30 18:00:09,953 - cli.main - INFO - Starting archgw cli version: 0.4.0 2025-05-30 18:00:09,953 - cli.main - INFO - Validating /Users/adilhafeez/src/intelligent-prompt-gateway/demos/use_cases/preference_based_routing/arch_config.yaml -2025-05-30 18:00:10,422 - cli.core - INFO - Starting arch gateway, image name: archgw, tag: katanemo/archgw:0.3.22 +2025-05-30 18:00:10,422 - cli.core - INFO - Starting arch gateway, image name: archgw, tag: katanemo/plano:0.4.0 2025-05-30 18:00:10,662 - cli.core - INFO - archgw status: running, health status: starting 2025-05-30 18:00:11,712 - cli.core - INFO - archgw status: running, health status: starting 2025-05-30 18:00:12,761 - cli.core - INFO - archgw is running and is healthy! diff --git a/docs/source/conf.py b/docs/source/conf.py index 11048b61..7be4186b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,10 +12,10 @@ from sphinx.util.docfields import Field from sphinxawesome_theme import ThemeOptions from sphinxawesome_theme.postprocess import Icons -project = "Arch Docs" +project = "Plano Docs" copyright = "2025, Katanemo Labs, Inc" author = "Katanemo Labs, Inc" -release = " v0.3.22" +release = " v0.4.0" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/source/get_started/quickstart.rst b/docs/source/get_started/quickstart.rst index 546285c2..a67ef45d 100644 --- a/docs/source/get_started/quickstart.rst +++ b/docs/source/get_started/quickstart.rst @@ -25,7 +25,7 @@ Arch's CLI allows you to manage and interact with the Arch gateway efficiently. $ python -m venv venv $ source venv/bin/activate # On Windows, use: venv\Scripts\activate - $ pip install archgw==0.3.22 + $ pip install plano==0.4.0 Build AI Agent with Arch Gateway diff --git a/docs/source/resources/deployment.rst b/docs/source/resources/deployment.rst index c23e0adc..c346371c 100644 --- a/docs/source/resources/deployment.rst +++ b/docs/source/resources/deployment.rst @@ -24,9 +24,9 @@ Create a ``docker-compose.yml`` file with the following configuration: # docker-compose.yml services: - archgw: - image: katanemo/archgw:0.3.22 - container_name: archgw + plano: + image: katanemo/plano:0.4.0 + container_name: plano ports: - "10000:10000" # ingress (client -> arch) - "12000:12000" # egress (arch -> upstream/llm proxy)