From 9e3ea654c18ae3e22716499279e43fb5c332f0f0 Mon Sep 17 00:00:00 2001 From: Charlie Doern Date: Mon, 23 Jun 2025 11:20:54 -0400 Subject: [PATCH] feat: convert provider config to a file path currently provider.config is a dictionary. Introduce the ability to specify either a file path or the current in-file dictionary. Allowing users to specify a file path enables more robust config management allowing stack administrators to swap in different provider configs seamlessly Signed-off-by: Charlie Doern --- llama_stack/cli/stack/_build.py | 2 +- llama_stack/cli/stack/run.py | 4 +- llama_stack/distribution/configure.py | 3 +- llama_stack/distribution/datatypes.py | 5 +- llama_stack/distribution/distribution.py | 23 ++++ llama_stack/distribution/providers.py | 4 +- llama_stack/distribution/resolver.py | 15 +-- llama_stack/distribution/server/server.py | 8 +- llama_stack/distribution/stack.py | 122 +---------------- llama_stack/distribution/utils/env.py | 127 ++++++++++++++++++ .../providers/utils/sqlstore/sqlstore.py | 24 ++-- llama_stack/templates/bedrock/run.yaml | 4 +- llama_stack/templates/cerebras/run.yaml | 4 +- llama_stack/templates/ci-tests/run.yaml | 4 +- .../templates/dell/run-with-safety.yaml | 4 +- llama_stack/templates/dell/run.yaml | 4 +- .../templates/fireworks/run-with-safety.yaml | 6 +- llama_stack/templates/fireworks/run.yaml | 6 +- llama_stack/templates/groq/run.yaml | 4 +- .../hf-endpoint/run-with-safety.yaml | 4 +- llama_stack/templates/hf-endpoint/run.yaml | 4 +- .../hf-serverless/run-with-safety.yaml | 4 +- llama_stack/templates/hf-serverless/run.yaml | 4 +- llama_stack/templates/llama_api/run.yaml | 4 +- .../meta-reference-gpu/run-with-safety.yaml | 4 +- .../templates/meta-reference-gpu/run.yaml | 4 +- .../templates/nvidia/run-with-safety.yaml | 4 +- llama_stack/templates/nvidia/run.yaml | 4 +- .../templates/ollama/run-with-safety.yaml | 6 +- llama_stack/templates/ollama/run.yaml | 6 +- llama_stack/templates/open-benchmark/run.yaml | 4 +- .../passthrough/run-with-safety.yaml | 4 +- llama_stack/templates/passthrough/run.yaml | 4 +- llama_stack/templates/postgres-demo/run.yaml | 30 ++--- .../remote-vllm/run-with-safety.yaml | 4 +- llama_stack/templates/remote-vllm/run.yaml | 4 +- llama_stack/templates/sambanova/run.yaml | 4 +- .../templates/tgi/run-with-safety.yaml | 4 +- llama_stack/templates/tgi/run.yaml | 4 +- .../templates/together/run-with-safety.yaml | 4 +- llama_stack/templates/together/run.yaml | 4 +- llama_stack/templates/vllm-gpu/run.yaml | 4 +- llama_stack/templates/watsonx/run.yaml | 4 +- tests/unit/server/test_replace_env_vars.py | 2 +- 44 files changed, 266 insertions(+), 235 deletions(-) create mode 100644 llama_stack/distribution/utils/env.py diff --git a/llama_stack/cli/stack/_build.py b/llama_stack/cli/stack/_build.py index 7ade6f17a..7151b674a 100644 --- a/llama_stack/cli/stack/_build.py +++ b/llama_stack/cli/stack/_build.py @@ -37,9 +37,9 @@ from llama_stack.distribution.datatypes import ( ) from llama_stack.distribution.distribution import get_provider_registry from llama_stack.distribution.resolver import InvalidProviderError -from llama_stack.distribution.stack import replace_env_vars from llama_stack.distribution.utils.config_dirs import DISTRIBS_BASE_DIR, EXTERNAL_PROVIDERS_DIR from llama_stack.distribution.utils.dynamic import instantiate_class_type +from llama_stack.distribution.utils.env import replace_env_vars from llama_stack.distribution.utils.exec import formulate_run_args, run_command from llama_stack.distribution.utils.image_types import LlamaStackImageType from llama_stack.providers.datatypes import Api diff --git a/llama_stack/cli/stack/run.py b/llama_stack/cli/stack/run.py index 2f768957d..efbba73f2 100644 --- a/llama_stack/cli/stack/run.py +++ b/llama_stack/cli/stack/run.py @@ -156,7 +156,7 @@ class StackRun(Subcommand): if callable(getattr(args, arg)): continue if arg == "config" and template_name: - server_args.config = str(config_file) + server_args.template = str(template_name) else: setattr(server_args, arg, getattr(args, arg)) @@ -169,6 +169,8 @@ class StackRun(Subcommand): if config_file: run_args.extend(["--config", str(config_file)]) + if template_name: + run_args.extend(["--template", str(template_name)]) if args.env: for env_var in args.env: diff --git a/llama_stack/distribution/configure.py b/llama_stack/distribution/configure.py index e58ea0338..45dd82074 100644 --- a/llama_stack/distribution/configure.py +++ b/llama_stack/distribution/configure.py @@ -16,6 +16,7 @@ from llama_stack.distribution.datatypes import ( from llama_stack.distribution.distribution import ( builtin_automatically_routed_apis, get_provider_registry, + resolve_config, ) from llama_stack.distribution.utils.config_dirs import EXTERNAL_PROVIDERS_DIR from llama_stack.distribution.utils.dynamic import instantiate_class_type @@ -30,7 +31,7 @@ def configure_single_provider(registry: dict[str, ProviderSpec], provider: Provi config_type = instantiate_class_type(provider_spec.config_class) try: if provider.config: - existing = config_type(**provider.config) + existing = resolve_config(provider=provider, provider_spec=provider_spec) else: existing = None except Exception: diff --git a/llama_stack/distribution/datatypes.py b/llama_stack/distribution/datatypes.py index e07da001e..2e2e31bde 100644 --- a/llama_stack/distribution/datatypes.py +++ b/llama_stack/distribution/datatypes.py @@ -148,7 +148,10 @@ in the runtime configuration to help route to the correct provider.""", class Provider(BaseModel): provider_id: str provider_type: str - config: dict[str, Any] + config: Path | dict[str, Any] | None = Field( + default=None, + description="Provider configuration dictionary or path to provider configuration file", + ) class LoggingConfig(BaseModel): diff --git a/llama_stack/distribution/distribution.py b/llama_stack/distribution/distribution.py index e37b2c443..a2a0c855f 100644 --- a/llama_stack/distribution/distribution.py +++ b/llama_stack/distribution/distribution.py @@ -7,11 +7,15 @@ import glob import importlib import os +from pathlib import Path from typing import Any import yaml from pydantic import BaseModel +from llama_stack.distribution.datatypes import Provider +from llama_stack.distribution.utils.dynamic import instantiate_class_type +from llama_stack.distribution.utils.env import replace_env_vars from llama_stack.log import get_logger from llama_stack.providers.datatypes import ( AdapterSpec, @@ -188,3 +192,22 @@ def get_provider_registry( logger.error(f"Failed to load provider spec from {spec_path}: {e}") raise e return ret + + +def resolve_config(provider: Provider, provider_spec: ProviderSpec | None = None, api: str | None = None): + if not provider_spec: + if not api: + raise ValueError("In order to get provider spec, must have API") + registry = get_provider_registry() + provider_spec = registry[Api(api)][provider.provider_type] + config_type = instantiate_class_type(provider_spec.config_class) + try: + if provider.config and isinstance(provider.config, Path): + with open(provider.config.expanduser().resolve()) as f: + config: dict[str, Any] = yaml.safe_load(f) + replaced = replace_env_vars(config) + return config_type(**replaced) + elif provider.config is not None: + return config_type(**provider.config) + except Exception as e: + raise ValueError("Error getting provider config") from e diff --git a/llama_stack/distribution/providers.py b/llama_stack/distribution/providers.py index f238e3bba..04518b951 100644 --- a/llama_stack/distribution/providers.py +++ b/llama_stack/distribution/providers.py @@ -10,6 +10,7 @@ from typing import Any from pydantic import BaseModel from llama_stack.apis.providers import ListProvidersResponse, ProviderInfo, Providers +from llama_stack.distribution.distribution import resolve_config from llama_stack.log import get_logger from llama_stack.providers.datatypes import HealthResponse, HealthStatus @@ -48,12 +49,13 @@ class ProviderImpl(Providers): ret = [] for api, providers in safe_config.providers.items(): for p in providers: + config = resolve_config(provider=p, api=api) ret.append( ProviderInfo( api=api, provider_id=p.provider_id, provider_type=p.provider_type, - config=p.config, + config=dict(config), health=providers_health.get(api, {}).get( p.provider_id, HealthResponse( diff --git a/llama_stack/distribution/resolver.py b/llama_stack/distribution/resolver.py index 3726bb3a5..b25270507 100644 --- a/llama_stack/distribution/resolver.py +++ b/llama_stack/distribution/resolver.py @@ -34,9 +34,8 @@ from llama_stack.distribution.datatypes import ( RoutingTableProviderSpec, StackRunConfig, ) -from llama_stack.distribution.distribution import builtin_automatically_routed_apis +from llama_stack.distribution.distribution import builtin_automatically_routed_apis, resolve_config from llama_stack.distribution.store import DistributionRegistry -from llama_stack.distribution.utils.dynamic import instantiate_class_type from llama_stack.log import get_logger from llama_stack.providers.datatypes import ( Api, @@ -156,7 +155,7 @@ def specs_for_autorouted_apis(apis_to_serve: list[str] | set[str]) -> dict[str, "__builtin__": ProviderWithSpec( provider_id="__routing_table__", provider_type="__routing_table__", - config={}, + config=None, spec=RoutingTableProviderSpec( api=info.routing_table_api, router_api=info.router_api, @@ -171,7 +170,7 @@ def specs_for_autorouted_apis(apis_to_serve: list[str] | set[str]) -> dict[str, "__builtin__": ProviderWithSpec( provider_id="__autorouted__", provider_type="__autorouted__", - config={}, + config=None, spec=AutoRoutedProviderSpec( api=info.router_api, module="llama_stack.distribution.routers", @@ -325,8 +324,8 @@ async def instantiate_provider( module = importlib.import_module(provider_spec.module) args = [] if isinstance(provider_spec, RemoteProviderSpec): - config_type = instantiate_class_type(provider_spec.config_class) - config = config_type(**provider.config) + # config_type = instantiate_class_type(provider_spec.config_class) + config = resolve_config(provider=provider, provider_spec=provider_spec) method = "get_adapter_impl" args = [config, deps] @@ -344,8 +343,8 @@ async def instantiate_provider( else: method = "get_provider_impl" - config_type = instantiate_class_type(provider_spec.config_class) - config = config_type(**provider.config) + # config_type = instantiate_class_type(provider_spec.config_class) + config = resolve_config(provider=provider, provider_spec=provider_spec) args = [config, deps] if "policy" in inspect.signature(getattr(module, method)).parameters: args.append(policy) diff --git a/llama_stack/distribution/server/server.py b/llama_stack/distribution/server/server.py index 83407a25f..b7c1e2815 100644 --- a/llama_stack/distribution/server/server.py +++ b/llama_stack/distribution/server/server.py @@ -42,11 +42,10 @@ from llama_stack.distribution.server.routes import ( ) from llama_stack.distribution.stack import ( construct_stack, - replace_env_vars, - validate_env_pair, ) from llama_stack.distribution.utils.config import redact_sensitive_fields from llama_stack.distribution.utils.context import preserve_contexts_async_generator +from llama_stack.distribution.utils.env import replace_env_vars, validate_env_pair from llama_stack.log import get_logger from llama_stack.providers.datatypes import Api from llama_stack.providers.inline.telemetry.meta_reference.config import TelemetryConfig @@ -408,9 +407,10 @@ def main(args: argparse.Namespace | None = None): log_line = f"Using config file: {config_file}" elif args.template: config_file = Path(REPO_ROOT) / "llama_stack" / "templates" / args.template / "run.yaml" - if not config_file.exists(): + provider_configs = Path(REPO_ROOT) / "llama_stack" / "templates" / args.config / "provider_configs" + if not config_file.exists() or not provider_configs.exists(): raise ValueError(f"Template {args.template} does not exist") - log_line = f"Using template {args.template} config file: {config_file}" + log_line = f"Using template {args.template} config file: {config_file} and provider_config directory: {provider_configs}" else: raise ValueError("Either --config or --template must be provided") diff --git a/llama_stack/distribution/stack.py b/llama_stack/distribution/stack.py index c86880669..6afa05678 100644 --- a/llama_stack/distribution/stack.py +++ b/llama_stack/distribution/stack.py @@ -5,8 +5,6 @@ # the root directory of this source tree. import importlib.resources -import os -import re import tempfile from typing import Any @@ -40,6 +38,7 @@ from llama_stack.distribution.providers import ProviderImpl, ProviderImplConfig from llama_stack.distribution.resolver import ProviderRegistry, resolve_impls from llama_stack.distribution.store.registry import create_dist_registry from llama_stack.distribution.utils.dynamic import instantiate_class_type +from llama_stack.distribution.utils.env import replace_env_vars from llama_stack.log import get_logger from llama_stack.providers.datatypes import Api @@ -123,125 +122,6 @@ async def register_resources(run_config: StackRunConfig, impls: dict[Api, Any]): ) -class EnvVarError(Exception): - def __init__(self, var_name: str, path: str = ""): - self.var_name = var_name - self.path = path - super().__init__( - f"Environment variable '{var_name}' not set or empty {f'at {path}' if path else ''}. " - f"Use ${{env.{var_name}:=default_value}} to provide a default value, " - f"${{env.{var_name}:+value_if_set}} to make the field conditional, " - f"or ensure the environment variable is set." - ) - - -def replace_env_vars(config: Any, path: str = "") -> Any: - if isinstance(config, dict): - result = {} - for k, v in config.items(): - try: - result[k] = replace_env_vars(v, f"{path}.{k}" if path else k) - except EnvVarError as e: - raise EnvVarError(e.var_name, e.path) from None - return result - - elif isinstance(config, list): - result = [] - for i, v in enumerate(config): - try: - result.append(replace_env_vars(v, f"{path}[{i}]")) - except EnvVarError as e: - raise EnvVarError(e.var_name, e.path) from None - return result - - elif isinstance(config, str): - # Pattern supports bash-like syntax: := for default and :+ for conditional and a optional value - pattern = r"\${env\.([A-Z0-9_]+)(?::([=+])([^}]*))?}" - - def get_env_var(match: re.Match): - env_var = match.group(1) - operator = match.group(2) # '=' for default, '+' for conditional - value_expr = match.group(3) - - env_value = os.environ.get(env_var) - - if operator == "=": # Default value syntax: ${env.FOO:=default} - if not env_value: - # value_expr returns empty string (not None) when not matched - # This means ${env.FOO:=} is an error - if value_expr == "": - raise EnvVarError(env_var, path) - else: - value = value_expr - else: - value = env_value - elif operator == "+": # Conditional value syntax: ${env.FOO:+value_if_set} - if env_value: - value = value_expr - else: - # If env var is not set, return empty string for the conditional case - value = "" - else: # No operator case: ${env.FOO} - if not env_value: - raise EnvVarError(env_var, path) - value = env_value - - # expand "~" from the values - return os.path.expanduser(value) - - try: - result = re.sub(pattern, get_env_var, config) - return _convert_string_to_proper_type(result) - except EnvVarError as e: - raise EnvVarError(e.var_name, e.path) from None - - return config - - -def _convert_string_to_proper_type(value: str) -> Any: - # This might be tricky depending on what the config type is, if 'str | None' we are - # good, if 'str' we need to keep the empty string... 'str | None' is more common and - # providers config should be typed this way. - # TODO: we could try to load the config class and see if the config has a field with type 'str | None' - # and then convert the empty string to None or not - if value == "": - return None - - lowered = value.lower() - if lowered == "true": - return True - elif lowered == "false": - return False - - try: - return int(value) - except ValueError: - pass - - try: - return float(value) - except ValueError: - pass - - return value - - -def validate_env_pair(env_pair: str) -> tuple[str, str]: - """Validate and split an environment variable key-value pair.""" - try: - key, value = env_pair.split("=", 1) - key = key.strip() - if not key: - raise ValueError(f"Empty key in environment variable pair: {env_pair}") - if not all(c.isalnum() or c == "_" for c in key): - raise ValueError(f"Key must contain only alphanumeric characters and underscores: {key}") - return key, value - except ValueError as e: - raise ValueError( - f"Invalid environment variable format '{env_pair}': {str(e)}. Expected format: KEY=value" - ) from e - - def add_internal_implementations(impls: dict[Api, Any], run_config: StackRunConfig) -> None: """Add internal implementations (inspect and providers) to the implementations dictionary. diff --git a/llama_stack/distribution/utils/env.py b/llama_stack/distribution/utils/env.py new file mode 100644 index 000000000..f10eafb06 --- /dev/null +++ b/llama_stack/distribution/utils/env.py @@ -0,0 +1,127 @@ +# 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 os +import re +from typing import Any + +from llama_stack.log import get_logger + +logger = get_logger(name=__name__, category="core") + + +class EnvVarError(Exception): + def __init__(self, var_name: str, path: str = ""): + self.var_name = var_name + self.path = path + super().__init__(f"Environment variable '{var_name}' not set or empty{f' at {path}' if path else ''}") + + +def replace_env_vars(config: Any, path: str = "") -> Any: + if isinstance(config, dict): + result_dict: dict[Any, Any] = {} + for k, v in config.items(): + try: + result_dict[k] = replace_env_vars(v, f"{path}.{k}" if path else k) + except EnvVarError as e: + raise EnvVarError(e.var_name, e.path) from None + return result_dict + + elif isinstance(config, list): + result_list: list[Any] = [] + for i, v in enumerate(config): + try: + result_list.append(replace_env_vars(v, f"{path}[{i}]")) + except EnvVarError as e: + raise EnvVarError(e.var_name, e.path) from None + return result_list + + elif isinstance(config, str): + # Pattern supports bash-like syntax: := for default and :+ for conditional and a optional value + pattern = r"\${env\.([A-Z0-9_]+)(?::([=+])([^}]*))?}" + + def get_env_var(match: re.Match): + env_var = match.group(1) + operator = match.group(2) # '=' for default, '+' for conditional + value_expr = match.group(3) + + env_value = os.environ.get(env_var) + + if operator == "=": # Default value syntax: ${env.FOO:=default} + if not env_value: + # value_expr returns empty string (not None) when not matched + # This means ${env.FOO:=} is an error + if value_expr == "": + raise EnvVarError(env_var, path) + else: + value = value_expr + else: + value = env_value + elif operator == "+": # Conditional value syntax: ${env.FOO:+value_if_set} + if env_value: + value = value_expr + else: + # If env var is not set, return empty string for the conditional case + value = "" + else: # No operator case: ${env.FOO} + if not env_value: + raise EnvVarError(env_var, path) + value = env_value + + # expand "~" from the values + return os.path.expanduser(value) + + try: + result: str = re.sub(pattern, get_env_var, config) + return _convert_string_to_proper_type(result) + except EnvVarError as e: + raise EnvVarError(e.var_name, e.path) from None + + return config + + +def validate_env_pair(env_pair: str) -> tuple[str, str]: + """Validate and split an environment variable key-value pair.""" + try: + key, value = env_pair.split("=", 1) + key = key.strip() + if not key: + raise ValueError(f"Empty key in environment variable pair: {env_pair}") + if not all(c.isalnum() or c == "_" for c in key): + raise ValueError(f"Key must contain only alphanumeric characters and underscores: {key}") + return key, value + except ValueError as e: + raise ValueError( + f"Invalid environment variable format '{env_pair}': {str(e)}. Expected format: KEY=value" + ) from e + + +def _convert_string_to_proper_type(value: str) -> Any: + # This might be tricky depending on what the config type is, if 'str | None' we are + # good, if 'str' we need to keep the empty string... 'str | None' is more common and + # providers config should be typed this way. + # TODO: we could try to load the config class and see if the config has a field with type 'str | None' + # and then convert the empty string to None or not + if value == "": + return None + + lowered = value.lower() + if lowered == "true": + return True + elif lowered == "false": + return False + + try: + return int(value) + except ValueError: + pass + + try: + return float(value) + except ValueError: + pass + + return value diff --git a/llama_stack/providers/utils/sqlstore/sqlstore.py b/llama_stack/providers/utils/sqlstore/sqlstore.py index d558a2a26..29041e96c 100644 --- a/llama_stack/providers/utils/sqlstore/sqlstore.py +++ b/llama_stack/providers/utils/sqlstore/sqlstore.py @@ -48,10 +48,10 @@ class SqliteSqlStoreConfig(SqlAlchemySqlStoreConfig): @classmethod def sample_run_config(cls, __distro_dir__: str, db_name: str = "sqlstore.db"): - return cls( - type="sqlite", - db_path="${env.SQLITE_STORE_DIR:=" + __distro_dir__ + "}/" + db_name, - ) + return { + "type": "sqlite", + "db_path": "${env.SQLITE_STORE_DIR:=" + __distro_dir__ + "}/" + db_name, + } @property def pip_packages(self) -> list[str]: @@ -76,14 +76,14 @@ class PostgresSqlStoreConfig(SqlAlchemySqlStoreConfig): @classmethod def sample_run_config(cls, **kwargs): - return cls( - type="postgres", - host="${env.POSTGRES_HOST:=localhost}", - port="${env.POSTGRES_PORT:=5432}", - db="${env.POSTGRES_DB:=llamastack}", - user="${env.POSTGRES_USER:=llamastack}", - password="${env.POSTGRES_PASSWORD:=llamastack}", - ) + return { + "type": "postgres", + "host": "${env.POSTGRES_HOST:=localhost}", + "port": "${env.POSTGRES_PORT:=5432}", + "db": "${env.POSTGRES_DB:=llamastack}", + "user": "${env.POSTGRES_USER:=llamastack}", + "password": "${env.POSTGRES_PASSWORD:=llamastack}", + } SqlStoreConfig = Annotated[ diff --git a/llama_stack/templates/bedrock/run.yaml b/llama_stack/templates/bedrock/run.yaml index 61bc83f02..6c13a2eeb 100644 --- a/llama_stack/templates/bedrock/run.yaml +++ b/llama_stack/templates/bedrock/run.yaml @@ -37,7 +37,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/bedrock}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/bedrock}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/bedrock}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -101,7 +101,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/bedrock}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/bedrock}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/bedrock}/inference_store.db models: - metadata: {} model_id: meta.llama3-1-8b-instruct-v1:0 diff --git a/llama_stack/templates/cerebras/run.yaml b/llama_stack/templates/cerebras/run.yaml index 9bd8fcc7c..e0bc72f49 100644 --- a/llama_stack/templates/cerebras/run.yaml +++ b/llama_stack/templates/cerebras/run.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/cerebras}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/cerebras}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/cerebras}/responses_store.db eval: - provider_id: meta-reference provider_type: inline::meta-reference @@ -104,7 +104,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/cerebras}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/cerebras}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/cerebras}/inference_store.db models: - metadata: {} model_id: llama3.1-8b diff --git a/llama_stack/templates/ci-tests/run.yaml b/llama_stack/templates/ci-tests/run.yaml index 4b7de1c0c..a7a802d91 100644 --- a/llama_stack/templates/ci-tests/run.yaml +++ b/llama_stack/templates/ci-tests/run.yaml @@ -40,7 +40,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ci-tests}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -104,7 +104,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ci-tests}/inference_store.db models: - metadata: {} model_id: accounts/fireworks/models/llama-v3p1-8b-instruct diff --git a/llama_stack/templates/dell/run-with-safety.yaml b/llama_stack/templates/dell/run-with-safety.yaml index 7f1d0a8c0..3e5dd48c9 100644 --- a/llama_stack/templates/dell/run-with-safety.yaml +++ b/llama_stack/templates/dell/run-with-safety.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -104,7 +104,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/dell/run.yaml b/llama_stack/templates/dell/run.yaml index 310f3cc20..424747e38 100644 --- a/llama_stack/templates/dell/run.yaml +++ b/llama_stack/templates/dell/run.yaml @@ -39,7 +39,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -100,7 +100,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/dell}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dell}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/fireworks/run-with-safety.yaml b/llama_stack/templates/fireworks/run-with-safety.yaml index 6265f5cae..c9e288c9a 100644 --- a/llama_stack/templates/fireworks/run-with-safety.yaml +++ b/llama_stack/templates/fireworks/run-with-safety.yaml @@ -49,7 +49,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -98,7 +98,7 @@ providers: storage_dir: ${env.FILES_STORAGE_DIR:=~/.llama/distributions/fireworks/files} metadata_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/files_metadata.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/files_metadata.db tool_runtime: - provider_id: brave-search provider_type: remote::brave-search @@ -125,7 +125,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/inference_store.db models: - metadata: {} model_id: accounts/fireworks/models/llama-v3p1-8b-instruct diff --git a/llama_stack/templates/fireworks/run.yaml b/llama_stack/templates/fireworks/run.yaml index e10404e92..8e6a1f079 100644 --- a/llama_stack/templates/fireworks/run.yaml +++ b/llama_stack/templates/fireworks/run.yaml @@ -44,7 +44,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -93,7 +93,7 @@ providers: storage_dir: ${env.FILES_STORAGE_DIR:=~/.llama/distributions/fireworks/files} metadata_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/files_metadata.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/files_metadata.db tool_runtime: - provider_id: brave-search provider_type: remote::brave-search @@ -120,7 +120,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/fireworks}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/fireworks}/inference_store.db models: - metadata: {} model_id: accounts/fireworks/models/llama-v3p1-8b-instruct diff --git a/llama_stack/templates/groq/run.yaml b/llama_stack/templates/groq/run.yaml index 21c8f7e0f..2c02b3f9d 100644 --- a/llama_stack/templates/groq/run.yaml +++ b/llama_stack/templates/groq/run.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/groq}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/groq}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/groq}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -104,7 +104,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/groq}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/groq}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/groq}/inference_store.db models: - metadata: {} model_id: groq/llama3-8b-8192 diff --git a/llama_stack/templates/hf-endpoint/run-with-safety.yaml b/llama_stack/templates/hf-endpoint/run-with-safety.yaml index 2ae1d7685..1c0f1da3c 100644 --- a/llama_stack/templates/hf-endpoint/run-with-safety.yaml +++ b/llama_stack/templates/hf-endpoint/run-with-safety.yaml @@ -48,7 +48,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -112,7 +112,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/hf-endpoint/run.yaml b/llama_stack/templates/hf-endpoint/run.yaml index 3ec5ae9c1..4d36dfc21 100644 --- a/llama_stack/templates/hf-endpoint/run.yaml +++ b/llama_stack/templates/hf-endpoint/run.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -107,7 +107,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-endpoint}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-endpoint}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/hf-serverless/run-with-safety.yaml b/llama_stack/templates/hf-serverless/run-with-safety.yaml index 3871b77e7..eaad8a430 100644 --- a/llama_stack/templates/hf-serverless/run-with-safety.yaml +++ b/llama_stack/templates/hf-serverless/run-with-safety.yaml @@ -48,7 +48,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -112,7 +112,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/hf-serverless/run.yaml b/llama_stack/templates/hf-serverless/run.yaml index 0a5b59400..200c2f300 100644 --- a/llama_stack/templates/hf-serverless/run.yaml +++ b/llama_stack/templates/hf-serverless/run.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -107,7 +107,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/hf-serverless}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/hf-serverless}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/llama_api/run.yaml b/llama_stack/templates/llama_api/run.yaml index b627ed2f1..a6d9a099d 100644 --- a/llama_stack/templates/llama_api/run.yaml +++ b/llama_stack/templates/llama_api/run.yaml @@ -52,7 +52,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/llama_api}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/llama_api}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/llama_api}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -116,7 +116,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/llama_api}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/llama_api}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/llama_api}/inference_store.db models: - metadata: {} model_id: Llama-3.3-70B-Instruct 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 6b15a1e01..b5030719e 100644 --- a/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml +++ b/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml @@ -58,7 +58,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -122,7 +122,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/meta-reference-gpu/run.yaml b/llama_stack/templates/meta-reference-gpu/run.yaml index 1b44a0b3e..a4e0380ae 100644 --- a/llama_stack/templates/meta-reference-gpu/run.yaml +++ b/llama_stack/templates/meta-reference-gpu/run.yaml @@ -48,7 +48,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -112,7 +112,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/meta-reference-gpu}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/meta-reference-gpu}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/nvidia/run-with-safety.yaml b/llama_stack/templates/nvidia/run-with-safety.yaml index 875fccc9d..ed6f47def 100644 --- a/llama_stack/templates/nvidia/run-with-safety.yaml +++ b/llama_stack/templates/nvidia/run-with-safety.yaml @@ -48,7 +48,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/nvidia}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -97,7 +97,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/nvidia}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/nvidia/run.yaml b/llama_stack/templates/nvidia/run.yaml index 4477d5244..81281c44f 100644 --- a/llama_stack/templates/nvidia/run.yaml +++ b/llama_stack/templates/nvidia/run.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/nvidia}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -85,7 +85,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/nvidia}/inference_store.db models: - metadata: {} model_id: meta/llama3-8b-instruct diff --git a/llama_stack/templates/ollama/run-with-safety.yaml b/llama_stack/templates/ollama/run-with-safety.yaml index 5e906a12c..f80d9f89a 100644 --- a/llama_stack/templates/ollama/run-with-safety.yaml +++ b/llama_stack/templates/ollama/run-with-safety.yaml @@ -44,7 +44,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -93,7 +93,7 @@ providers: storage_dir: ${env.FILES_STORAGE_DIR:=~/.llama/distributions/ollama/files} metadata_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/files_metadata.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/files_metadata.db post_training: - provider_id: huggingface provider_type: inline::huggingface @@ -127,7 +127,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/ollama/run.yaml b/llama_stack/templates/ollama/run.yaml index d2b4e3978..e0c79d533 100644 --- a/llama_stack/templates/ollama/run.yaml +++ b/llama_stack/templates/ollama/run.yaml @@ -42,7 +42,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -91,7 +91,7 @@ providers: storage_dir: ${env.FILES_STORAGE_DIR:=~/.llama/distributions/ollama/files} metadata_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/files_metadata.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/files_metadata.db post_training: - provider_id: huggingface provider_type: inline::huggingface @@ -125,7 +125,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/ollama}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/open-benchmark/run.yaml b/llama_stack/templates/open-benchmark/run.yaml index 403b0fd3d..e22089617 100644 --- a/llama_stack/templates/open-benchmark/run.yaml +++ b/llama_stack/templates/open-benchmark/run.yaml @@ -66,7 +66,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/open-benchmark}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/open-benchmark}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/open-benchmark}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -130,7 +130,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/open-benchmark}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/open-benchmark}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/open-benchmark}/inference_store.db models: - metadata: {} model_id: openai/gpt-4o diff --git a/llama_stack/templates/passthrough/run-with-safety.yaml b/llama_stack/templates/passthrough/run-with-safety.yaml index c5b047511..a45cbdb4d 100644 --- a/llama_stack/templates/passthrough/run-with-safety.yaml +++ b/llama_stack/templates/passthrough/run-with-safety.yaml @@ -48,7 +48,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/passthrough}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -116,7 +116,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/passthrough}/inference_store.db models: - metadata: {} model_id: meta-llama/Llama-3.1-8B-Instruct diff --git a/llama_stack/templates/passthrough/run.yaml b/llama_stack/templates/passthrough/run.yaml index 896b3c91e..985536bac 100644 --- a/llama_stack/templates/passthrough/run.yaml +++ b/llama_stack/templates/passthrough/run.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/passthrough}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -111,7 +111,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/passthrough}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/passthrough}/inference_store.db models: - metadata: {} model_id: meta-llama/Llama-3.1-8B-Instruct diff --git a/llama_stack/templates/postgres-demo/run.yaml b/llama_stack/templates/postgres-demo/run.yaml index 03b7a59fb..510eefbc7 100644 --- a/llama_stack/templates/postgres-demo/run.yaml +++ b/llama_stack/templates/postgres-demo/run.yaml @@ -33,20 +33,14 @@ providers: - provider_id: meta-reference provider_type: inline::meta-reference config: - persistence_store: + persistence_store: &id001 type: postgres - host: ${env.POSTGRES_HOST:=localhost} - port: ${env.POSTGRES_PORT:=5432} - db: ${env.POSTGRES_DB:=llamastack} - user: ${env.POSTGRES_USER:=llamastack} - password: ${env.POSTGRES_PASSWORD:=llamastack} - responses_store: - type: postgres - host: ${env.POSTGRES_HOST:=localhost} - port: ${env.POSTGRES_PORT:=5432} - db: ${env.POSTGRES_DB:=llamastack} - user: ${env.POSTGRES_USER:=llamastack} - password: ${env.POSTGRES_PASSWORD:=llamastack} + host: ${env.POSTGRES_HOST:localhost} + port: ${env.POSTGRES_PORT:5432} + db: ${env.POSTGRES_DB:llamastack} + user: ${env.POSTGRES_USER:llamastack} + password: ${env.POSTGRES_PASSWORD:llamastack} + responses_store: *id001 telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -81,11 +75,11 @@ metadata_store: table_name: ${env.POSTGRES_TABLE_NAME:=llamastack_kvstore} inference_store: type: postgres - host: ${env.POSTGRES_HOST:=localhost} - port: ${env.POSTGRES_PORT:=5432} - db: ${env.POSTGRES_DB:=llamastack} - user: ${env.POSTGRES_USER:=llamastack} - password: ${env.POSTGRES_PASSWORD:=llamastack} + host: ${env.POSTGRES_HOST:localhost} + port: ${env.POSTGRES_PORT:5432} + db: ${env.POSTGRES_DB:llamastack} + user: ${env.POSTGRES_USER:llamastack} + password: ${env.POSTGRES_PASSWORD:llamastack} models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/remote-vllm/run-with-safety.yaml b/llama_stack/templates/remote-vllm/run-with-safety.yaml index b297f1489..100ffc5a4 100644 --- a/llama_stack/templates/remote-vllm/run-with-safety.yaml +++ b/llama_stack/templates/remote-vllm/run-with-safety.yaml @@ -52,7 +52,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/responses_store.db eval: - provider_id: meta-reference provider_type: inline::meta-reference @@ -120,7 +120,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/remote-vllm/run.yaml b/llama_stack/templates/remote-vllm/run.yaml index 6bd332cc9..110b97a5e 100644 --- a/llama_stack/templates/remote-vllm/run.yaml +++ b/llama_stack/templates/remote-vllm/run.yaml @@ -45,7 +45,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/responses_store.db eval: - provider_id: meta-reference provider_type: inline::meta-reference @@ -113,7 +113,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/sambanova/run.yaml b/llama_stack/templates/sambanova/run.yaml index b96621b58..7334defec 100644 --- a/llama_stack/templates/sambanova/run.yaml +++ b/llama_stack/templates/sambanova/run.yaml @@ -53,7 +53,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/sambanova}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/sambanova}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/sambanova}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -87,7 +87,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/sambanova}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/sambanova}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/sambanova}/inference_store.db models: - metadata: {} model_id: sambanova/Meta-Llama-3.1-8B-Instruct diff --git a/llama_stack/templates/tgi/run-with-safety.yaml b/llama_stack/templates/tgi/run-with-safety.yaml index 63da62a03..e20959bb1 100644 --- a/llama_stack/templates/tgi/run-with-safety.yaml +++ b/llama_stack/templates/tgi/run-with-safety.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -107,7 +107,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/tgi/run.yaml b/llama_stack/templates/tgi/run.yaml index 430494121..ded796bca 100644 --- a/llama_stack/templates/tgi/run.yaml +++ b/llama_stack/templates/tgi/run.yaml @@ -42,7 +42,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -106,7 +106,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/tgi}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/tgi}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/together/run-with-safety.yaml b/llama_stack/templates/together/run-with-safety.yaml index 7ae2a1d1a..9e070a89e 100644 --- a/llama_stack/templates/together/run-with-safety.yaml +++ b/llama_stack/templates/together/run-with-safety.yaml @@ -48,7 +48,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -116,7 +116,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/inference_store.db models: - metadata: {} model_id: meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo diff --git a/llama_stack/templates/together/run.yaml b/llama_stack/templates/together/run.yaml index dc09aeac9..7b6456d98 100644 --- a/llama_stack/templates/together/run.yaml +++ b/llama_stack/templates/together/run.yaml @@ -43,7 +43,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -111,7 +111,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/together}/inference_store.db models: - metadata: {} model_id: meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo diff --git a/llama_stack/templates/vllm-gpu/run.yaml b/llama_stack/templates/vllm-gpu/run.yaml index 104b3a239..caf293abc 100644 --- a/llama_stack/templates/vllm-gpu/run.yaml +++ b/llama_stack/templates/vllm-gpu/run.yaml @@ -47,7 +47,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/vllm-gpu}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/vllm-gpu}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/vllm-gpu}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -111,7 +111,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/vllm-gpu}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/vllm-gpu}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/vllm-gpu}/inference_store.db models: - metadata: {} model_id: ${env.INFERENCE_MODEL} diff --git a/llama_stack/templates/watsonx/run.yaml b/llama_stack/templates/watsonx/run.yaml index 678bf72ff..ebad1fd13 100644 --- a/llama_stack/templates/watsonx/run.yaml +++ b/llama_stack/templates/watsonx/run.yaml @@ -44,7 +44,7 @@ providers: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/agents_store.db responses_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/responses_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/watsonx}/responses_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference @@ -108,7 +108,7 @@ metadata_store: db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/registry.db inference_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/inference_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/watsonx}/inference_store.db models: - metadata: {} model_id: meta-llama/llama-3-3-70b-instruct diff --git a/tests/unit/server/test_replace_env_vars.py b/tests/unit/server/test_replace_env_vars.py index 0fb7c395e..474c5cbfa 100644 --- a/tests/unit/server/test_replace_env_vars.py +++ b/tests/unit/server/test_replace_env_vars.py @@ -7,7 +7,7 @@ import os import unittest -from llama_stack.distribution.stack import replace_env_vars +from llama_stack.distribution.utils.env import replace_env_vars class TestReplaceEnvVars(unittest.TestCase):