From fb3c4566ceba01bd580649ca2d269c9cbbc8ceb5 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Tue, 3 Sep 2024 11:23:26 -0700 Subject: [PATCH] llama stack start -> llama stack run --- docs/cli_reference.md | 6 +++--- llama_toolchain/cli/stack/{start.py => run.py} | 12 ++++++------ llama_toolchain/cli/stack/stack.py | 4 ++-- llama_toolchain/core/build_conda_env.sh | 2 +- llama_toolchain/core/build_container.sh | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) rename llama_toolchain/cli/stack/{start.py => run.py} (91%) diff --git a/docs/cli_reference.md b/docs/cli_reference.md index 295b9898c..d1b2ce554 100644 --- a/docs/cli_reference.md +++ b/docs/cli_reference.md @@ -242,7 +242,7 @@ An agentic app has several components including model inference, tool execution The Llama Stack is a collection of REST APIs. An API is _implemented_ by Provider. An assembly of Providers together provides the implementation for the Stack -- this package is called a Distribution. -As an example, by running a simple command `llama stack start `, you can bring up a server serving the following endpoints, among others: +As an example, by running a simple command `llama stack run`, you can bring up a server serving the following endpoints, among others: ``` POST /inference/chat_completion POST /inference/completion @@ -377,12 +377,12 @@ Now let’s start Llama Stack server. You need the YAML configuration file which was written out at the end by the `llama stack build` step. ``` -llama stack start local --name llama-8b --port 5000 +llama stack run local --name llama-8b --port 5000 ``` You should see the Stack server start and print the APIs that it is supporting, ``` -$ llama stack start local --name llama-8b --port 5000 +$ llama stack run local --name llama-8b --port 5000 > initializing model parallel with size 1 > initializing ddp with size 1 diff --git a/llama_toolchain/cli/stack/start.py b/llama_toolchain/cli/stack/run.py similarity index 91% rename from llama_toolchain/cli/stack/start.py rename to llama_toolchain/cli/stack/run.py index a5f541c95..68853db35 100644 --- a/llama_toolchain/cli/stack/start.py +++ b/llama_toolchain/cli/stack/run.py @@ -16,17 +16,17 @@ from llama_toolchain.core.datatypes import * # noqa: F403 from llama_toolchain.common.config_dirs import BUILDS_BASE_DIR -class StackStart(Subcommand): +class StackRun(Subcommand): def __init__(self, subparsers: argparse._SubParsersAction): super().__init__() self.parser = subparsers.add_parser( - "start", - prog="llama stack start", + "run", + prog="llama stack run", description="""start the server for a Llama Stack Distribution. You should have already built (or downloaded) and configured the distribution.""", formatter_class=argparse.RawTextHelpFormatter, ) self._add_arguments() - self.parser.set_defaults(func=self._run_stack_start_cmd) + self.parser.set_defaults(func=self._run_stack_run_cmd) def _add_arguments(self): from llama_toolchain.core.package import BuildType @@ -39,7 +39,7 @@ class StackStart(Subcommand): self.parser.add_argument( "--name", type=str, - help="Name of the API build you want to start", + help="Name of the build you want to start", required=True, ) self.parser.add_argument( @@ -61,7 +61,7 @@ class StackStart(Subcommand): default=False, ) - def _run_stack_start_cmd(self, args: argparse.Namespace) -> None: + def _run_stack_run_cmd(self, args: argparse.Namespace) -> None: from llama_toolchain.common.exec import run_with_pty from llama_toolchain.core.package import BuildType diff --git a/llama_toolchain/cli/stack/stack.py b/llama_toolchain/cli/stack/stack.py index a24cc5f09..cba31e08d 100644 --- a/llama_toolchain/cli/stack/stack.py +++ b/llama_toolchain/cli/stack/stack.py @@ -11,7 +11,7 @@ from llama_toolchain.cli.subcommand import Subcommand from .build import StackBuild from .configure import StackConfigure from .list import StackList -from .start import StackStart +from .run import StackRun class StackParser(Subcommand): @@ -29,4 +29,4 @@ class StackParser(Subcommand): StackBuild.create(subparsers) StackConfigure.create(subparsers) StackList.create(subparsers) - StackStart.create(subparsers) + StackRun.create(subparsers) diff --git a/llama_toolchain/core/build_conda_env.sh b/llama_toolchain/core/build_conda_env.sh index 9d79609f3..0a3eaf20a 100755 --- a/llama_toolchain/core/build_conda_env.sh +++ b/llama_toolchain/core/build_conda_env.sh @@ -125,4 +125,4 @@ else target="$distribution_id" fi -$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama $subcommand configure $target --build-name "$build_name" --build-type conda_env +$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama $subcommand configure $target --name "$build_name" --type conda_env diff --git a/llama_toolchain/core/build_container.sh b/llama_toolchain/core/build_container.sh index cd5e1ef60..5b05f1132 100755 --- a/llama_toolchain/core/build_container.sh +++ b/llama_toolchain/core/build_container.sh @@ -117,4 +117,4 @@ else target="$distribution_id" fi -$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama $subcommand configure $target --build-name "$build_name" --build-type container +$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama $subcommand configure $target --name "$build_name" --type container