From d072b5fa0c2b58dcf27e936bb4fa3a95bc6f41d7 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Wed, 12 Mar 2025 22:29:58 -0700 Subject: [PATCH] test: add unit test to ensure all config types are instantiable (#1601) --- .../inline/datasetio/localfs/config.py | 16 ++++-- .../inline/eval/meta_reference/config.py | 16 ++++-- .../providers/inline/inference/vllm/config.py | 4 +- .../inline/post_training/torchtune/config.py | 8 ++- .../inline/safety/code_scanner/config.py | 6 ++- .../inline/safety/llama_guard/config.py | 8 ++- .../inline/safety/prompt_guard/config.py | 7 +++ .../providers/inline/scoring/basic/config.py | 7 ++- .../inline/scoring/llm_as_judge/config.py | 7 ++- .../inline/telemetry/sample/__init__.py | 17 ------- .../inline/telemetry/sample/config.py | 12 ----- .../inline/telemetry/sample/sample.py | 17 ------- .../tool_runtime/code_interpreter/config.py | 6 ++- .../inline/tool_runtime/rag/config.py | 6 ++- .../inline/vector_io/chroma/config.py | 4 +- llama_stack/providers/registry/agents.py | 11 ---- llama_stack/providers/registry/inference.py | 9 ---- llama_stack/providers/registry/safety.py | 30 ----------- llama_stack/providers/registry/telemetry.py | 11 ---- llama_stack/providers/registry/vector_io.py | 10 ---- .../remote/agents/sample/__init__.py | 17 ------- .../providers/remote/agents/sample/config.py | 12 ----- .../providers/remote/agents/sample/sample.py | 17 ------- .../remote/datasetio/huggingface/config.py | 16 ++++-- .../remote/inference/databricks/config.py | 13 +++++ .../remote/inference/runpod/__init__.py | 3 +- .../remote/inference/runpod/config.py | 9 +++- .../remote/inference/runpod/runpod.py | 1 - .../remote/inference/sample/__init__.py | 17 ------- .../remote/inference/sample/config.py | 12 ----- .../remote/inference/sample/sample.py | 23 --------- .../remote/safety/sample/__init__.py | 17 ------- .../providers/remote/safety/sample/config.py | 12 ----- .../providers/remote/safety/sample/sample.py | 23 --------- .../remote/tool_runtime/bing_search/config.py | 8 ++- .../model_context_protocol/config.py | 6 ++- .../tool_runtime/wolfram_alpha/config.py | 8 ++- .../remote/vector_io/qdrant/config.py | 8 ++- .../remote/vector_io/sample/__init__.py | 17 ------- .../remote/vector_io/sample/config.py | 12 ----- .../remote/vector_io/sample/sample.py | 26 ---------- .../remote/vector_io/weaviate/config.py | 6 ++- llama_stack/templates/bedrock/run.yaml | 18 +++++-- llama_stack/templates/cerebras/run.yaml | 21 ++++++-- llama_stack/templates/ci-tests/run.yaml | 21 ++++++-- .../templates/dell/run-with-safety.yaml | 21 ++++++-- llama_stack/templates/dell/run.yaml | 21 ++++++-- llama_stack/templates/dev/run.yaml | 21 ++++++-- .../templates/fireworks/run-with-safety.yaml | 21 ++++++-- llama_stack/templates/fireworks/run.yaml | 24 +++++++-- llama_stack/templates/groq/run.yaml | 21 ++++++-- .../hf-endpoint/run-with-safety.yaml | 21 ++++++-- llama_stack/templates/hf-endpoint/run.yaml | 21 ++++++-- .../hf-serverless/run-with-safety.yaml | 21 ++++++-- llama_stack/templates/hf-serverless/run.yaml | 21 ++++++-- .../meta-reference-gpu/run-with-safety.yaml | 21 ++++++-- .../templates/meta-reference-gpu/run.yaml | 21 ++++++-- .../meta-reference-quantized-gpu/run.yaml | 21 ++++++-- llama_stack/templates/nvidia/run.yaml | 21 ++++++-- .../templates/ollama/run-with-safety.yaml | 21 ++++++-- llama_stack/templates/ollama/run.yaml | 24 +++++++-- llama_stack/templates/open-benchmark/run.yaml | 21 ++++++-- .../remote-vllm/run-with-safety.yaml | 24 +++++++-- llama_stack/templates/remote-vllm/run.yaml | 24 +++++++-- llama_stack/templates/sambanova/run.yaml | 3 +- .../templates/tgi/run-with-safety.yaml | 21 ++++++-- llama_stack/templates/tgi/run.yaml | 21 ++++++-- .../templates/together/run-with-safety.yaml | 21 ++++++-- llama_stack/templates/together/run.yaml | 24 +++++++-- llama_stack/templates/vllm-gpu/run.yaml | 21 ++++++-- tests/unit/providers/test_configs.py | 50 +++++++++++++++++++ 71 files changed, 662 insertions(+), 465 deletions(-) delete mode 100644 llama_stack/providers/inline/telemetry/sample/__init__.py delete mode 100644 llama_stack/providers/inline/telemetry/sample/config.py delete mode 100644 llama_stack/providers/inline/telemetry/sample/sample.py delete mode 100644 llama_stack/providers/remote/agents/sample/__init__.py delete mode 100644 llama_stack/providers/remote/agents/sample/config.py delete mode 100644 llama_stack/providers/remote/agents/sample/sample.py delete mode 100644 llama_stack/providers/remote/inference/sample/__init__.py delete mode 100644 llama_stack/providers/remote/inference/sample/config.py delete mode 100644 llama_stack/providers/remote/inference/sample/sample.py delete mode 100644 llama_stack/providers/remote/safety/sample/__init__.py delete mode 100644 llama_stack/providers/remote/safety/sample/config.py delete mode 100644 llama_stack/providers/remote/safety/sample/sample.py delete mode 100644 llama_stack/providers/remote/vector_io/sample/__init__.py delete mode 100644 llama_stack/providers/remote/vector_io/sample/config.py delete mode 100644 llama_stack/providers/remote/vector_io/sample/sample.py create mode 100644 tests/unit/providers/test_configs.py diff --git a/llama_stack/providers/inline/datasetio/localfs/config.py b/llama_stack/providers/inline/datasetio/localfs/config.py index f4f495b95..d74521f1f 100644 --- a/llama_stack/providers/inline/datasetio/localfs/config.py +++ b/llama_stack/providers/inline/datasetio/localfs/config.py @@ -3,9 +3,10 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel -from llama_stack.distribution.utils.config_dirs import RUNTIME_BASE_DIR from llama_stack.providers.utils.kvstore.config import ( KVStoreConfig, SqliteKVStoreConfig, @@ -13,6 +14,13 @@ from llama_stack.providers.utils.kvstore.config import ( class LocalFSDatasetIOConfig(BaseModel): - kvstore: KVStoreConfig = SqliteKVStoreConfig( - db_path=(RUNTIME_BASE_DIR / "localfs_datasetio.db").as_posix() - ) # Uses SQLite config specific to localfs storage + kvstore: KVStoreConfig + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "kvstore": SqliteKVStoreConfig.sample_run_config( + __distro_dir__=__distro_dir__, + db_name="localfs_datasetio.db", + ) + } diff --git a/llama_stack/providers/inline/eval/meta_reference/config.py b/llama_stack/providers/inline/eval/meta_reference/config.py index 95b780cca..5b2bec259 100644 --- a/llama_stack/providers/inline/eval/meta_reference/config.py +++ b/llama_stack/providers/inline/eval/meta_reference/config.py @@ -3,9 +3,10 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel -from llama_stack.distribution.utils.config_dirs import RUNTIME_BASE_DIR from llama_stack.providers.utils.kvstore.config import ( KVStoreConfig, SqliteKVStoreConfig, @@ -13,6 +14,13 @@ from llama_stack.providers.utils.kvstore.config import ( class MetaReferenceEvalConfig(BaseModel): - kvstore: KVStoreConfig = SqliteKVStoreConfig( - db_path=(RUNTIME_BASE_DIR / "meta_reference_eval.db").as_posix() - ) # Uses SQLite config specific to Meta Reference Eval storage + kvstore: KVStoreConfig + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "kvstore": SqliteKVStoreConfig.sample_run_config( + __distro_dir__=__distro_dir__, + db_name="meta_reference_eval.db", + ) + } diff --git a/llama_stack/providers/inline/inference/vllm/config.py b/llama_stack/providers/inline/inference/vllm/config.py index 0e85c9a48..51d48e6d5 100644 --- a/llama_stack/providers/inline/inference/vllm/config.py +++ b/llama_stack/providers/inline/inference/vllm/config.py @@ -4,6 +4,8 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel, Field from llama_stack.schema_utils import json_schema_type @@ -40,7 +42,7 @@ class VLLMConfig(BaseModel): ) @classmethod - def sample_run_config(cls): + def sample_run_config(cls, **kwargs: Any) -> Dict[str, Any]: return { "tensor_parallel_size": "${env.TENSOR_PARALLEL_SIZE:1}", "max_tokens": "${env.MAX_TOKENS:4096}", diff --git a/llama_stack/providers/inline/post_training/torchtune/config.py b/llama_stack/providers/inline/post_training/torchtune/config.py index 2f48ddfad..ee3504f9e 100644 --- a/llama_stack/providers/inline/post_training/torchtune/config.py +++ b/llama_stack/providers/inline/post_training/torchtune/config.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Literal, Optional +from typing import Any, Dict, Literal, Optional from pydantic import BaseModel @@ -12,3 +12,9 @@ from pydantic import BaseModel class TorchtunePostTrainingConfig(BaseModel): torch_seed: Optional[int] = None checkpoint_format: Optional[Literal["meta", "huggingface"]] = "meta" + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "checkpoint_format": "meta", + } diff --git a/llama_stack/providers/inline/safety/code_scanner/config.py b/llama_stack/providers/inline/safety/code_scanner/config.py index 75c90d69a..1d880ee9c 100644 --- a/llama_stack/providers/inline/safety/code_scanner/config.py +++ b/llama_stack/providers/inline/safety/code_scanner/config.py @@ -4,8 +4,12 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel class CodeScannerConfig(BaseModel): - pass + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return {} diff --git a/llama_stack/providers/inline/safety/llama_guard/config.py b/llama_stack/providers/inline/safety/llama_guard/config.py index 72036fd1c..53849ab33 100644 --- a/llama_stack/providers/inline/safety/llama_guard/config.py +++ b/llama_stack/providers/inline/safety/llama_guard/config.py @@ -4,10 +4,16 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import List +from typing import Any, Dict, List from pydantic import BaseModel class LlamaGuardConfig(BaseModel): excluded_categories: List[str] = [] + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "excluded_categories": [], + } diff --git a/llama_stack/providers/inline/safety/prompt_guard/config.py b/llama_stack/providers/inline/safety/prompt_guard/config.py index bddd28452..76bd5978d 100644 --- a/llama_stack/providers/inline/safety/prompt_guard/config.py +++ b/llama_stack/providers/inline/safety/prompt_guard/config.py @@ -5,6 +5,7 @@ # the root directory of this source tree. from enum import Enum +from typing import Any, Dict from pydantic import BaseModel, field_validator @@ -23,3 +24,9 @@ class PromptGuardConfig(BaseModel): if v not in [t.value for t in PromptGuardType]: raise ValueError(f"Unknown prompt guard type: {v}") return v + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "guard_type": "injection", + } diff --git a/llama_stack/providers/inline/scoring/basic/config.py b/llama_stack/providers/inline/scoring/basic/config.py index d9dbe71bc..5866be359 100644 --- a/llama_stack/providers/inline/scoring/basic/config.py +++ b/llama_stack/providers/inline/scoring/basic/config.py @@ -3,7 +3,12 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel -class BasicScoringConfig(BaseModel): ... +class BasicScoringConfig(BaseModel): + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return {} diff --git a/llama_stack/providers/inline/scoring/llm_as_judge/config.py b/llama_stack/providers/inline/scoring/llm_as_judge/config.py index 1b538420c..ff63fc5e7 100644 --- a/llama_stack/providers/inline/scoring/llm_as_judge/config.py +++ b/llama_stack/providers/inline/scoring/llm_as_judge/config.py @@ -3,7 +3,12 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel -class LlmAsJudgeScoringConfig(BaseModel): ... +class LlmAsJudgeScoringConfig(BaseModel): + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return {} diff --git a/llama_stack/providers/inline/telemetry/sample/__init__.py b/llama_stack/providers/inline/telemetry/sample/__init__.py deleted file mode 100644 index 4fb27ac27..000000000 --- a/llama_stack/providers/inline/telemetry/sample/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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 typing import Any - -from .config import SampleConfig - - -async def get_adapter_impl(config: SampleConfig, _deps) -> Any: - from .sample import SampleTelemetryImpl - - impl = SampleTelemetryImpl(config) - await impl.initialize() - return impl diff --git a/llama_stack/providers/inline/telemetry/sample/config.py b/llama_stack/providers/inline/telemetry/sample/config.py deleted file mode 100644 index 4b7404a26..000000000 --- a/llama_stack/providers/inline/telemetry/sample/config.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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 pydantic import BaseModel - - -class SampleConfig(BaseModel): - host: str = "localhost" - port: int = 9999 diff --git a/llama_stack/providers/inline/telemetry/sample/sample.py b/llama_stack/providers/inline/telemetry/sample/sample.py deleted file mode 100644 index a4147a1b2..000000000 --- a/llama_stack/providers/inline/telemetry/sample/sample.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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.telemetry import Telemetry - -from .config import SampleConfig - - -class SampleTelemetryImpl(Telemetry): - def __init__(self, config: SampleConfig): - self.config = config - - async def initialize(self): - pass diff --git a/llama_stack/providers/inline/tool_runtime/code_interpreter/config.py b/llama_stack/providers/inline/tool_runtime/code_interpreter/config.py index 167a2c318..7de1ec453 100644 --- a/llama_stack/providers/inline/tool_runtime/code_interpreter/config.py +++ b/llama_stack/providers/inline/tool_runtime/code_interpreter/config.py @@ -4,8 +4,12 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel class CodeInterpreterToolConfig(BaseModel): - pass + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return {} diff --git a/llama_stack/providers/inline/tool_runtime/rag/config.py b/llama_stack/providers/inline/tool_runtime/rag/config.py index 2d0d2f595..c75c3fc51 100644 --- a/llama_stack/providers/inline/tool_runtime/rag/config.py +++ b/llama_stack/providers/inline/tool_runtime/rag/config.py @@ -4,8 +4,12 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel class RagToolRuntimeConfig(BaseModel): - pass + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return {} diff --git a/llama_stack/providers/inline/vector_io/chroma/config.py b/llama_stack/providers/inline/vector_io/chroma/config.py index a1fb60fa6..1e333fe92 100644 --- a/llama_stack/providers/inline/vector_io/chroma/config.py +++ b/llama_stack/providers/inline/vector_io/chroma/config.py @@ -13,5 +13,5 @@ class ChromaVectorIOConfig(BaseModel): db_path: str @classmethod - def sample_config(cls) -> Dict[str, Any]: - return {"db_path": "{env.CHROMADB_PATH}"} + def sample_run_config(cls, db_path: str = "${env.CHROMADB_PATH}", **kwargs: Any) -> Dict[str, Any]: + return {"db_path": db_path} diff --git a/llama_stack/providers/registry/agents.py b/llama_stack/providers/registry/agents.py index 655303f98..3ed59304d 100644 --- a/llama_stack/providers/registry/agents.py +++ b/llama_stack/providers/registry/agents.py @@ -7,11 +7,9 @@ from typing import List from llama_stack.providers.datatypes import ( - AdapterSpec, Api, InlineProviderSpec, ProviderSpec, - remote_provider_spec, ) from llama_stack.providers.utils.kvstore import kvstore_dependencies @@ -39,13 +37,4 @@ def available_providers() -> List[ProviderSpec]: Api.tool_groups, ], ), - remote_provider_spec( - api=Api.agents, - adapter=AdapterSpec( - adapter_type="sample", - pip_packages=[], - module="llama_stack.providers.remote.agents.sample", - config_class="llama_stack.providers.remote.agents.sample.SampleConfig", - ), - ), ] diff --git a/llama_stack/providers/registry/inference.py b/llama_stack/providers/registry/inference.py index d5f095740..ca4dc59f7 100644 --- a/llama_stack/providers/registry/inference.py +++ b/llama_stack/providers/registry/inference.py @@ -68,15 +68,6 @@ def available_providers() -> List[ProviderSpec]: module="llama_stack.providers.inline.inference.sentence_transformers", config_class="llama_stack.providers.inline.inference.sentence_transformers.config.SentenceTransformersInferenceConfig", ), - remote_provider_spec( - api=Api.inference, - adapter=AdapterSpec( - adapter_type="sample", - pip_packages=[], - module="llama_stack.providers.remote.inference.sample", - config_class="llama_stack.providers.remote.inference.sample.SampleConfig", - ), - ), remote_provider_spec( api=Api.inference, adapter=AdapterSpec( diff --git a/llama_stack/providers/registry/safety.py b/llama_stack/providers/registry/safety.py index b9f7b6d78..1364352e6 100644 --- a/llama_stack/providers/registry/safety.py +++ b/llama_stack/providers/registry/safety.py @@ -27,27 +27,6 @@ def available_providers() -> List[ProviderSpec]: module="llama_stack.providers.inline.safety.prompt_guard", config_class="llama_stack.providers.inline.safety.prompt_guard.PromptGuardConfig", ), - InlineProviderSpec( - api=Api.safety, - provider_type="inline::meta-reference", - pip_packages=[ - "transformers", - "torch --index-url https://download.pytorch.org/whl/cpu", - ], - module="llama_stack.providers.inline.safety.meta_reference", - config_class="llama_stack.providers.inline.safety.meta_reference.SafetyConfig", - api_dependencies=[ - Api.inference, - ], - deprecation_error=""" -Provider `inline::meta-reference` for API `safety` does not work with the latest Llama Stack. - -- if you are using Llama Guard v3, please use the `inline::llama-guard` provider instead. -- if you are using Prompt Guard, please use the `inline::prompt-guard` provider instead. -- if you are using Code Scanner, please use the `inline::code-scanner` provider instead. - - """, - ), InlineProviderSpec( api=Api.safety, provider_type="inline::llama-guard", @@ -67,15 +46,6 @@ Provider `inline::meta-reference` for API `safety` does not work with the latest module="llama_stack.providers.inline.safety.code_scanner", config_class="llama_stack.providers.inline.safety.code_scanner.CodeScannerConfig", ), - remote_provider_spec( - api=Api.safety, - adapter=AdapterSpec( - adapter_type="sample", - pip_packages=[], - module="llama_stack.providers.remote.safety.sample", - config_class="llama_stack.providers.remote.safety.sample.SampleConfig", - ), - ), remote_provider_spec( api=Api.safety, adapter=AdapterSpec( diff --git a/llama_stack/providers/registry/telemetry.py b/llama_stack/providers/registry/telemetry.py index f3b41374c..fc249f3e2 100644 --- a/llama_stack/providers/registry/telemetry.py +++ b/llama_stack/providers/registry/telemetry.py @@ -7,11 +7,9 @@ from typing import List from llama_stack.providers.datatypes import ( - AdapterSpec, Api, InlineProviderSpec, ProviderSpec, - remote_provider_spec, ) @@ -28,13 +26,4 @@ def available_providers() -> List[ProviderSpec]: module="llama_stack.providers.inline.telemetry.meta_reference", config_class="llama_stack.providers.inline.telemetry.meta_reference.config.TelemetryConfig", ), - remote_provider_spec( - api=Api.telemetry, - adapter=AdapterSpec( - adapter_type="sample", - pip_packages=[], - module="llama_stack.providers.remote.telemetry.sample", - config_class="llama_stack.providers.remote.telemetry.sample.SampleConfig", - ), - ), ] diff --git a/llama_stack/providers/registry/vector_io.py b/llama_stack/providers/registry/vector_io.py index 8471748d8..fbc495d83 100644 --- a/llama_stack/providers/registry/vector_io.py +++ b/llama_stack/providers/registry/vector_io.py @@ -92,16 +92,6 @@ def available_providers() -> List[ProviderSpec]: ), api_dependencies=[Api.inference], ), - remote_provider_spec( - api=Api.vector_io, - adapter=AdapterSpec( - adapter_type="sample", - pip_packages=[], - module="llama_stack.providers.remote.vector_io.sample", - config_class="llama_stack.providers.remote.vector_io.sample.SampleVectorIOConfig", - ), - api_dependencies=[], - ), remote_provider_spec( Api.vector_io, AdapterSpec( diff --git a/llama_stack/providers/remote/agents/sample/__init__.py b/llama_stack/providers/remote/agents/sample/__init__.py deleted file mode 100644 index 94456d98b..000000000 --- a/llama_stack/providers/remote/agents/sample/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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 typing import Any - -from .config import SampleConfig - - -async def get_adapter_impl(config: SampleConfig, _deps) -> Any: - from .sample import SampleAgentsImpl - - impl = SampleAgentsImpl(config) - await impl.initialize() - return impl diff --git a/llama_stack/providers/remote/agents/sample/config.py b/llama_stack/providers/remote/agents/sample/config.py deleted file mode 100644 index 4b7404a26..000000000 --- a/llama_stack/providers/remote/agents/sample/config.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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 pydantic import BaseModel - - -class SampleConfig(BaseModel): - host: str = "localhost" - port: int = 9999 diff --git a/llama_stack/providers/remote/agents/sample/sample.py b/llama_stack/providers/remote/agents/sample/sample.py deleted file mode 100644 index 02e889496..000000000 --- a/llama_stack/providers/remote/agents/sample/sample.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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.agents import Agents - -from .config import SampleConfig - - -class SampleAgentsImpl(Agents): - def __init__(self, config: SampleConfig): - self.config = config - - async def initialize(self): - pass diff --git a/llama_stack/providers/remote/datasetio/huggingface/config.py b/llama_stack/providers/remote/datasetio/huggingface/config.py index 1cdae0625..c06996b6f 100644 --- a/llama_stack/providers/remote/datasetio/huggingface/config.py +++ b/llama_stack/providers/remote/datasetio/huggingface/config.py @@ -3,9 +3,10 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel -from llama_stack.distribution.utils.config_dirs import RUNTIME_BASE_DIR from llama_stack.providers.utils.kvstore.config import ( KVStoreConfig, SqliteKVStoreConfig, @@ -13,6 +14,13 @@ from llama_stack.providers.utils.kvstore.config import ( class HuggingfaceDatasetIOConfig(BaseModel): - kvstore: KVStoreConfig = SqliteKVStoreConfig( - db_path=(RUNTIME_BASE_DIR / "huggingface_datasetio.db").as_posix() - ) # Uses SQLite config specific to HF storage + kvstore: KVStoreConfig + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "kvstore": SqliteKVStoreConfig.sample_run_config( + __distro_dir__=__distro_dir__, + db_name="huggingface_datasetio.db", + ) + } diff --git a/llama_stack/providers/remote/inference/databricks/config.py b/llama_stack/providers/remote/inference/databricks/config.py index 6aaf7e594..1d51125cb 100644 --- a/llama_stack/providers/remote/inference/databricks/config.py +++ b/llama_stack/providers/remote/inference/databricks/config.py @@ -4,6 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict from pydantic import BaseModel, Field @@ -20,3 +21,15 @@ class DatabricksImplConfig(BaseModel): default=None, description="The Databricks API token", ) + + @classmethod + def sample_run_config( + cls, + url: str = "${env.DATABRICKS_URL}", + api_token: str = "${env.DATABRICKS_API_TOKEN}", + **kwargs: Any, + ) -> Dict[str, Any]: + return { + "url": url, + "api_token": api_token, + } diff --git a/llama_stack/providers/remote/inference/runpod/__init__.py b/llama_stack/providers/remote/inference/runpod/__init__.py index dcdfa9a84..69bf95046 100644 --- a/llama_stack/providers/remote/inference/runpod/__init__.py +++ b/llama_stack/providers/remote/inference/runpod/__init__.py @@ -5,10 +5,11 @@ # the root directory of this source tree. from .config import RunpodImplConfig -from .runpod import RunpodInferenceAdapter async def get_adapter_impl(config: RunpodImplConfig, _deps): + from .runpod import RunpodInferenceAdapter + assert isinstance(config, RunpodImplConfig), f"Unexpected config type: {type(config)}" impl = RunpodInferenceAdapter(config) await impl.initialize() diff --git a/llama_stack/providers/remote/inference/runpod/config.py b/llama_stack/providers/remote/inference/runpod/config.py index e59cfe59b..377a7fe6a 100644 --- a/llama_stack/providers/remote/inference/runpod/config.py +++ b/llama_stack/providers/remote/inference/runpod/config.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field @@ -21,3 +21,10 @@ class RunpodImplConfig(BaseModel): default=None, description="The API token", ) + + @classmethod + def sample_run_config(cls, **kwargs: Any) -> Dict[str, Any]: + return { + "url": "${env.RUNPOD_URL:}", + "api_token": "${env.RUNPOD_API_TOKEN:}", + } diff --git a/llama_stack/providers/remote/inference/runpod/runpod.py b/llama_stack/providers/remote/inference/runpod/runpod.py index 783842f71..72f858cd8 100644 --- a/llama_stack/providers/remote/inference/runpod/runpod.py +++ b/llama_stack/providers/remote/inference/runpod/runpod.py @@ -8,7 +8,6 @@ from typing import AsyncGenerator from openai import OpenAI from llama_stack.apis.inference import * # noqa: F403 -from llama_stack.models.llama.datatypes import Message # from llama_stack.providers.datatypes import ModelsProtocolPrivate from llama_stack.providers.utils.inference.model_registry import ModelRegistryHelper diff --git a/llama_stack/providers/remote/inference/sample/__init__.py b/llama_stack/providers/remote/inference/sample/__init__.py deleted file mode 100644 index 13263744e..000000000 --- a/llama_stack/providers/remote/inference/sample/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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 typing import Any - -from .config import SampleConfig - - -async def get_adapter_impl(config: SampleConfig, _deps) -> Any: - from .sample import SampleInferenceImpl - - impl = SampleInferenceImpl(config) - await impl.initialize() - return impl diff --git a/llama_stack/providers/remote/inference/sample/config.py b/llama_stack/providers/remote/inference/sample/config.py deleted file mode 100644 index 4b7404a26..000000000 --- a/llama_stack/providers/remote/inference/sample/config.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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 pydantic import BaseModel - - -class SampleConfig(BaseModel): - host: str = "localhost" - port: int = 9999 diff --git a/llama_stack/providers/remote/inference/sample/sample.py b/llama_stack/providers/remote/inference/sample/sample.py deleted file mode 100644 index 106381618..000000000 --- a/llama_stack/providers/remote/inference/sample/sample.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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.inference import Inference -from llama_stack.apis.models import Model - -from .config import SampleConfig - - -class SampleInferenceImpl(Inference): - def __init__(self, config: SampleConfig): - self.config = config - - async def register_model(self, model: Model) -> None: - # these are the model names the Llama Stack will use to route requests to this provider - # perform validation here if necessary - pass - - async def initialize(self): - pass diff --git a/llama_stack/providers/remote/safety/sample/__init__.py b/llama_stack/providers/remote/safety/sample/__init__.py deleted file mode 100644 index 83a8d0890..000000000 --- a/llama_stack/providers/remote/safety/sample/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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 typing import Any - -from .config import SampleConfig - - -async def get_adapter_impl(config: SampleConfig, _deps) -> Any: - from .sample import SampleSafetyImpl - - impl = SampleSafetyImpl(config) - await impl.initialize() - return impl diff --git a/llama_stack/providers/remote/safety/sample/config.py b/llama_stack/providers/remote/safety/sample/config.py deleted file mode 100644 index 4b7404a26..000000000 --- a/llama_stack/providers/remote/safety/sample/config.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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 pydantic import BaseModel - - -class SampleConfig(BaseModel): - host: str = "localhost" - port: int = 9999 diff --git a/llama_stack/providers/remote/safety/sample/sample.py b/llama_stack/providers/remote/safety/sample/sample.py deleted file mode 100644 index 7645c69e9..000000000 --- a/llama_stack/providers/remote/safety/sample/sample.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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.safety import Safety -from llama_stack.apis.shields import Shield - -from .config import SampleConfig - - -class SampleSafetyImpl(Safety): - def __init__(self, config: SampleConfig): - self.config = config - - async def register_shield(self, shield: Shield) -> None: - # these are the safety shields the Llama Stack will use to route requests to this provider - # perform validation here if necessary - pass - - async def initialize(self): - pass diff --git a/llama_stack/providers/remote/tool_runtime/bing_search/config.py b/llama_stack/providers/remote/tool_runtime/bing_search/config.py index 67283d8d5..4f089439f 100644 --- a/llama_stack/providers/remote/tool_runtime/bing_search/config.py +++ b/llama_stack/providers/remote/tool_runtime/bing_search/config.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel @@ -14,3 +14,9 @@ class BingSearchToolConfig(BaseModel): api_key: Optional[str] = None top_k: int = 3 + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "api_key": "${env.BING_API_KEY:}", + } diff --git a/llama_stack/providers/remote/tool_runtime/model_context_protocol/config.py b/llama_stack/providers/remote/tool_runtime/model_context_protocol/config.py index ffe4c9887..30ac407bc 100644 --- a/llama_stack/providers/remote/tool_runtime/model_context_protocol/config.py +++ b/llama_stack/providers/remote/tool_runtime/model_context_protocol/config.py @@ -4,8 +4,12 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel class ModelContextProtocolConfig(BaseModel): - pass + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return {} diff --git a/llama_stack/providers/remote/tool_runtime/wolfram_alpha/config.py b/llama_stack/providers/remote/tool_runtime/wolfram_alpha/config.py index 13996b639..8ea49c7b5 100644 --- a/llama_stack/providers/remote/tool_runtime/wolfram_alpha/config.py +++ b/llama_stack/providers/remote/tool_runtime/wolfram_alpha/config.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel @@ -13,3 +13,9 @@ class WolframAlphaToolConfig(BaseModel): """Configuration for WolframAlpha Tool Runtime""" api_key: Optional[str] = None + + @classmethod + def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]: + return { + "api_key": "${env.WOLFRAM_ALPHA_API_KEY:}", + } diff --git a/llama_stack/providers/remote/vector_io/qdrant/config.py b/llama_stack/providers/remote/vector_io/qdrant/config.py index f212882d8..ce68aa492 100644 --- a/llama_stack/providers/remote/vector_io/qdrant/config.py +++ b/llama_stack/providers/remote/vector_io/qdrant/config.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel @@ -24,3 +24,9 @@ class QdrantVectorIOConfig(BaseModel): timeout: Optional[int] = None host: Optional[str] = None path: Optional[str] = None + + @classmethod + def sample_run_config(cls, **kwargs: Any) -> Dict[str, Any]: + return { + "api_key": "${env.QDRANT_API_KEY}", + } diff --git a/llama_stack/providers/remote/vector_io/sample/__init__.py b/llama_stack/providers/remote/vector_io/sample/__init__.py deleted file mode 100644 index 221f47b1c..000000000 --- a/llama_stack/providers/remote/vector_io/sample/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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 typing import Any - -from .config import SampleVectorIOConfig - - -async def get_adapter_impl(config: SampleVectorIOConfig, _deps) -> Any: - from .sample import SampleVectorIOImpl - - impl = SampleVectorIOImpl(config) - await impl.initialize() - return impl diff --git a/llama_stack/providers/remote/vector_io/sample/config.py b/llama_stack/providers/remote/vector_io/sample/config.py deleted file mode 100644 index 5126e5eff..000000000 --- a/llama_stack/providers/remote/vector_io/sample/config.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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 pydantic import BaseModel - - -class SampleVectorIOConfig(BaseModel): - host: str = "localhost" - port: int = 9999 diff --git a/llama_stack/providers/remote/vector_io/sample/sample.py b/llama_stack/providers/remote/vector_io/sample/sample.py deleted file mode 100644 index cb7193cf4..000000000 --- a/llama_stack/providers/remote/vector_io/sample/sample.py +++ /dev/null @@ -1,26 +0,0 @@ -# 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.vector_dbs import VectorDB -from llama_stack.apis.vector_io import VectorIO - -from .config import SampleVectorIOConfig - - -class SampleVectorIOImpl(VectorIO): - def __init__(self, config: SampleVectorIOConfig): - self.config = config - - async def register_vector_db(self, vector_db: VectorDB) -> None: - # these are the vector dbs the Llama Stack will use to route requests to this provider - # perform validation here if necessary - pass - - async def initialize(self): - pass - - async def shutdown(self): - pass diff --git a/llama_stack/providers/remote/vector_io/weaviate/config.py b/llama_stack/providers/remote/vector_io/weaviate/config.py index 6aad9a5a6..cc587f252 100644 --- a/llama_stack/providers/remote/vector_io/weaviate/config.py +++ b/llama_stack/providers/remote/vector_io/weaviate/config.py @@ -4,6 +4,8 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +from typing import Any, Dict + from pydantic import BaseModel @@ -13,4 +15,6 @@ class WeaviateRequestProviderData(BaseModel): class WeaviateVectorIOConfig(BaseModel): - pass + @classmethod + def sample_run_config(cls, **kwargs: Any) -> Dict[str, Any]: + return {} diff --git a/llama_stack/templates/bedrock/run.yaml b/llama_stack/templates/bedrock/run.yaml index 00a02e0d5..39ed8cf48 100644 --- a/llama_stack/templates/bedrock/run.yaml +++ b/llama_stack/templates/bedrock/run.yaml @@ -45,14 +45,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/bedrock}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/bedrock}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/bedrock}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/cerebras/run.yaml b/llama_stack/templates/cerebras/run.yaml index 43d3158ba..8315f75d5 100644 --- a/llama_stack/templates/cerebras/run.yaml +++ b/llama_stack/templates/cerebras/run.yaml @@ -23,7 +23,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] vector_io: - provider_id: faiss provider_type: inline::faiss @@ -43,14 +44,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/cerebras}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/cerebras}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/cerebras}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/ci-tests/run.yaml b/llama_stack/templates/ci-tests/run.yaml index 715d7c86d..ae2b3912c 100644 --- a/llama_stack/templates/ci-tests/run.yaml +++ b/llama_stack/templates/ci-tests/run.yaml @@ -28,7 +28,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -47,14 +48,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ci-tests}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ci-tests}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ci-tests}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/dell/run-with-safety.yaml b/llama_stack/templates/dell/run-with-safety.yaml index ddec3a715..8a62a5a42 100644 --- a/llama_stack/templates/dell/run-with-safety.yaml +++ b/llama_stack/templates/dell/run-with-safety.yaml @@ -31,7 +31,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/dell/run.yaml b/llama_stack/templates/dell/run.yaml index 9394c94ef..31c63bd83 100644 --- a/llama_stack/templates/dell/run.yaml +++ b/llama_stack/templates/dell/run.yaml @@ -27,7 +27,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -46,14 +47,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/dev/run.yaml b/llama_stack/templates/dev/run.yaml index f908af8c3..dba13b357 100644 --- a/llama_stack/templates/dev/run.yaml +++ b/llama_stack/templates/dev/run.yaml @@ -57,7 +57,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -76,14 +77,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/fireworks/run-with-safety.yaml b/llama_stack/templates/fireworks/run-with-safety.yaml index e04141a07..2d79a3548 100644 --- a/llama_stack/templates/fireworks/run-with-safety.yaml +++ b/llama_stack/templates/fireworks/run-with-safety.yaml @@ -56,14 +56,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -88,7 +100,8 @@ providers: max_results: 3 - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} - provider_id: code-interpreter provider_type: inline::code-interpreter config: {} diff --git a/llama_stack/templates/fireworks/run.yaml b/llama_stack/templates/fireworks/run.yaml index 369b9ae7b..285495ad9 100644 --- a/llama_stack/templates/fireworks/run.yaml +++ b/llama_stack/templates/fireworks/run.yaml @@ -31,7 +31,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -82,7 +95,8 @@ providers: max_results: 3 - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} - provider_id: code-interpreter provider_type: inline::code-interpreter config: {} diff --git a/llama_stack/templates/groq/run.yaml b/llama_stack/templates/groq/run.yaml index 78212c8d9..6afea2355 100644 --- a/llama_stack/templates/groq/run.yaml +++ b/llama_stack/templates/groq/run.yaml @@ -31,7 +31,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/groq}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/groq}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/groq}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/hf-endpoint/run-with-safety.yaml b/llama_stack/templates/hf-endpoint/run-with-safety.yaml index 867d7a076..f6f23a987 100644 --- a/llama_stack/templates/hf-endpoint/run-with-safety.yaml +++ b/llama_stack/templates/hf-endpoint/run-with-safety.yaml @@ -36,7 +36,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -55,14 +56,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/hf-endpoint/run.yaml b/llama_stack/templates/hf-endpoint/run.yaml index d60acdefd..461f97128 100644 --- a/llama_stack/templates/hf-endpoint/run.yaml +++ b/llama_stack/templates/hf-endpoint/run.yaml @@ -31,7 +31,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/hf-serverless/run-with-safety.yaml b/llama_stack/templates/hf-serverless/run-with-safety.yaml index e58ad15b3..7f1724f34 100644 --- a/llama_stack/templates/hf-serverless/run-with-safety.yaml +++ b/llama_stack/templates/hf-serverless/run-with-safety.yaml @@ -36,7 +36,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -55,14 +56,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/hf-serverless/run.yaml b/llama_stack/templates/hf-serverless/run.yaml index 5045e821a..ac013488b 100644 --- a/llama_stack/templates/hf-serverless/run.yaml +++ b/llama_stack/templates/hf-serverless/run.yaml @@ -31,7 +31,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml b/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml index caac65c8c..190c08494 100644 --- a/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml +++ b/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml @@ -38,7 +38,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -57,14 +58,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/meta-reference-gpu/run.yaml b/llama_stack/templates/meta-reference-gpu/run.yaml index bade9a076..07763a4df 100644 --- a/llama_stack/templates/meta-reference-gpu/run.yaml +++ b/llama_stack/templates/meta-reference-gpu/run.yaml @@ -32,7 +32,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -51,14 +52,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/meta-reference-quantized-gpu/run.yaml b/llama_stack/templates/meta-reference-quantized-gpu/run.yaml index f131e8ea6..51b9dc250 100644 --- a/llama_stack/templates/meta-reference-quantized-gpu/run.yaml +++ b/llama_stack/templates/meta-reference-quantized-gpu/run.yaml @@ -34,7 +34,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -53,14 +54,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-quantized-gpu}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-quantized-gpu}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-quantized-gpu}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/nvidia/run.yaml b/llama_stack/templates/nvidia/run.yaml index 52e78df7b..213e22cb2 100644 --- a/llama_stack/templates/nvidia/run.yaml +++ b/llama_stack/templates/nvidia/run.yaml @@ -28,7 +28,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -47,14 +48,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/nvidia}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/nvidia}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/nvidia}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/ollama/run-with-safety.yaml b/llama_stack/templates/ollama/run-with-safety.yaml index a96031272..2b8eb44db 100644 --- a/llama_stack/templates/ollama/run-with-safety.yaml +++ b/llama_stack/templates/ollama/run-with-safety.yaml @@ -49,14 +49,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -90,7 +102,8 @@ providers: config: {} - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} metadata_store: type: sqlite db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/registry.db diff --git a/llama_stack/templates/ollama/run.yaml b/llama_stack/templates/ollama/run.yaml index 661d880a7..c9531f417 100644 --- a/llama_stack/templates/ollama/run.yaml +++ b/llama_stack/templates/ollama/run.yaml @@ -27,7 +27,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -46,14 +47,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -87,7 +100,8 @@ providers: config: {} - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} metadata_store: type: sqlite db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/registry.db diff --git a/llama_stack/templates/open-benchmark/run.yaml b/llama_stack/templates/open-benchmark/run.yaml index 97c54e621..5ef25435b 100644 --- a/llama_stack/templates/open-benchmark/run.yaml +++ b/llama_stack/templates/open-benchmark/run.yaml @@ -54,7 +54,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -73,14 +74,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/open-benchmark}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/open-benchmark}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/open-benchmark}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/remote-vllm/run-with-safety.yaml b/llama_stack/templates/remote-vllm/run-with-safety.yaml index 45af8427a..9741f5302 100644 --- a/llama_stack/templates/remote-vllm/run-with-safety.yaml +++ b/llama_stack/templates/remote-vllm/run-with-safety.yaml @@ -38,7 +38,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -98,7 +111,8 @@ providers: config: {} - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} metadata_store: type: sqlite db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/registry.db diff --git a/llama_stack/templates/remote-vllm/run.yaml b/llama_stack/templates/remote-vllm/run.yaml index 674085045..e26b20e88 100644 --- a/llama_stack/templates/remote-vllm/run.yaml +++ b/llama_stack/templates/remote-vllm/run.yaml @@ -32,7 +32,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -44,14 +45,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -92,7 +105,8 @@ providers: config: {} - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} metadata_store: type: sqlite db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/registry.db diff --git a/llama_stack/templates/sambanova/run.yaml b/llama_stack/templates/sambanova/run.yaml index cfa0cc194..616d82a61 100644 --- a/llama_stack/templates/sambanova/run.yaml +++ b/llama_stack/templates/sambanova/run.yaml @@ -37,7 +37,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/tgi/run-with-safety.yaml b/llama_stack/templates/tgi/run-with-safety.yaml index e1d85f59a..db54c0393 100644 --- a/llama_stack/templates/tgi/run-with-safety.yaml +++ b/llama_stack/templates/tgi/run-with-safety.yaml @@ -31,7 +31,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/tgi/run.yaml b/llama_stack/templates/tgi/run.yaml index fc73e0978..dafb59aa9 100644 --- a/llama_stack/templates/tgi/run.yaml +++ b/llama_stack/templates/tgi/run.yaml @@ -30,7 +30,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -49,14 +50,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/llama_stack/templates/together/run-with-safety.yaml b/llama_stack/templates/together/run-with-safety.yaml index 3a7d3dfba..e0bf46c11 100644 --- a/llama_stack/templates/together/run-with-safety.yaml +++ b/llama_stack/templates/together/run-with-safety.yaml @@ -56,14 +56,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -97,7 +109,8 @@ providers: config: {} - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} metadata_store: type: sqlite db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/registry.db diff --git a/llama_stack/templates/together/run.yaml b/llama_stack/templates/together/run.yaml index 10668914a..9d0acaf31 100644 --- a/llama_stack/templates/together/run.yaml +++ b/llama_stack/templates/together/run.yaml @@ -31,7 +31,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -50,14 +51,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -91,7 +104,8 @@ providers: config: {} - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha - config: {} + config: + api_key: ${env.WOLFRAM_ALPHA_API_KEY:} metadata_store: type: sqlite db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/registry.db diff --git a/llama_stack/templates/vllm-gpu/run.yaml b/llama_stack/templates/vllm-gpu/run.yaml index 8a15ff016..bf85de0a2 100644 --- a/llama_stack/templates/vllm-gpu/run.yaml +++ b/llama_stack/templates/vllm-gpu/run.yaml @@ -35,7 +35,8 @@ providers: safety: - provider_id: llama-guard provider_type: inline::llama-guard - config: {} + config: + excluded_categories: [] agents: - provider_id: meta-reference provider_type: inline::meta-reference @@ -54,14 +55,26 @@ providers: eval: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/vllm-gpu}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/vllm-gpu}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs - config: {} + config: + kvstore: + type: sqlite + namespace: null + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/vllm-gpu}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic diff --git a/tests/unit/providers/test_configs.py b/tests/unit/providers/test_configs.py new file mode 100644 index 000000000..246470372 --- /dev/null +++ b/tests/unit/providers/test_configs.py @@ -0,0 +1,50 @@ +# 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. + +import pytest +from pydantic import BaseModel + +from llama_stack.distribution.distribution import get_provider_registry, providable_apis +from llama_stack.distribution.utils.dynamic import instantiate_class_type + + +class TestProviderConfigurations: + """Test suite for testing provider configurations across all API types.""" + + def test_all_api_providers_exist(self): + provider_registry = get_provider_registry() + for api in providable_apis(): + providers = provider_registry.get(api, {}) + assert providers, f"No providers found for API type: {api}" + + @pytest.mark.parametrize("api", providable_apis()) + def test_api_providers(self, api): + provider_registry = get_provider_registry() + providers = provider_registry.get(api, {}) + assert providers, f"No providers found for API type: {api}" + + failures = [] + for provider_type, provider_spec in providers.items(): + try: + self._verify_provider_config(provider_type, provider_spec) + except Exception as e: + failures.append(f"Failed to verify {provider_type} config: {str(e)}") + + if failures: + pytest.fail("\n".join(failures)) + + def _verify_provider_config(self, provider_type, provider_spec): + """Helper method to verify a single provider configuration.""" + # Get the config class + config_class_name = provider_spec.config_class + config_type = instantiate_class_type(config_class_name) + + assert issubclass(config_type, BaseModel), f"{config_class_name} is not a subclass of BaseModel" + + assert hasattr(config_type, "sample_run_config"), f"{config_class_name} does not have sample_run_config method" + + sample_config = config_type.sample_run_config(__distro_dir__="foobarbaz") + assert isinstance(sample_config, dict), f"{config_class_name}.sample_run_config() did not return a dict"