llama-stack/llama_stack/cli/stack
Sébastien Han 21e39633d8
feat(server): Use system packages for execution (#1252)
# What does this PR do?

Users prefer to rely on the main CLI rather than invoking the server
through a Python module. Users interact with a high-level CLI rather
than needing to know internal module structures.

Now, when running llama stack run <path-to-config>, the server will
attempt to use the system package or a virtual environment if one is
active.

This also eliminates the current process dependency chain when running
from a virtual environment:

-> llama stack run
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -> start_env.sh

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-> python -m server...

Signed-off-by: Sébastien Han <seb@redhat.com>

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan

Run:

```
ollama run llama3.2:3b-instruct-fp16 --keepalive=2m &
llama stack run ./llama_stack/templates/ollama/run.yaml --disable-ipv6
```

Notice that the server starts and shutdowns normally.

[//]: # (## Documentation)

---------

Signed-off-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
2025-03-10 16:01:03 -07:00
..
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
_build.py refactor: ImageType to LlamaStackImageType (#1500) 2025-03-10 17:12:53 -04:00
build.py refactor: display defaults in help text (#1480) 2025-03-07 11:05:58 -08:00
list_apis.py API Updates (#73) 2024-09-17 19:51:35 -07:00
list_providers.py feat: support listing all for llama stack list-providers (#1056) 2025-02-12 22:03:28 -08:00
run.py feat(server): Use system packages for execution (#1252) 2025-03-10 16:01:03 -07:00
stack.py fix: Incorrect import path for print_subcommand_description() (#1314) 2025-02-27 18:35:49 -08:00
utils.py chore: add subcommands description in help (#1219) 2025-02-27 17:00:27 -08:00