From 1a6d4af5e9217a253607d263be4186167d40d215 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 15 May 2025 12:52:34 -0700 Subject: [PATCH] refactor: rename dev distro as starter (#2181) We want this to be a "flagship" distribution we can advertize to a segment of users to get started quickly. This distro should package a bunch of remote providers and some cheap inline providers so they get a solid "AI Platform in a box" setup instantly. --- llama_stack/templates/dependencies.json | 80 +++++++++---------- .../templates/{dev => starter}/__init__.py | 2 +- .../templates/{dev => starter}/build.yaml | 2 +- .../templates/{dev => starter}/run.yaml | 16 ++-- .../{dev/dev.py => starter/starter.py} | 7 +- pyproject.toml | 1 - 6 files changed, 54 insertions(+), 54 deletions(-) rename llama_stack/templates/{dev => starter}/__init__.py (76%) rename llama_stack/templates/{dev => starter}/build.yaml (89%) rename llama_stack/templates/{dev => starter}/run.yaml (96%) rename llama_stack/templates/{dev/dev.py => starter/starter.py} (95%) diff --git a/llama_stack/templates/dependencies.json b/llama_stack/templates/dependencies.json index 35cbc8878..d1a17e48e 100644 --- a/llama_stack/templates/dependencies.json +++ b/llama_stack/templates/dependencies.json @@ -152,46 +152,6 @@ "sentence-transformers --no-deps", "torch torchvision --index-url https://download.pytorch.org/whl/cpu" ], - "dev": [ - "aiosqlite", - "autoevals", - "blobfile", - "chardet", - "chromadb-client", - "datasets", - "emoji", - "fastapi", - "fire", - "fireworks-ai", - "httpx", - "langdetect", - "litellm", - "matplotlib", - "mcp", - "nltk", - "numpy", - "openai", - "opentelemetry-exporter-otlp-proto-http", - "opentelemetry-sdk", - "pandas", - "pillow", - "psycopg2-binary", - "pymongo", - "pypdf", - "pythainlp", - "redis", - "requests", - "scikit-learn", - "scipy", - "sentencepiece", - "sqlite-vec", - "tqdm", - "transformers", - "tree_sitter", - "uvicorn", - "sentence-transformers --no-deps", - "torch torchvision --index-url https://download.pytorch.org/whl/cpu" - ], "fireworks": [ "aiosqlite", "autoevals", @@ -642,6 +602,46 @@ "sentence-transformers --no-deps", "torch torchvision --index-url https://download.pytorch.org/whl/cpu" ], + "starter": [ + "aiosqlite", + "autoevals", + "blobfile", + "chardet", + "chromadb-client", + "datasets", + "emoji", + "fastapi", + "fire", + "fireworks-ai", + "httpx", + "langdetect", + "litellm", + "matplotlib", + "mcp", + "nltk", + "numpy", + "openai", + "opentelemetry-exporter-otlp-proto-http", + "opentelemetry-sdk", + "pandas", + "pillow", + "psycopg2-binary", + "pymongo", + "pypdf", + "pythainlp", + "redis", + "requests", + "scikit-learn", + "scipy", + "sentencepiece", + "sqlite-vec", + "tqdm", + "transformers", + "tree_sitter", + "uvicorn", + "sentence-transformers --no-deps", + "torch torchvision --index-url https://download.pytorch.org/whl/cpu" + ], "tgi": [ "aiohttp", "aiosqlite", diff --git a/llama_stack/templates/dev/__init__.py b/llama_stack/templates/starter/__init__.py similarity index 76% rename from llama_stack/templates/dev/__init__.py rename to llama_stack/templates/starter/__init__.py index cf966c2a6..9c0d937ce 100644 --- a/llama_stack/templates/dev/__init__.py +++ b/llama_stack/templates/starter/__init__.py @@ -4,4 +4,4 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .dev import get_distribution_template # noqa: F401 +from .starter import get_distribution_template # noqa: F401 diff --git a/llama_stack/templates/dev/build.yaml b/llama_stack/templates/starter/build.yaml similarity index 89% rename from llama_stack/templates/dev/build.yaml rename to llama_stack/templates/starter/build.yaml index afa1614bf..35bd0c713 100644 --- a/llama_stack/templates/dev/build.yaml +++ b/llama_stack/templates/starter/build.yaml @@ -1,6 +1,6 @@ version: '2' distribution_spec: - description: Distribution for running e2e tests in CI + description: Quick start template for running Llama Stack with several popular providers providers: inference: - remote::openai diff --git a/llama_stack/templates/dev/run.yaml b/llama_stack/templates/starter/run.yaml similarity index 96% rename from llama_stack/templates/dev/run.yaml rename to llama_stack/templates/starter/run.yaml index a3b51e7bf..52d7a6a07 100644 --- a/llama_stack/templates/dev/run.yaml +++ b/llama_stack/templates/starter/run.yaml @@ -1,5 +1,5 @@ version: '2' -image_name: dev +image_name: starter apis: - agents - datasetio @@ -46,7 +46,7 @@ providers: - provider_id: sqlite-vec provider_type: inline::sqlite-vec config: - db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/sqlite_vec.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/starter}/sqlite_vec.db - provider_id: ${env.ENABLE_CHROMADB+chromadb} provider_type: remote::chromadb config: @@ -71,14 +71,14 @@ providers: persistence_store: type: sqlite namespace: null - db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/agents_store.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/starter}/agents_store.db telemetry: - provider_id: meta-reference provider_type: inline::meta-reference config: service_name: ${env.OTEL_SERVICE_NAME:} sinks: ${env.TELEMETRY_SINKS:console,sqlite} - sqlite_db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/trace_store.db + sqlite_db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/starter}/trace_store.db eval: - provider_id: meta-reference provider_type: inline::meta-reference @@ -86,7 +86,7 @@ providers: kvstore: type: sqlite namespace: null - db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/meta_reference_eval.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/starter}/meta_reference_eval.db datasetio: - provider_id: huggingface provider_type: remote::huggingface @@ -94,14 +94,14 @@ providers: kvstore: type: sqlite namespace: null - db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/huggingface_datasetio.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/starter}/huggingface_datasetio.db - provider_id: localfs provider_type: inline::localfs config: kvstore: type: sqlite namespace: null - db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/localfs_datasetio.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/starter}/localfs_datasetio.db scoring: - provider_id: basic provider_type: inline::basic @@ -132,7 +132,7 @@ providers: config: {} metadata_store: type: sqlite - db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/dev}/registry.db + db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/starter}/registry.db models: - metadata: {} model_id: openai/gpt-4o diff --git a/llama_stack/templates/dev/dev.py b/llama_stack/templates/starter/starter.py similarity index 95% rename from llama_stack/templates/dev/dev.py rename to llama_stack/templates/starter/starter.py index 76d5a1fb3..0932bfdfe 100644 --- a/llama_stack/templates/dev/dev.py +++ b/llama_stack/templates/starter/starter.py @@ -46,6 +46,7 @@ from llama_stack.providers.remote.vector_io.chroma.config import ChromaVectorIOC from llama_stack.providers.remote.vector_io.pgvector.config import ( PGVectorVectorIOConfig, ) +from llama_stack.providers.utils.inference.model_registry import ProviderModelEntry from llama_stack.templates.template import ( DistributionTemplate, RunConfigSettings, @@ -53,7 +54,7 @@ from llama_stack.templates.template import ( ) -def get_inference_providers() -> tuple[list[Provider], list[ModelInput]]: +def get_inference_providers() -> tuple[list[Provider], dict[str, list[ProviderModelEntry]]]: # in this template, we allow each API key to be optional providers = [ ( @@ -119,7 +120,7 @@ def get_distribution_template() -> DistributionTemplate: "remote::model-context-protocol", ], } - name = "dev" + name = "starter" vector_io_providers = [ Provider( @@ -171,7 +172,7 @@ def get_distribution_template() -> DistributionTemplate: return DistributionTemplate( name=name, distro_type="self_hosted", - description="Distribution for running e2e tests in CI", + description="Quick start template for running Llama Stack with several popular providers", container_image=None, template_path=None, providers=providers, diff --git a/pyproject.toml b/pyproject.toml index f1bf7384f..88c331b78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -304,7 +304,6 @@ exclude = [ "^llama_stack/strong_typing/inspection\\.py$", "^llama_stack/strong_typing/schema\\.py$", "^llama_stack/strong_typing/serializer\\.py$", - "^llama_stack/templates/dev/dev\\.py$", "^llama_stack/templates/groq/groq\\.py$", "^llama_stack/templates/llama_api/llama_api\\.py$", "^llama_stack/templates/sambanova/sambanova\\.py$",