Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions distribution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
38 changes: 36 additions & 2 deletions scripts/gen_distro_docs.py
Original file line number Diff line number Diff line change
@@ -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 |", "|-----|----------|"]
Expand Down Expand Up @@ -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 = """<!-- This file is automatically generated by scripts/gen_distro_doc.py - do not update manually -->
header = f"""<!-- This file is automatically generated by scripts/gen_distro_doc.py - do not update manually -->

# 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.

"""
Expand Down
Loading