Skip to content

Commit f634950

Browse files
committed
feat: bump llama-stack to 0.3.0rc2+rhai0
https://github.com/opendatahub-io/llama-stack/releases/tag/v0.3.0rc2%2Brhai0 Relates to: RHAIENG-1685 Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
1 parent eef1dce commit f634950

7 files changed

Lines changed: 55 additions & 23 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repos:
5656
always_run: true
5757
files: ^distribution/.*$
5858
additional_dependencies:
59-
- llama-stack==0.2.23
59+
- git+https://github.com/opendatahub-io/llama-stack.git@v0.3.0rc2+rhai0
6060

6161
- id: doc-gen
6262
name: Distribution Documentation

distribution/Containerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ RUN pip install \
2020
autoevals \
2121
boto3 \
2222
chardet \
23+
einops \
2324
faiss-cpu \
2425
fastapi \
2526
fire \
2627
google-cloud-aiplatform \
2728
httpx \
28-
ibm_watsonx_ai \
2929
litellm \
3030
matplotlib \
3131
nltk \
@@ -39,10 +39,12 @@ RUN pip install \
3939
pypdf \
4040
redis \
4141
requests \
42+
safetensors \
4243
scikit-learn \
4344
scipy \
4445
sentencepiece \
4546
sqlalchemy[asyncio] \
47+
tokenizers \
4648
tqdm \
4749
transformers \
4850
uvicorn
@@ -56,7 +58,7 @@ RUN pip install \
5658
llama_stack_provider_trustyai_fms==0.2.3
5759
RUN pip install 'torchao>=0.12.0' --extra-index-url https://download.pytorch.org/whl/cpu torch torchvision
5860
RUN pip install --no-deps sentence-transformers
59-
RUN pip install --no-cache llama-stack==0.2.23
61+
RUN pip install --no-cache --no-deps git+https://github.com/opendatahub-io/llama-stack.git@v0.3.0rc2+rhai0
6062
RUN mkdir -p ${HOME}/.llama ${HOME}/.cache
6163
COPY distribution/run.yaml ${APP_ROOT}/run.yaml
6264
ENTRYPOINT ["llama", "stack", "run", "/opt/app-root/run.yaml"]

distribution/Containerfile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ WORKDIR /opt/app-root
33

44
RUN pip install sqlalchemy # somehow sqlalchemy[asyncio] is not sufficient
55
{dependencies}
6-
RUN pip install --no-cache llama-stack==0.2.23
76
{llama_stack_install_source}
87
RUN mkdir -p ${{HOME}}/.llama ${{HOME}}/.cache
98
COPY distribution/run.yaml ${{APP_ROOT}}/run.yaml

distribution/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
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.
66

7-
The image is currently shipping with upstream Llama Stack version [0.2.23](https://github.com/llamastack/llama-stack/releases/tag/v0.2.23)
7+
The image is currently shipping with upstream Llama Stack version [0.3.0rc2+rhai0](https://github.com/opendatahub-io/llama-stack/releases/tag/v0.3.0rc2+rhai0)
88

99
You can see an overview of the APIs and Providers the image ships with in the table below.
1010

distribution/build.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import os
1414
from pathlib import Path
1515

16-
CURRENT_LLAMA_STACK_VERSION = "0.2.23"
16+
CURRENT_LLAMA_STACK_VERSION = "0.3.0rc2+rhai0"
1717
LLAMA_STACK_VERSION = os.getenv("LLAMA_STACK_VERSION", CURRENT_LLAMA_STACK_VERSION)
1818
BASE_REQUIREMENTS = [
1919
f"llama-stack=={LLAMA_STACK_VERSION}",
@@ -36,19 +36,30 @@
3636
git checkout {llama_stack_version} && \\
3737
pip install --no-cache -e ."""
3838

39+
rhai_install_command = """RUN pip install --no-cache --no-deps git+https://github.com/opendatahub-io/llama-stack.git@v{llama_stack_version}"""
40+
3941

4042
def get_llama_stack_install(llama_stack_version):
4143
# If the version is a commit SHA or a short commit SHA, we need to install from source
4244
if is_install_from_source(llama_stack_version):
43-
print(f"Installing llama-stack from source: {llama_stack_version}")
44-
return source_install_command.format(
45-
llama_stack_version=llama_stack_version
46-
).rstrip()
45+
# Check if this is an RHAI version
46+
if "+rhai" in llama_stack_version:
47+
print(
48+
f"Installing llama-stack from opendatahub-io repo: v{llama_stack_version}"
49+
)
50+
return rhai_install_command.format(
51+
llama_stack_version=llama_stack_version
52+
).rstrip()
53+
else:
54+
print(f"Installing llama-stack from source: {llama_stack_version}")
55+
return source_install_command.format(
56+
llama_stack_version=llama_stack_version
57+
).rstrip()
4758

4859

4960
def is_install_from_source(llama_stack_version):
50-
"""Check if version string is a git commit SHA (no dots = SHA, has dots = version)."""
51-
return "." not in llama_stack_version
61+
"""Check if version string is a git commit SHA (no dots = SHA, has dots = version) or contains +rhai suffix."""
62+
return "." not in llama_stack_version or "+rhai" in llama_stack_version
5263

5364

5465
def check_llama_installed():

scripts/gen_distro_docs.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,22 @@ def extract_llama_stack_version():
2121
content = file.read()
2222

2323
# Look for llama-stack version in pip install commands
24-
# Pattern matches: llama-stack==X.Y.Z
25-
pattern = r"llama-stack==([0-9]+\.[0-9]+\.[0-9]+)"
24+
# Pattern matches: llama-stack==X.Y.Z or llama-stack==X.Y.ZrcN+rhaiM
25+
pattern = r"llama-stack==([0-9]+\.[0-9]+\.[0-9]+(?:rc[0-9]+)?(?:\+rhai[0-9]+)?)"
2626
match = re.search(pattern, content)
2727

2828
if match:
2929
return match.group(1)
30-
else:
31-
print("Error: Could not find llama-stack version in Containerfile")
32-
exit(1)
30+
31+
# Look for git URL format: git+https://github.com/*/llama-stack.git@vVERSION or @VERSION
32+
git_pattern = r"git\+https://github\.com/[^/]+/llama-stack\.git@v?([0-9]+\.[0-9]+\.[0-9]+(?:rc[0-9]+)?(?:\+rhai[0-9]+)?)"
33+
git_match = re.search(git_pattern, content)
34+
35+
if git_match:
36+
return git_match.group(1)
37+
38+
print("Error: Could not find llama-stack version in Containerfile")
39+
exit(1)
3340

3441
except Exception as e:
3542
print(f"Error reading Containerfile: {e}")
@@ -163,14 +170,21 @@ def gen_distro_docs():
163170
# extract Llama Stack version from Containerfile
164171
version = extract_llama_stack_version()
165172

173+
# Determine repository URL based on version
174+
# If version contains +rhai, use opendatahub-io, otherwise use llamastack
175+
if "+rhai" in version:
176+
repo_url = "https://github.com/opendatahub-io/llama-stack"
177+
else:
178+
repo_url = "https://github.com/llamastack/llama-stack"
179+
166180
# header section
167181
header = f"""<!-- This file is automatically generated by scripts/gen_distro_doc.py - do not update manually -->
168182
169183
# Open Data Hub Llama Stack Distribution Image
170184
171185
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.
172186
173-
The image is currently shipping with upstream Llama Stack version [{version}](https://github.com/llamastack/llama-stack/releases/tag/v{version})
187+
The image is currently shipping with upstream Llama Stack version [{version}]({repo_url}/releases/tag/v{version})
174188
175189
You can see an overview of the APIs and Providers the image ships with in the table below.
176190

tests/run_integration_tests.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@
33
set -euo pipefail
44

55
# Configuration
6-
LLAMA_STACK_REPO="https://github.com/meta-llama/llama-stack.git"
76
WORK_DIR="/tmp/llama-stack-integration-tests"
87
INFERENCE_MODEL="${INFERENCE_MODEL:-Qwen/Qwen3-0.6B}"
98

109
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1110

12-
# Get version dynamically from Containerfile.in (look in parent directory)
13-
CONTAINERFILE_IN="$SCRIPT_DIR/../distribution/Containerfile.in"
14-
LLAMA_STACK_VERSION=$(grep -o 'llama-stack==[0-9]\+\.[0-9]\+\.[0-9]\+' "$CONTAINERFILE_IN" | cut -d'=' -f3)
11+
# Get version dynamically from build.py (look in parent directory)
12+
BUILD_PY="$SCRIPT_DIR/../distribution/build.py"
13+
LLAMA_STACK_VERSION=$(grep '^CURRENT_LLAMA_STACK_VERSION' "$BUILD_PY" | head -1 | sed 's/.*= *"\(.*\)".*/\1/')
1514
if [ -z "$LLAMA_STACK_VERSION" ]; then
16-
echo "Error: Could not extract llama-stack version from Containerfile.in"
15+
echo "Error: Could not extract llama-stack version from build.py"
1716
exit 1
1817
fi
1918

19+
# Determine which repo to use based on version suffix
20+
if [[ "$LLAMA_STACK_VERSION" == *"+rhai"* ]]; then
21+
LLAMA_STACK_REPO="https://github.com/opendatahub-io/llama-stack.git"
22+
else
23+
LLAMA_STACK_REPO="https://github.com/meta-llama/llama-stack.git"
24+
fi
25+
2026
function clone_llama_stack() {
2127
# Clone the repository if it doesn't exist
2228
if [ ! -d "$WORK_DIR" ]; then

0 commit comments

Comments
 (0)