llama-stack-mirror/llama_stack
Michael Dawson a654467552
feat: add cpu/cuda config for prompt guard (#2194)
# What does this PR do?
Previously prompt guard was hard coded to require cuda which prevented
it from being used on an instance without a cuda support.

This PR allows prompt guard to be configured to use either cpu or cuda.

[//]: # (If resolving an issue, uncomment and update the line below)
Closes [#2133](https://github.com/meta-llama/llama-stack/issues/2133)

## Test Plan (Edited after incorporating suggestion)
1) started stack configured with prompt guard as follows on a system
without a GPU
and validated prompt guard could be used through the APIs

2) validated on a system with a gpu (but without llama stack) that the
python selecting between cpu and cuda support returned the right value
when a cuda device was available.

3) ran the unit tests as per -
https://github.com/meta-llama/llama-stack/blob/main/tests/unit/README.md

[//]: # (## Documentation)

---------

Signed-off-by: Michael Dawson <mdawson@devrus.com>
2025-05-28 12:23:15 -07:00
..
apis feat(responses): add output_text delta events to responses (#2265) 2025-05-27 13:07:14 -07:00
cli fix: handle None external_providers_dir in build with run arg (#2269) 2025-05-27 09:41:12 +02:00
distribution chore: use starlette built-in Route class (#2267) 2025-05-28 09:53:33 -07:00
models chore: make cprint write to stderr (#2250) 2025-05-24 23:39:57 -07:00
providers feat: add cpu/cuda config for prompt guard (#2194) 2025-05-28 12:23:15 -07:00
strong_typing chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
templates chore: remove dependencies.json (#2281) 2025-05-27 10:26:57 -07:00
ui feat(ui): add views for Responses (#2293) 2025-05-28 09:51:22 -07:00
__init__.py export LibraryClient 2024-12-13 12:08:00 -08:00
env.py refactor(test): move tools, evals, datasetio, scoring and post training tests (#1401) 2025-03-04 14:53:47 -08:00
log.py chore: make cprint write to stderr (#2250) 2025-05-24 23:39:57 -07:00
schema_utils.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00