llama-stack/llama_stack/distribution
Ashwin Bharambe 983d6ce2df
Remove the "ShieldType" concept (#430)
# What does this PR do?

This PR kills the notion of "ShieldType". The impetus for this is the
realization:

> Why is keyword llama-guard appearing so many times everywhere,
sometimes with hyphens, sometimes with underscores?

Now that we have a notion of "provider specific resource identifiers"
and "user specific aliases" for those and the fact that this works with
models ("Llama3.1-8B-Instruct" <> "fireworks/llama-3pv1-..."), we can
follow the same rules for Shields.

So each Safety provider can make up a notion of identifiers it has
registered. This already happens with Bedrock correctly. We just
generalize it for Llama Guard, Prompt Guard, etc.

For Llama Guard, we further simplify by just adopting the underlying
model name itself as the identifier! No confusion necessary.

While doing this, I noticed a bug in our DistributionRegistry where we
weren't scoping identifiers by type. Fixed.

## Feature/Issue validation/testing/test plan

Ran (inference, safety, memory, agents) tests with ollama and fireworks
providers.
2024-11-12 12:37:24 -08:00
..
routers Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
server Allow specifying resources in StackRunConfig (#425) 2024-11-12 10:58:49 -08:00
store Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
utils Replace colon in path so it doesn't cause issue on Windows 2024-11-11 17:33:53 -08:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
build.py Fix bug in llama stack build; SERVER_DEPENDENCIES were dropped 2024-11-11 20:12:13 -08:00
build_conda_env.sh fix prompt guard (#177) 2024-10-03 11:07:53 -07:00
build_container.sh Fix bug in llama stack build; SERVER_DEPENDENCIES were dropped 2024-11-11 20:12:13 -08:00
client.py Allow simpler initialization of RemoteProviderConfig; fix issue in httpx client 2024-11-06 19:19:26 -08:00
common.sh API Updates (#73) 2024-09-17 19:51:35 -07:00
configure.py Kill --name from llama stack build (#340) 2024-10-28 23:07:32 -07:00
configure_container.sh docker: Check for selinux before using --security-opt (#167) 2024-10-02 10:37:41 -07:00
datatypes.py Enable sane naming of registered objects with defaults (#429) 2024-11-12 11:18:05 -08:00
distribution.py [Evals API][10/n] API updates for EvalTaskDef + new test migration (#379) 2024-11-07 21:24:12 -08:00
inspect.py Remove "routing_table" and "routing_key" concepts for the user (#201) 2024-10-10 10:24:13 -07:00
request_headers.py provider_id => provider_type, adapter_id => adapter_type 2024-10-02 14:05:59 -07:00
resolver.py Split safety into (llama-guard, prompt-guard, code-scanner) (#400) 2024-11-11 09:29:18 -08:00
stack.py Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
start_conda_env.sh API Updates (#73) 2024-09-17 19:51:35 -07:00
start_container.sh Allow specifying TEST / PYPI VERSION for docker name 2024-11-11 19:56:42 -08:00