diff --git a/distribution/README.md b/distribution/README.md index 4a599a2c3..38e3950c6 100644 --- a/distribution/README.md +++ b/distribution/README.md @@ -4,6 +4,8 @@ This image contains the official Open Data Hub Llama Stack distribution, with all the packages and configuration needed to run a Llama Stack server in a containerized environment. +The image is currently shipping with upstream Llama Stack version [0.2.22](https://github.com/llamastack/llama-stack/releases/tag/v0.2.22) + You can see an overview of the APIs and Providers the image ships with in the table below. | API | Provider | diff --git a/scripts/gen_distro_docs.py b/scripts/gen_distro_docs.py index 25af4ae10..9d8e87c3e 100755 --- a/scripts/gen_distro_docs.py +++ b/scripts/gen_distro_docs.py @@ -1,12 +1,41 @@ #!/usr/bin/env python3 import yaml +import re from pathlib import Path REPO_ROOT = Path(__file__).parent.parent +def extract_llama_stack_version(): + """Extract Llama Stack version from the Containerfile.""" + containerfile_path = REPO_ROOT / "distribution" / "Containerfile" + + if not containerfile_path.exists(): + print(f"Error: {containerfile_path} not found") + exit(1) + + try: + with open(containerfile_path, "r") as file: + content = file.read() + + # Look for llama-stack version in pip install commands + # Pattern matches: llama-stack==X.Y.Z + pattern = r"llama-stack==([0-9]+\.[0-9]+\.[0-9]+)" + match = re.search(pattern, content) + + if match: + return match.group(1) + else: + print("Error: Could not find llama-stack version in Containerfile") + exit(1) + + except Exception as e: + print(f"Error reading Containerfile: {e}") + exit(1) + + def gen_distro_table(providers_data): # Start with table header table_lines = ["| API | Provider |", "|-----|----------|"] @@ -37,18 +66,23 @@ def gen_distro_docs(): run_yaml_path = REPO_ROOT / "distribution" / "run.yaml" readme_path = REPO_ROOT / "distribution" / "README.md" - # Check if run.yaml exists + # check if run.yaml exists if not run_yaml_path.exists(): print(f"Error: {run_yaml_path} not found") return 1 + # extract Llama Stack version from Containerfile + version = extract_llama_stack_version() + # header section - header = """ + header = f""" # Open Data Hub Llama Stack Distribution Image This image contains the official Open Data Hub Llama Stack distribution, with all the packages and configuration needed to run a Llama Stack server in a containerized environment. +The image is currently shipping with upstream Llama Stack version [{version}](https://github.com/llamastack/llama-stack/releases/tag/v{version}) + You can see an overview of the APIs and Providers the image ships with in the table below. """