llama-stack/llama_stack/apis
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
..
agents migrate memory banks to Resource and new registration (#411) 2024-11-11 17:10:44 -08:00
batch_inference Remove "routing_table" and "routing_key" concepts for the user (#201) 2024-10-10 10:24:13 -07:00
common [Evals API][4/n] evals with generation meta-reference impl (#303) 2024-10-25 13:12:39 -07:00
datasetio migrate dataset to resource (#420) 2024-11-11 17:14:41 -08:00
datasets Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
eval [Evals API][11/n] huggingface dataset provider + mmlu scoring fn (#392) 2024-11-11 14:49:50 -05:00
eval_tasks Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
inference migrate model to Resource and new registration signature (#410) 2024-11-08 16:12:57 -08:00
inspect Remove "routing_table" and "routing_key" concepts for the user (#201) 2024-10-10 10:24:13 -07:00
memory migrate memory banks to Resource and new registration (#411) 2024-11-11 17:10:44 -08:00
memory_banks Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
models Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
post_training [Evals API][4/n] evals with generation meta-reference impl (#303) 2024-10-25 13:12:39 -07:00
safety Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
scoring migrate scoring fns to resource (#422) 2024-11-11 17:28:48 -08:00
scoring_functions Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
shields Remove the "ShieldType" concept (#430) 2024-11-12 12:37:24 -08:00
synthetic_data_generation [Evals API][4/n] evals with generation meta-reference impl (#303) 2024-10-25 13:12:39 -07:00
telemetry Remove "routing_table" and "routing_key" concepts for the user (#201) 2024-10-10 10:24:13 -07:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
resource.py Enable sane naming of registered objects with defaults (#429) 2024-11-12 11:18:05 -08:00