diff --git a/distributions/dependencies.json b/distributions/dependencies.json index 4e66a85da..a2393cdea 100644 --- a/distributions/dependencies.json +++ b/distributions/dependencies.json @@ -16,6 +16,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -45,6 +47,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -75,6 +79,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -103,6 +109,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -133,6 +141,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -164,6 +174,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -194,6 +206,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -226,6 +240,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -262,6 +278,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -292,6 +310,8 @@ "matplotlib", "nltk", "numpy", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -323,6 +343,8 @@ "numpy", "ollama", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", @@ -354,6 +376,8 @@ "nltk", "numpy", "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", "pandas", "pillow", "psycopg2-binary", diff --git a/llama_stack/__init__.py b/llama_stack/__init__.py index 756f351d8..34b866692 100644 --- a/llama_stack/__init__.py +++ b/llama_stack/__init__.py @@ -3,3 +3,5 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +# +# from .distribution.library_client import LlamaStackAsLibraryClient, AsyncLlamaStackAsLibraryClient diff --git a/llama_stack/cli/stack/build.py b/llama_stack/cli/stack/build.py index 00d62bd73..f19c6e798 100644 --- a/llama_stack/cli/stack/build.py +++ b/llama_stack/cli/stack/build.py @@ -73,7 +73,7 @@ class StackBuild(Subcommand): "--image-type", type=str, help="Image Type to use for the build. This can be either conda or docker. If not specified, will use the image type from the template config.", - choices=["conda", "docker"], + choices=["conda", "docker", "venv"], default="conda", ) @@ -124,8 +124,8 @@ class StackBuild(Subcommand): image_type = prompt( "> Enter the image type you want your Llama Stack to be built as (docker or conda): ", validator=Validator.from_callable( - lambda x: x in ["docker", "conda"], - error_message="Invalid image type, please enter conda or docker", + lambda x: x in ["docker", "conda", "venv"], + error_message="Invalid image type, please enter conda or docker or venv", ), default="conda", ) diff --git a/llama_stack/distribution/build.py b/llama_stack/distribution/build.py index 3349a7d50..bdda0349f 100644 --- a/llama_stack/distribution/build.py +++ b/llama_stack/distribution/build.py @@ -38,6 +38,7 @@ SERVER_DEPENDENCIES = [ class ImageType(Enum): docker = "docker" conda = "conda" + venv = "venv" class ApiInput(BaseModel): @@ -120,7 +121,7 @@ def build_image(build_config: BuildConfig, build_file_path: Path): str(BUILDS_BASE_DIR / ImageType.docker.value), " ".join(normal_deps), ] - else: + elif build_config.image_type == ImageType.conda.value: script = pkg_resources.resource_filename( "llama_stack", "distribution/build_conda_env.sh" ) @@ -130,6 +131,16 @@ def build_image(build_config: BuildConfig, build_file_path: Path): str(build_file_path), " ".join(normal_deps), ] + elif build_config.image_type == ImageType.venv.value: + script = pkg_resources.resource_filename( + "llama_stack", "distribution/build_venv.sh" + ) + args = [ + script, + build_config.name, + str(build_file_path), + " ".join(normal_deps), + ] if special_deps: args.append("#".join(special_deps)) diff --git a/llama_stack/distribution/build_venv.sh b/llama_stack/distribution/build_venv.sh new file mode 100755 index 000000000..8136e3120 --- /dev/null +++ b/llama_stack/distribution/build_venv.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +# 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. + +# TODO: combine this with build_conda_env.sh since it is almost identical +# the only difference is that we don't do any conda-specific setup + +LLAMA_MODELS_DIR=${LLAMA_MODELS_DIR:-} +LLAMA_STACK_DIR=${LLAMA_STACK_DIR:-} +TEST_PYPI_VERSION=${TEST_PYPI_VERSION:-} + +if [ -n "$LLAMA_STACK_DIR" ]; then + echo "Using llama-stack-dir=$LLAMA_STACK_DIR" +fi +if [ -n "$LLAMA_MODELS_DIR" ]; then + echo "Using llama-models-dir=$LLAMA_MODELS_DIR" +fi + +if [ "$#" -lt 3 ]; then + echo "Usage: $0 []" >&2 + echo "Example: $0 mybuild ./my-stack-build.yaml 'numpy pandas scipy'" >&2 + exit 1 +fi + +special_pip_deps="$4" + +set -euo pipefail + +build_name="$1" +env_name="llamastack-$build_name" +build_file_path="$2" +pip_dependencies="$3" + +# Define color codes +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +# this is set if we actually create a new conda in which case we need to clean up +ENVNAME="" + +SCRIPT_DIR=$(dirname "$(readlink -f "$0")") +source "$SCRIPT_DIR/common.sh" + +run() { + local env_name="$1" + local pip_dependencies="$2" + local special_pip_deps="$3" + + if [ -n "$TEST_PYPI_VERSION" ]; then + # these packages are damaged in test-pypi, so install them first + pip install fastapi libcst + pip install --extra-index-url https://test.pypi.org/simple/ \ + llama-models==$TEST_PYPI_VERSION llama-stack==$TEST_PYPI_VERSION \ + $pip_dependencies + if [ -n "$special_pip_deps" ]; then + IFS='#' read -ra parts <<<"$special_pip_deps" + for part in "${parts[@]}"; do + echo "$part" + pip install $part + done + fi + else + # Re-installing llama-stack in the new conda environment + if [ -n "$LLAMA_STACK_DIR" ]; then + if [ ! -d "$LLAMA_STACK_DIR" ]; then + printf "${RED}Warning: LLAMA_STACK_DIR is set but directory does not exist: $LLAMA_STACK_DIR${NC}\n" >&2 + exit 1 + fi + + printf "Installing from LLAMA_STACK_DIR: $LLAMA_STACK_DIR\n" + pip install --no-cache-dir -e "$LLAMA_STACK_DIR" + else + pip install --no-cache-dir llama-stack + fi + + if [ -n "$LLAMA_MODELS_DIR" ]; then + if [ ! -d "$LLAMA_MODELS_DIR" ]; then + printf "${RED}Warning: LLAMA_MODELS_DIR is set but directory does not exist: $LLAMA_MODELS_DIR${NC}\n" >&2 + exit 1 + fi + + printf "Installing from LLAMA_MODELS_DIR: $LLAMA_MODELS_DIR\n" + pip uninstall -y llama-models + pip install --no-cache-dir -e "$LLAMA_MODELS_DIR" + fi + + # Install pip dependencies + printf "Installing pip dependencies\n" + pip install $pip_dependencies + if [ -n "$special_pip_deps" ]; then + IFS='#' read -ra parts <<<"$special_pip_deps" + for part in "${parts[@]}"; do + echo "$part" + pip install $part + done + fi + fi +} + +run "$env_name" "$pip_dependencies" "$special_pip_deps" diff --git a/llama_stack/distribution/datatypes.py b/llama_stack/distribution/datatypes.py index c2bff4eed..1159372d4 100644 --- a/llama_stack/distribution/datatypes.py +++ b/llama_stack/distribution/datatypes.py @@ -165,5 +165,5 @@ class BuildConfig(BaseModel): ) image_type: str = Field( default="conda", - description="Type of package to build (conda | container)", + description="Type of package to build (conda | docker | venv)", ) diff --git a/llama_stack/distribution/library_client.py b/llama_stack/distribution/library_client.py index 4de06ae08..64cd343d4 100644 --- a/llama_stack/distribution/library_client.py +++ b/llama_stack/distribution/library_client.py @@ -6,6 +6,7 @@ import asyncio import inspect +import os import queue import threading from concurrent.futures import ThreadPoolExecutor @@ -32,6 +33,18 @@ from llama_stack.distribution.stack import ( T = TypeVar("T") +def is_jupyter(): + """Check if we're running in a Jupyter notebook""" + try: + shell = get_ipython().__class__.__name__ # type: ignore + if shell == "ZMQInteractiveShell": # Jupyter notebook or qtconsole + return True + else: + return False + except NameError: # Probably standard Python interpreter + return False + + def stream_across_asyncio_run_boundary( async_gen_maker, pool_executor: ThreadPoolExecutor, @@ -102,7 +115,12 @@ class LlamaStackAsLibraryClient(LlamaStackClient): self.pool_executor = ThreadPoolExecutor(max_workers=4) def initialize(self): - asyncio.run(self.async_client.initialize()) + if is_jupyter(): + import nest_asyncio + + nest_asyncio.apply() + + return asyncio.run(self.async_client.initialize()) def get(self, *args, **kwargs): if kwargs.get("stream"): @@ -131,6 +149,10 @@ class AsyncLlamaStackAsLibraryClient(AsyncLlamaStackClient): ): super().__init__() + # when using the library client, we should not log to console since many + # of our logs are intended for server-side usage + os.environ["TELEMETRY_SINKS"] = "sqlite" + if config_path_or_template_name.endswith(".yaml"): config_path = Path(config_path_or_template_name) if not config_path.exists(): @@ -150,13 +172,19 @@ class AsyncLlamaStackAsLibraryClient(AsyncLlamaStackClient): self.impls = await construct_stack( self.config, self.custom_provider_registry ) - except ModuleNotFoundError as e: + except ModuleNotFoundError as _e: cprint( "Using llama-stack as a library requires installing dependencies depending on the template (providers) you choose.\n", "yellow", ) - print_pip_install_help(self.config.providers) - raise e + if self.config_path_or_template_name.endswith(".yaml"): + print_pip_install_help(self.config.providers) + else: + cprint( + f"Please run:\n\nllama stack build --template {self.config_path_or_template_name} --image-type venv\n\n", + "yellow", + ) + return False console = Console() console.print(f"Using config [blue]{self.config_path_or_template_name}[/blue]:") @@ -171,6 +199,7 @@ class AsyncLlamaStackAsLibraryClient(AsyncLlamaStackClient): endpoint_impls[endpoint.route] = func self.endpoint_impls = endpoint_impls + return True async def get( self, diff --git a/llama_stack/distribution/tests/library_client_test.py b/llama_stack/distribution/tests/library_client_test.py index 8381f5470..5e7b997f3 100644 --- a/llama_stack/distribution/tests/library_client_test.py +++ b/llama_stack/distribution/tests/library_client_test.py @@ -17,7 +17,8 @@ from llama_stack_client.types.agent_create_params import AgentConfig def main(config_path: str): client = LlamaStackAsLibraryClient(config_path) - client.initialize() + if not client.initialize(): + return models = client.models.list() print("\nModels:") diff --git a/llama_stack/providers/inline/telemetry/meta_reference/__init__.py b/llama_stack/providers/inline/telemetry/meta_reference/__init__.py index 38871a7e4..2905e2f6a 100644 --- a/llama_stack/providers/inline/telemetry/meta_reference/__init__.py +++ b/llama_stack/providers/inline/telemetry/meta_reference/__init__.py @@ -7,12 +7,13 @@ from typing import Any, Dict from .config import TelemetryConfig, TelemetrySink -from .telemetry import TelemetryAdapter -__all__ = ["TelemetryConfig", "TelemetryAdapter", "TelemetrySink"] +__all__ = ["TelemetryConfig", "TelemetrySink"] async def get_provider_impl(config: TelemetryConfig, deps: Dict[str, Any]): + from .telemetry import TelemetryAdapter + impl = TelemetryAdapter(config, deps) await impl.initialize() return impl diff --git a/llama_stack/providers/inline/telemetry/meta_reference/config.py b/llama_stack/providers/inline/telemetry/meta_reference/config.py index 4aaa368d1..41d62c268 100644 --- a/llama_stack/providers/inline/telemetry/meta_reference/config.py +++ b/llama_stack/providers/inline/telemetry/meta_reference/config.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, List -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, field_validator from llama_stack.distribution.utils.config_dirs import RUNTIME_BASE_DIR @@ -36,10 +36,23 @@ class TelemetryConfig(BaseModel): description="The path to the SQLite database to use for storing traces", ) + @field_validator("sinks", mode="before") @classmethod - def sample_run_config(cls, **kwargs) -> Dict[str, Any]: + def validate_sinks(cls, v): + if isinstance(v, str): + return [TelemetrySink(sink.strip()) for sink in v.split(",")] + return v + + @classmethod + def sample_run_config( + cls, __distro_dir__: str = "runtime", db_name: str = "trace_store.db" + ) -> Dict[str, Any]: return { "service_name": "${env.OTEL_SERVICE_NAME:llama-stack}", - "sinks": "${env.TELEMETRY_SINKS:['console', 'sqlite']}", - "sqlite_db_path": "${env.SQLITE_DB_PATH:${runtime.base_dir}/trace_store.db}", + "sinks": "${env.TELEMETRY_SINKS:console,sqlite}", + "sqlite_db_path": "${env.SQLITE_DB_PATH:~/.llama/" + + __distro_dir__ + + "/" + + db_name + + "}", } diff --git a/llama_stack/templates/bedrock/run.yaml b/llama_stack/templates/bedrock/run.yaml index 77d4f2248..db0ee9d85 100644 --- a/llama_stack/templates/bedrock/run.yaml +++ b/llama_stack/templates/bedrock/run.yaml @@ -39,7 +39,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/bedrock/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/cerebras/run.yaml b/llama_stack/templates/cerebras/run.yaml index 0b41f5b76..451e2b076 100644 --- a/llama_stack/templates/cerebras/run.yaml +++ b/llama_stack/templates/cerebras/run.yaml @@ -38,7 +38,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/cerebras/trace_store.db} metadata_store: namespace: null type: sqlite diff --git a/llama_stack/templates/fireworks/run.yaml b/llama_stack/templates/fireworks/run.yaml index 9296be28f..c75db478d 100644 --- a/llama_stack/templates/fireworks/run.yaml +++ b/llama_stack/templates/fireworks/run.yaml @@ -41,7 +41,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/fireworks/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/hf-endpoint/run-with-safety.yaml b/llama_stack/templates/hf-endpoint/run-with-safety.yaml index bd625ffc5..678857201 100644 --- a/llama_stack/templates/hf-endpoint/run-with-safety.yaml +++ b/llama_stack/templates/hf-endpoint/run-with-safety.yaml @@ -46,7 +46,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/hf-endpoint/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/hf-endpoint/run.yaml b/llama_stack/templates/hf-endpoint/run.yaml index bf0697bba..c062c6c98 100644 --- a/llama_stack/templates/hf-endpoint/run.yaml +++ b/llama_stack/templates/hf-endpoint/run.yaml @@ -41,7 +41,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/hf-endpoint/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/hf-serverless/run-with-safety.yaml b/llama_stack/templates/hf-serverless/run-with-safety.yaml index f5ead14d4..4a14ba093 100644 --- a/llama_stack/templates/hf-serverless/run-with-safety.yaml +++ b/llama_stack/templates/hf-serverless/run-with-safety.yaml @@ -46,7 +46,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/hf-serverless/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/hf-serverless/run.yaml b/llama_stack/templates/hf-serverless/run.yaml index 13e2d7789..268efddc4 100644 --- a/llama_stack/templates/hf-serverless/run.yaml +++ b/llama_stack/templates/hf-serverless/run.yaml @@ -41,7 +41,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/hf-serverless/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference 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 d0fa05e96..963679665 100644 --- a/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml +++ b/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml @@ -48,7 +48,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/meta-reference-gpu/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/meta-reference-gpu/run.yaml b/llama_stack/templates/meta-reference-gpu/run.yaml index 3675f4a58..a74cde768 100644 --- a/llama_stack/templates/meta-reference-gpu/run.yaml +++ b/llama_stack/templates/meta-reference-gpu/run.yaml @@ -42,7 +42,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/meta-reference-gpu/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/meta-reference-quantized-gpu/run.yaml b/llama_stack/templates/meta-reference-quantized-gpu/run.yaml index 081af0f59..5aada0fe6 100644 --- a/llama_stack/templates/meta-reference-quantized-gpu/run.yaml +++ b/llama_stack/templates/meta-reference-quantized-gpu/run.yaml @@ -44,7 +44,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/meta-reference-quantized-gpu/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/ollama/run-with-safety.yaml b/llama_stack/templates/ollama/run-with-safety.yaml index dc282f996..2ab0f78f0 100644 --- a/llama_stack/templates/ollama/run-with-safety.yaml +++ b/llama_stack/templates/ollama/run-with-safety.yaml @@ -40,7 +40,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/ollama/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/ollama/run.yaml b/llama_stack/templates/ollama/run.yaml index ab8e12839..c5206c2d0 100644 --- a/llama_stack/templates/ollama/run.yaml +++ b/llama_stack/templates/ollama/run.yaml @@ -40,7 +40,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/ollama/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/remote-vllm/run-with-safety.yaml b/llama_stack/templates/remote-vllm/run-with-safety.yaml index c0849e2d0..ac8cf6f4a 100644 --- a/llama_stack/templates/remote-vllm/run-with-safety.yaml +++ b/llama_stack/templates/remote-vllm/run-with-safety.yaml @@ -45,7 +45,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/remote-vllm/trace_store.db} metadata_store: namespace: null type: sqlite diff --git a/llama_stack/templates/remote-vllm/run.yaml b/llama_stack/templates/remote-vllm/run.yaml index 3457afdd6..27c5df53c 100644 --- a/llama_stack/templates/remote-vllm/run.yaml +++ b/llama_stack/templates/remote-vllm/run.yaml @@ -39,7 +39,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/remote-vllm/trace_store.db} metadata_store: namespace: null type: sqlite diff --git a/llama_stack/templates/tgi/run-with-safety.yaml b/llama_stack/templates/tgi/run-with-safety.yaml index 2ee82ddc3..ecd03c36a 100644 --- a/llama_stack/templates/tgi/run-with-safety.yaml +++ b/llama_stack/templates/tgi/run-with-safety.yaml @@ -44,7 +44,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/tgi/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/tgi/run.yaml b/llama_stack/templates/tgi/run.yaml index c45e114ee..b93f09042 100644 --- a/llama_stack/templates/tgi/run.yaml +++ b/llama_stack/templates/tgi/run.yaml @@ -40,7 +40,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/tgi/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/together/run.yaml b/llama_stack/templates/together/run.yaml index a9f96a099..381557816 100644 --- a/llama_stack/templates/together/run.yaml +++ b/llama_stack/templates/together/run.yaml @@ -41,7 +41,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/together/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference diff --git a/llama_stack/templates/vllm-gpu/run.yaml b/llama_stack/templates/vllm-gpu/run.yaml index ea188777f..1442273f4 100644 --- a/llama_stack/templates/vllm-gpu/run.yaml +++ b/llama_stack/templates/vllm-gpu/run.yaml @@ -44,7 +44,10 @@ providers: telemetry: - provider_id: meta-reference provider_type: inline::meta-reference - config: {} + config: + service_name: ${env.OTEL_SERVICE_NAME:llama-stack} + sinks: ${env.TELEMETRY_SINKS:console,sqlite} + sqlite_db_path: ${env.SQLITE_DB_PATH:~/.llama/distributions/vllm-gpu/trace_store.db} eval: - provider_id: meta-reference provider_type: inline::meta-reference