llama-stack/llama_stack/templates
Matthew Farrellee 11b1cdf31d
add NVIDIA_BASE_URL and NVIDIA_API_KEY to control hosted vs local endpoints (#897)
# What does this PR do?

allows template distribution connect to hosted or local NIM:

use --env NVIDIA_BASE_URL=http://localhost:8000 to connect to a local
NIM running at localhost:8000

use --env NVIDIA_API_KEY=blah when connecting to hosted NIM, e.g.
NVIDIA_BASE_URL=https://integrate.api.nvidia.com


## Test Plan

- `llama stack run ./llama_stack/templates/nvidia/run.yaml` -> error,
e.g. API key is required for hosted NVIDIA NIM
- `llama stack run ./llama_stack/templates/nvidia/run.yaml --env
NVIDIA_BASE_URL=https://integrate.api.nvidia.com` -> error, e.g. API key
is required for hosted NVIDIA NIM

- `llama stack run ./llama_stack/templates/nvidia/run.yaml --env
NVIDIA_API_KEY=REDACTED` -> successful connection to NIM on
https://integrate.api.nvidia.com
- `llama stack run ./llama_stack/templates/nvidia/run.yaml --env
NVIDIA_BASE_URL=https://integrate.api.nvidia.com --env
NVIDIA_API_KEY=REDACTED` -> successful connection to NIM running on
integrate.api.nvidia.com

- `llama stack run ./llama_stack/templates/nvidia/run.yaml --env
NVIDIA_BASE_URL=http://localhost:8000` -> successful connection to NIM
running on localhost:8000
- `llama stack run ./llama_stack/templates/nvidia/run.yaml --env
NVIDIA_BASE_URL=http://localhost:8000 --env NVIDIA_API_KEY=REDACTED` ->
successful connection to NIM running on http://localhost:8000

- `llama stack run ./llama_stack/templates/nvidia/run.yaml --env
NVIDIA_BASE_URL=http://bogus` -> runtime error, e.g. ConnectionError
(TODO: this should be a startup error)


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [x] Ran pre-commit to handle lint / formatting issues.
- [x] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [ ] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.
2025-01-29 09:31:56 -08:00
..
bedrock Rename builtin::memory -> builtin::rag 2025-01-22 20:22:51 -08:00
cerebras Kill colons 2025-01-22 22:54:13 -08:00
experimental-post-training fix experimental-post-training template (#842) 2025-01-22 15:04:05 -08:00
fireworks Report generation minor fixes (#884) 2025-01-28 04:58:12 -08:00
hf-endpoint Rename builtin::memory -> builtin::rag 2025-01-22 20:22:51 -08:00
hf-serverless Rename builtin::memory -> builtin::rag 2025-01-22 20:22:51 -08:00
meta-reference-gpu Rename builtin::memory -> builtin::rag 2025-01-22 20:22:51 -08:00
meta-reference-quantized-gpu Rename builtin::memory -> builtin::rag 2025-01-22 20:22:51 -08:00
nvidia add NVIDIA_BASE_URL and NVIDIA_API_KEY to control hosted vs local endpoints (#897) 2025-01-29 09:31:56 -08:00
ollama Update doc templates for running safety on self-hosted templates (#874) 2025-01-24 11:28:20 -08:00
remote-vllm Update doc templates for running safety on self-hosted templates (#874) 2025-01-24 11:28:20 -08:00
sambanova Sambanova - LlamaGuard (#886) 2025-01-27 15:46:30 -08:00
tgi Update doc templates for running safety on self-hosted templates (#874) 2025-01-24 11:28:20 -08:00
together Report generation minor fixes (#884) 2025-01-28 04:58:12 -08:00
vllm-gpu Rename builtin::memory -> builtin::rag 2025-01-22 20:22:51 -08:00
__init__.py Auto-generate distro yamls + docs (#468) 2024-11-18 14:57:06 -08:00
template.py Fix incorrect RunConfigSettings due to the removal of conda_env (#801) 2025-01-17 21:30:57 -08:00