llama-stack-mirror/llama_stack
Vladimir Ivic a171832152 Shorthand version of the stack run command
Summary:
Adds a shorthand command version to run stack where its config exists under DISTRIBS_BASE_DIR (i.e. ~/.llama/distributions).

For example, imagine you created a new stack using the `llama stack build` command where you named it "my-awesome-llama-stack".

```
$ llama stack build

> Enter a name for your Llama Stack (e.g. my-local-stack): my-awesome-llama-stack
```

Now, to run the stack, instead of
```
llama stack run ~/.llama/distributions/llamastack-my-awesome-llama-stack/my-awesome-llama-stack-run.yaml
```

you can start it using the short version

```
llama stack run  my-awesome-llama-stack
```

Test Plan:
Verify command fails when stack doesn't exist
```
python3 -m llama_stack.cli.llama stack run my-test-stack
```

Output [FAILURE]
```
usage: llama stack run [-h] [--port PORT] [--disable-ipv6] config
llama stack run: error: File /Users/vladimirivic/.llama/distributions/llamastack-my-test-stack/my-test-stack-run.yaml does not exist. Please run `llama stack build` to generate (and optionally edit) a run.yaml file
```

Create a new stack using `llama stack build`.
Name it `my-test-stack`.

Verify command runs successfully
```
python3 -m llama_stack.cli.llama stack run my-test-stack
```

Output [SUCCESS]
```
Listening on ['::', '0.0.0.0']:5000
INFO:     Started server process [80146]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://['::', '0.0.0.0']:5000 (Press CTRL+C to quit)
```
2024-11-15 18:57:07 -08:00
..
apis No more model_id warnings 2024-11-15 12:20:18 -08:00
cli Shorthand version of the stack run command 2024-11-15 18:57:07 -08:00
distribution No more model_id warnings 2024-11-15 12:20:18 -08:00
providers fix faiss serialize and serialize of index (#464) 2024-11-15 18:02:48 -08:00
scripts Add a test for CLI, but not fully done so disabled 2024-09-19 13:27:07 -07:00
templates Update provider types and prefix with inline:: 2024-11-12 12:54:44 -08:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00