feat: refactor external providers dir

currently the "default" dir for external providers is `/etc/llama-stack/providers.d`

This dir is not used anywhere nor created.

Switch to a more friendly `~/.llama/providers.d/`

This allows external providers to actually create this dir and/or populate it upon installation, `pip` cannot create directories in `etc`.

If a user does not specify a dir, default to this one

see https://github.com/containers/ramalama-stack/issues/36

`llama stack build` and `llama stack run` needed to be modified to work with this change and with external providers dir in general.

`llama stack run --image-type container --image-name foobar` should _not_ require a `--config`. This is because the config is copied in during the build and accounts for the external providers dir.

forcing a run yaml at runtime breaks external providers because the host-system path to the external providers is used in the container which is wrong

Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
Charlie Doern 2025-04-28 10:53:17 -04:00
parent 8e7ab146f8
commit d52d40dafc
14 changed files with 166 additions and 90 deletions

View file

@ -178,7 +178,7 @@ image_name: ollama
image_type: conda
# If some providers are external, you can specify the path to the implementation
external_providers_dir: /etc/llama-stack/providers.d
external_providers_dir: ~/.llama/providers.d
```
```
@ -206,7 +206,7 @@ distribution_spec:
image_type: container
image_name: ci-test
# Path to external provider implementations
external_providers_dir: /etc/llama-stack/providers.d
external_providers_dir: ~/.llama/providers.d
```
Here's an example for a custom Ollama provider: