mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-25 22:28:04 +00:00
We are now testing the safety capability with the starter image. This includes a few changes: * Enable the safety integration test * Relax the shield model requirements from llama-guard to make it work with llama-guard3:8b coming from Ollama * Expose a shield for each inference provider in the starter distro. The shield will only be registered if the provider is enabled. Shields will be added if the provider claims to support a safety model * Missing providers models have been added too * Pointers to official documentation pages for provider models support have been added Closes: https://github.com/meta-llama/llama-stack/issues/2528 Signed-off-by: Sébastien Han <seb@redhat.com>
32 lines
889 B
Python
32 lines
889 B
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the terms described in the LICENSE file in
|
|
# the root directory of this source tree.
|
|
|
|
from llama_stack.apis.models import ModelType
|
|
from llama_stack.providers.utils.inference.model_registry import (
|
|
ProviderModelEntry,
|
|
)
|
|
|
|
LLM_MODEL_IDS = [
|
|
"gemini/gemini-1.5-flash",
|
|
"gemini/gemini-1.5-pro",
|
|
"gemini/gemini-2.0-flash",
|
|
"gemini/gemini-2.5-flash",
|
|
"gemini/gemini-2.5-pro",
|
|
]
|
|
|
|
SAFETY_MODELS_ENTRIES = []
|
|
|
|
MODEL_ENTRIES = (
|
|
[ProviderModelEntry(provider_model_id=m) for m in LLM_MODEL_IDS]
|
|
+ [
|
|
ProviderModelEntry(
|
|
provider_model_id="gemini/text-embedding-004",
|
|
model_type=ModelType.embedding,
|
|
metadata={"embedding_dimension": 768, "context_length": 2048},
|
|
),
|
|
]
|
|
+ SAFETY_MODELS_ENTRIES
|
|
)
|