llama-stack-mirror/llama_stack/templates
Ashwin Bharambe 6609d4ada4
feat: allow conditionally enabling providers in run.yaml (#1321)
# What does this PR do?

We want to bundle a bunch of (typically remote) providers in a distro
template and be able to configure them "on the fly" via environment
variables. So far, we have been able to do this with simple env var
replacements. However, sometimes you want to only conditionally enable
providers (because the relevant remote services may not be alive, or
relevant.) This was not possible until now.

To aid this, we add a simple (bash-like) env var replacement
enhancement: `${env.FOO+bar}` evaluates to `bar` if the variable is SET
and evaluates to empty string if it is not. On top of that, we update
our main resolver to ignore any provider whose ID is null.

This allows using the distro like this:

```bash
llama stack run dev --env CHROMADB_URL=http://localhost:6001 --env ENABLE_CHROMADB=1
```

when only Chroma is UP. This disables the other `pgvector` provider in
the run configuration.


## Test Plan

Hard code `chromadb` as the vector io provider inside
`test_vector_io.py` and run:

```bash
LLAMA_STACK_BASE_URL=http://localhost:8321 pytest -s -v tests/client-sdk/vector_io/ --embedding-model all-MiniLM-L6-v2
```
2025-03-01 11:19:14 -08:00
..
bedrock fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
cerebras fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
ci-tests fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
dell fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
dev feat: allow conditionally enabling providers in run.yaml (#1321) 2025-03-01 11:19:14 -08:00
experimental-post-training feat: [post training] support save hf safetensor format checkpoint (#845) 2025-02-25 23:29:08 -08:00
fireworks fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
groq fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
hf-endpoint fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
hf-serverless fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
meta-reference-gpu docs: update the downloaded list doc (#1266) 2025-02-28 10:10:12 -08:00
meta-reference-quantized-gpu docs: update the downloaded list doc (#1266) 2025-02-28 10:10:12 -08:00
nvidia fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
ollama fix: ensure ollama embedding model is registered properly in the template 2025-02-27 22:49:06 -08:00
passthrough feat: inference passthrough provider (#1166) 2025-02-19 21:47:00 -08:00
remote-vllm fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
sambanova feat: allow conditionally enabling providers in run.yaml (#1321) 2025-03-01 11:19:14 -08:00
tgi fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
together fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
vllm-gpu fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00
__init__.py Auto-generate distro yamls + docs (#468) 2024-11-18 14:57:06 -08:00
template.py fix: register provider model name and HF alias in run.yaml (#1304) 2025-02-27 16:39:23 -08:00