diff --git a/.tekton/odh-trustyai-nemo-guardrails-server-pull-request.yaml b/.tekton/odh-trustyai-nemo-guardrails-server-pull-request.yaml index 8e3d353a50..82d97aa65d 100644 --- a/.tekton/odh-trustyai-nemo-guardrails-server-pull-request.yaml +++ b/.tekton/odh-trustyai-nemo-guardrails-server-pull-request.yaml @@ -43,11 +43,21 @@ spec: - linux/x86_64 - linux-m2xlarge/arm64 - linux/ppc64le + - linux/s390x - name: prefetch-input value: | - [{"type": "generic", "path": "."}] + [{ + "type": "pip", + "path": ".", + "requirements_files": ["requirements-build.txt", "requirements.txt", "requirements-models.txt"], + "binary": {"arch": "x86_64,aarch64,ppc64le,s390x"} + }, + { + "type": "generic", + "path": "." + }] - name: hermetic - value: false + value: "true" - name: enable-slack-failure-notification value: "false" - name: path-context @@ -70,4 +80,4 @@ spec: - name: git-auth secret: secretName: '{{ git_auth_secret }}' -status: {} \ No newline at end of file +status: {} diff --git a/Dockerfile.konflux b/Dockerfile.konflux index 1160b4d885..be22216160 100644 --- a/Dockerfile.konflux +++ b/Dockerfile.konflux @@ -1,175 +1,19 @@ -############################################################### -# Stage 1 Base builder image with common tooling -############################################################### -FROM registry.access.redhat.com/ubi9/python-312@sha256:7adc9bee533e01ff0b98220b67d17aca1280344bf7ad0b663bfc84cee7e1adb5 as packages-build - -USER root -WORKDIR /app - -ENV PATH="$HOME/.cargo/bin:$PATH" -ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ -ARG TARGETARCH - -# Install dependencies -RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ - dnf install -y \ - make libtool wget patch ninja-build cmake xz bzip2-devel libffi-devel zlib-devel openssl-devel libevent-devel \ - python3.12 python3.12-devel python3.12-pip clang \ - gcc-toolset-14-gcc gcc-toolset-14-gcc-c++ gcc-toolset-14-gcc-gfortran skopeo && \ - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ - dnf clean all && \ - pip install --upgrade setuptools-rust pip 'cmake<4' setuptools wheel maturin ; \ - fi - -COPY requirements* /app/ - -# Create a dummy file to trigger build dependency -RUN touch /tmp/control - -############################################################### -# Stage 2 to build OpenBLAS -############################################################### - -FROM packages-build AS openblas-builder -ENV OPENBLAS_VERSION=0.3.30 -ARG TARGETARCH - -WORKDIR /app - -# Creating a directory for OpenBlas -RUN mkdir /tmp/openblas - -RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ - source /opt/rh/gcc-toolset-14/enable && \ - wget https://github.com/OpenMathLib/OpenBLAS/releases/download/v${OPENBLAS_VERSION}/OpenBLAS-${OPENBLAS_VERSION}.zip && \ - unzip OpenBLAS-${OPENBLAS_VERSION}.zip -d /tmp/ && mv -T /tmp/OpenBLAS-${OPENBLAS_VERSION} /tmp/openblas && \ - cd /tmp/openblas && \ - make -j$(nproc) TARGET=POWER9 BINARY=64 USE_OPENMP=1 USE_THREAD=1 NUM_THREADS=120 DYNAMIC_ARCH=1 INTERFACE64=0 ; \ - fi - -############################################################### -# Stage 3 to build pyTorch -############################################################### - -FROM packages-build AS torch-builder -USER root - -WORKDIR /app - -ARG MAX_JOBS -ARG _GLIBCXX_USE_CXX11_ABI=1 -ARG TARGETARCH - -RUN mkdir -p /torchwheels - -RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ - export TORCH_VERSION=$(sed -n "s/^torch==//p" /app/requirements-torch.in) && \ - source /opt/rh/gcc-toolset-14/enable && \ - git clone --recursive https://github.com/pytorch/pytorch.git -b v${TORCH_VERSION} && \ - cd pytorch && pip install -r requirements.txt && \ - rm -f dist/torch*+git*whl && \ - # Set MAX_JOBS to 2 or 4 to prevent OOM - # MAX_JOBS=4 \ - USE_NCCL=0 \ - BUILD_TEST=0 \ - PYTORCH_BUILD_VERSION=${TORCH_VERSION} \ - PYTORCH_BUILD_NUMBER=1 \ - pip wheel . --no-build-isolation --wheel-dir /torchwheels/ \ -; fi - -############################################################### -# Stage 4 to build Tiktoken -############################################################### - -FROM packages-build as tiktoken-builder -ARG TARGETARCH -WORKDIR /app - -RUN mkdir -p /tiktokenwheels - -RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ - export TIKTOKEN_VERSION=$(sed -n "s/^tiktoken==//p" /app/requirements.txt) && \ - source /opt/rh/gcc-toolset-14/enable && \ - git clone https://github.com/openai/tiktoken.git && \ - cd tiktoken && \ - git checkout ${TIKTOKEN_VERSION} && \ - pip wheel . --wheel-dir /tiktokenwheels ; \ - fi - -############################################################### -# Stage 5 to build onnxruntime -############################################################### -FROM packages-build AS onnxruntime-builder -ARG TARGETARCH -USER root - -WORKDIR /app - -ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/app/.openblas/lib - -# copy built OpenBLAS sources -COPY --from=openblas-builder /tmp/openblas/ /build/openblas - -# Install OpenBLAS -RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ - PREFIX=/app/.openblas make -C /build/openblas install && \ - ln -sf /app/.openblas/lib/libopenblasp-r0.3.30.so /app/.openblas/lib/libopenblasp.so.0 ; \ - fi - -COPY scripts/build_onnxruntime.sh /build/build_onnxruntime.sh - -RUN mkdir -p /onnxruntime_wheels - -# Build onnxruntime -RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ - export ONNXRUNTIME_VERSION=$(sed -n "s/^onnxruntime==//p" /app/requirements.txt) && \ - sh /build/build_onnxruntime.sh ; \ - fi - -############################################################### -# Stage 6 Install hf_xet from source ppc64le -############################################################### -FROM packages-build AS hf-xet-builder -ARG TARGETARCH -USER root - -WORKDIR /app -RUN mkdir -p /hf_xet_wheels - -RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ - export HF_XET_VERSION=$(sed -n "s/^hf-xet==//p" /app/requirements.txt) && \ - git clone https://github.com/huggingface/xet-core.git && \ - cd xet-core/hf_xet && git checkout v${HF_XET_VERSION} && \ - sed -i '/python-source = "python"/d' pyproject.toml && \ - maturin build --release --out /hf_xet_wheels ; \ - fi - -############################################################### -# Stage 7 Install all the dependencies -############################################################### - -FROM registry.access.redhat.com/ubi9/python-312@sha256:7adc9bee533e01ff0b98220b67d17aca1280344bf7ad0b663bfc84cee7e1adb5 as build +ARG BASE=quay.io/aipcc/base-images/cpu:3.5.0 +FROM $BASE as build USER 0 WORKDIR /app -ARG TARGETARCH ARG GUARDRAILS_PROFILE=opensource -ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/app/.openblas/lib -ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/app/.openblas/lib/pkgconfig -ENV PATH="$HOME/.cargo/bin:/app/.venv/bin:$PATH" -ENV BLIS_ARCH=generic -ENV GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 -COPY requirements.txt requirements-torch.txt pyproject.toml README.md ./ +COPY requirements.txt requirements-build.txt requirements-models.txt pyproject.toml README.md LICENSE.md LICENSE-Apache-2.0.txt LICENCES-3rd-party ./ +COPY artifacts.lock.yaml ./ COPY nemoguardrails/ ./nemoguardrails/ COPY scripts/ ./scripts/ COPY examples/bots/ ./examples/bots/ RUN chmod +x ./scripts/entrypoint.sh - -RUN python3 -m pip install --no-cache-dir pyyaml - +RUN pip install --no-cache-dir pyyaml RUN python3 ./scripts/filter_guardrails.py ./scripts/provider-list.yaml $GUARDRAILS_PROFILE ENV HF_HOME=/app/.cache/huggingface \ @@ -178,65 +22,27 @@ ENV HF_HOME=/app/.cache/huggingface \ NLTK_DATA=/app/.cache/nltk_data \ FASTEMBED_CACHE_PATH=/app/.cache/fastembed -RUN python3 -m venv /app/.venv - -# Copy OpenBLAS -COPY --from=openblas-builder /tmp/openblas/ /tmp/openblas - -# Dummy file to trigger build dependency -COPY --from=torch-builder /tmp/control /dev/null -COPY --from=tiktoken-builder /tmp/control /dev/null -COPY --from=onnxruntime-builder /tmp/control /dev/null -COPY --from=hf-xet-builder /tmp/control /dev/null - -RUN --mount=type=cache,from=torch-builder,source=/torchwheels/,target=/tmp/torchwheels/,ro \ - --mount=type=cache,from=tiktoken-builder,source=/tiktokenwheels/,target=/tmp/tiktokenwheels/,ro \ - --mount=type=cache,from=onnxruntime-builder,source=/onnxruntime_wheels/,target=/tmp/onnxruntime_wheels/,ro \ - --mount=type=cache,from=hf-xet-builder,source=/hf_xet_wheels/,target=/tmp/hf_xet_wheels/,ro \ - if [ "$TARGETARCH" = "ppc64le" ]; then \ - /app/.venv/bin/pip install \ - /tmp/torchwheels/*.whl \ - /tmp/tiktokenwheels/*.whl \ - /tmp/onnxruntime_wheels/*.whl \ - /tmp/hf_xet_wheels/*.whl && \ - PREFIX=/app/.openblas make -C /tmp/openblas install && rm -rf /tmp/openblas ; \ - fi - -# Temporary workaround for ppc64le with the pinned pandas version. Remove after upgrading pandas with v3.x -RUN if [ "$TARGETARCH" == "ppc64le" ]; then \ - export PANDAS_VERSION=$(sed -n "s/^pandas==//p" /app/requirements.txt) && \ - /app/.venv/bin/pip install --no-cache-dir "meson<1.10" meson-python ninja cython numpy versioneer[toml] packaging && \ - /app/.venv/bin/pip install --no-cache-dir --no-build-isolation pandas==${PANDAS_VERSION} ; \ - fi - -RUN /app/.venv/bin/pip install --no-cache-dir -r requirements.txt && \ +RUN python3 -m venv /app/.venv && \ + /app/.venv/bin/pip install --no-cache-dir -r requirements-build.txt && \ + /app/.venv/bin/pip install --no-cache-dir -r requirements.txt && \ + /app/.venv/bin/pip install --no-cache-dir -r requirements-models.txt && \ + mkdir -p nemoguardrails/examples && \ + cp -r examples/bots nemoguardrails/examples/bots && \ /app/.venv/bin/pip install --no-cache-dir --no-deps . && \ - rm -rf /root/.cache/pip /tmp/* /var/tmp/* - -RUN /app/.venv/bin/pip install --no-cache-dir /cachi2/output/deps/generic/en_core_web_lg-3.8.0-py3-none-any.whl - -RUN if [ "$TARGETARCH" != "ppc64le" ]; then \ - /app/.venv/bin/pip install --no-cache-dir -r requirements-torch.txt ; \ - fi + rm -rf nemoguardrails/examples /root/.cache/pip /tmp/* /var/tmp/* RUN set -ex && \ - GUARDRAILS_PROFILE=$GUARDRAILS_PROFILE /app/.venv/bin/python ./scripts/pre_download_required_models.py && \ + GUARDRAILS_PROFILE=$GUARDRAILS_PROFILE ./scripts/setup_prefetched_models.sh && \ find /app/.cache -type f -name "*.pyc" -delete && \ find /app/.cache -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \ find /app/.cache -type d -name ".git" -exec rm -rf {} + 2>/dev/null || true && \ rm -rf /app/.cache/huggingface/xet /root/.cache /tmp/* /var/tmp/* -############################################################### -# Stage 8 Final Build -############################################################### - -FROM registry.access.redhat.com/ubi9/python-312:latest as runtime +FROM $BASE as runtime USER 0 WORKDIR /app -ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/app/.openblas/lib - COPY --from=build /app /app RUN rm -f /etc/security/namespace.conf /usr/lib64/security/pam_namespace.so || true && \ @@ -253,8 +59,10 @@ ENV HF_HOME=/app/.cache/huggingface \ FASTEMBED_CACHE_PATH=/app/.cache/fastembed \ PATH="/app/.venv/bin:$PATH" \ PYTHONUNBUFFERED=1 \ + DO_NOT_TRACK=1 \ PYTHONDONTWRITEBYTECODE=1 \ - DO_NOT_TRACK=1 + REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \ + SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt EXPOSE 8000 ENTRYPOINT ["./scripts/entrypoint.sh"] diff --git a/artifacts.lock.yaml b/artifacts.lock.yaml index e558172f4f..ac9831e10d 100644 --- a/artifacts.lock.yaml +++ b/artifacts.lock.yaml @@ -1,7 +1,64 @@ ---- +# Auto-generated by scripts/generate_model_lockfile.py +# Re-run to update: uv run --with pyyaml --with fastembed scripts/generate_model_lockfile.py + +# profile: opensource +# sentence-transformers/all-MiniLM-L6-v2 commit: c9745ed1d9f207416be6d2e6f8de32d1f16199bf +# qdrant/all-MiniLM-L6-v2-onnx commit: 5f1b8cd78bc4fb444dd171e59b18f3a3af89a079 + metadata: - version: "1.0" + version: '1.0' artifacts: - - download_url: "https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.8.0/en_core_web_lg-3.8.0-py3-none-any.whl" - checksum: "sha256:293e9547a655b25499198ab15a525b05b9407a75f10255e405e8c3854329ab63" - filename: "en_core_web_lg-3.8.0-py3-none-any.whl" +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/config.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--config.json + checksum: sha256:953f9c0d463486b10a6871cc2fd59f223b2c70184f49815e7efbcab5d8908b41 +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/config_sentence_transformers.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--config_sentence_transformers.json + checksum: sha256:061ca9d39661d6c6d6de5ba27f79a1cd5770ea247f8d46412a68a498dc5ac9f3 +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/data_config.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--data_config.json + checksum: sha256:32edcb108fc2516b920734a862ae0692bcae1c5d45d5f8d972cb0d53434a4c54 +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/model.safetensors + filename: hf--sentence-transformers--all-MiniLM-L6-v2--model.safetensors + checksum: sha256:53aa51172d142c89d9012cce15ae4d6cc0ca6895895114379cacb4fab128d9db +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/modules.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--modules.json + checksum: sha256:84e40c8e006c9b1d6c122e02cba9b02458120b5fb0c87b746c41e0207cf642cf +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/sentence_bert_config.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--sentence_bert_config.json + checksum: sha256:fc1993fde0a95c24ec6c022539d41cf6e2f7c9721e5415d6fb6897472a9cd4b7 +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/special_tokens_map.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--special_tokens_map.json + checksum: sha256:303df45a03609e4ead04bc3dc1536d0ab19b5358db685b6f3da123d05ec200e3 +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/tokenizer.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--tokenizer.json + checksum: sha256:be50c3628f2bf5bb5e3a7f17b1f74611b2561a3a27eeab05e5aa30f411572037 +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/tokenizer_config.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--tokenizer_config.json + checksum: sha256:acb92769e8195aabd29b7b2137a9e6d6e25c476a4f15aa4355c233426c61576b +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/vocab.txt + filename: hf--sentence-transformers--all-MiniLM-L6-v2--vocab.txt + checksum: sha256:07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3 +- download_url: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/1_Pooling/config.json + filename: hf--sentence-transformers--all-MiniLM-L6-v2--1_Pooling--config.json + checksum: sha256:4be450dde3b0273bb9787637cfbd28fe04a7ba6ab9d36ac48e92b11e350ffc23 +- download_url: https://huggingface.co/qdrant/all-MiniLM-L6-v2-onnx/resolve/main/config.json + filename: hf--qdrant--all-MiniLM-L6-v2-onnx--config.json + checksum: sha256:1b4d8e2a3988377ed8b519a31d8d31025a25f1c5f8606998e8014111438efcd7 +- download_url: https://huggingface.co/qdrant/all-MiniLM-L6-v2-onnx/resolve/main/model.onnx + filename: hf--qdrant--all-MiniLM-L6-v2-onnx--model.onnx + checksum: sha256:bbd7b466f6d58e646fdc2bd5fd67b2f5e93c0b687011bd4548c420f7bd46f0c5 +- download_url: https://huggingface.co/qdrant/all-MiniLM-L6-v2-onnx/resolve/main/special_tokens_map.json + filename: hf--qdrant--all-MiniLM-L6-v2-onnx--special_tokens_map.json + checksum: sha256:5d5b662e421ea9fac075174bb0688ee0d9431699900b90662acd44b2a350503a +- download_url: https://huggingface.co/qdrant/all-MiniLM-L6-v2-onnx/resolve/main/tokenizer.json + filename: hf--qdrant--all-MiniLM-L6-v2-onnx--tokenizer.json + checksum: sha256:da0e79933b9ed51798a3ae27893d3c5fa4a201126cef75586296df9b4d2c62a0 +- download_url: https://huggingface.co/qdrant/all-MiniLM-L6-v2-onnx/resolve/main/tokenizer_config.json + filename: hf--qdrant--all-MiniLM-L6-v2-onnx--tokenizer_config.json + checksum: sha256:bd2e06a5b20fd1b13ca988bedc8763d332d242381b4fbc98f8fead4524158f79 +- download_url: https://huggingface.co/qdrant/all-MiniLM-L6-v2-onnx/resolve/main/vocab.txt + filename: hf--qdrant--all-MiniLM-L6-v2-onnx--vocab.txt + checksum: sha256:07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3 +- download_url: https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/tokenizers/punkt.zip + filename: nltk--punkt.zip + checksum: sha256:51c3078994aeaf650bfc8e028be4fb42b4a0d177d41c012b6a983979653660ec diff --git a/constraints-aipcc.txt b/constraints-aipcc.txt new file mode 100644 index 0000000000..1d92add1d2 --- /dev/null +++ b/constraints-aipcc.txt @@ -0,0 +1 @@ +torch==2.11.0 diff --git a/requirements-build.txt b/requirements-build.txt new file mode 100644 index 0000000000..726f4f3a64 --- /dev/null +++ b/requirements-build.txt @@ -0,0 +1,10 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile - --config-file /dev/null --no-sources --index-url https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ --python-platform linux --python-version 3.12 --emit-index-url --emit-index-annotation --generate-hashes --no-cache -o requirements-build.txt +--index-url https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ + +uv-build==0.11.29 \ + --hash=sha256:5e0ab75518832cad47a20c814cb68bb8c599117877c66b157a89a55907e56ff1 \ + --hash=sha256:8a698dd58ec5b7e9c91165de5f43798575bc466ec334e3f93734a4df876ea7e6 \ + --hash=sha256:aa689da63adaec91e4d87e7df72742bfb57844f5d352c8a8bbacd98ebe23e7ad \ + --hash=sha256:d00fb39395b6814d457420a2d27fb1513976d5c85aaf986f81843b79c6cddacb + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ diff --git a/requirements-models.txt b/requirements-models.txt new file mode 100644 index 0000000000..9c4c16b1f4 --- /dev/null +++ b/requirements-models.txt @@ -0,0 +1,2 @@ +en-core-web-lg @ https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.8.0/en_core_web_lg-3.8.0-py3-none-any.whl \ + --hash=sha256:293e9547a655b25499198ab15a525b05b9407a75f10255e405e8c3854329ab63 diff --git a/requirements.txt b/requirements.txt index edcd7cecf1..ac8a1ce245 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,191 +1,357 @@ # This file was autogenerated by uv via the following command: -# uv pip compile pyproject.toml --extra sdd --extra jailbreak --extra tracing --extra models --extra multilingual --extra server --extra otel -o requirements.txt -aiofiles==25.1.0 +# uv pip compile pyproject.toml --config-file /dev/null --no-sources --constraint constraints-aipcc.txt --index-url https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ --extra sdd --extra jailbreak --extra tracing --extra models --extra multilingual --extra server --extra otel --python-platform linux --python-version 3.12 --emit-index-url --emit-index-annotation --generate-hashes --prerelease=if-necessary --no-strip-markers --no-cache -o requirements.txt +--index-url https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ + +aiofiles==25.1.0 \ + --hash=sha256:d88524ff071909368cb3a1b1240d218ae203840276e6bff57ec59920692e401f # via nemoguardrails (pyproject.toml) -aiohappyeyeballs==2.6.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +aiohappyeyeballs==2.7.1 \ + --hash=sha256:148c42ea64254eff51702e3643744a5d29e19f1cc7f1adcfb2289d7ac711ae80 # via aiohttp -aiohttp==3.12.15 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +aiohttp==3.14.1 \ + --hash=sha256:bd49302b6aa79db20905429d539a0a328adf440c0a75508892ae9700d6318857 \ + --hash=sha256:c958019fc4a4a4536be8308b5efdebb7b31b51dbcf9cc651e16d782ec404d372 \ + --hash=sha256:dc7528950c7a168f8f70cfba05e112f4a857d658c9f0dfc854d6d4e9b17ecc23 \ + --hash=sha256:f3c686257c0297a912e82e2582f6587b922f1e7b1e3ff0a2d3d3fb7093db545e # via # nemoguardrails (pyproject.toml) # aiohttp-retry -aiohttp-retry==2.9.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +aiohttp-retry==2.9.1 \ + --hash=sha256:fd658af8a3099af8dd6a3ff4bb83eae78d1b5477e2f5ffe756959ad647e4704a # via nemoguardrails (pyproject.toml) -aiosignal==1.4.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +aiosignal==1.4.0 \ + --hash=sha256:f67c1242810c1da35afc04f8fe6057d1f133fa581d32ecc4c841d08134436218 # via aiohttp -annotated-doc==0.0.4 - # via fastapi -annotated-types==0.7.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +annotated-doc==0.0.4 \ + --hash=sha256:1ecb2803f2d35e57ba03d74245d9ece70ffce1552a51d1ab1d2b439d791e5086 + # via + # fastapi + # typer + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +annotated-types==0.7.0 \ + --hash=sha256:d31d6f386f3ecd6cdca12274844b969c3f9c90d15ebef7774f2eb34857108758 # via pydantic -anyio==4.11.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +anyio==4.14.2 \ + --hash=sha256:910fa689d2615586a8c10cd10caaa20a6613e5eda16c3844eeb2b0886d37c8d3 # via # httpx # openai # starlette -asgiref==3.11.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +asgiref==3.11.1 \ + --hash=sha256:90372ebc0549731df1fa4fe99d5166f84dbff7c4840b935627ca67afc54502d8 # via opentelemetry-instrumentation-asgi -attrs==25.3.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +attrs==26.1.0 \ + --hash=sha256:72a7cd6c5cd0ba459eec87d0cff40ba06839196b8355a01450ea1db9f6ab6a3d # via # aiohttp # jsonschema # referencing -blis==1.3.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +blis==1.3.3 ; python_full_version < '3.14' \ + --hash=sha256:3b6ff9381a57816ec92731cdc8a5797444f11289a7458ec9d63da8f8354faa0f \ + --hash=sha256:47a8d7cf4f430c4e6f95082cf02d9e61bf8961a50d9d41abf1820a1f8dac2b29 \ + --hash=sha256:80c8d5f0e51831694734105d9a047193aebf7918c05c865923abe52b56785910 \ + --hash=sha256:c1ae9d426e7345eb936fda81639a7dddcaaf479bffc948da7c0c4018fe18103b # via thinc -catalogue==2.0.10 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +catalogue==2.0.10 ; python_full_version < '3.14' \ + --hash=sha256:c984aab0d6a13531a38af6de79747392d81210df460324eb29b62ecd30240fe8 # via # spacy # srsly # thinc -certifi==2025.8.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +certifi==2026.6.17 \ + --hash=sha256:36a32caf926900a4f112e18621636a19ce6474c5b2aeb148588147d2633ec530 # via # httpcore # httpx # requests -cffi==1.17.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +cffi==2.1.0 ; python_full_version < '3.13' and platform_python_implementation != 'PyPy' \ + --hash=sha256:4cb547fde61ec9e28fc046ea5b67c831179be045edd0cdec97e01897ba441d0d \ + --hash=sha256:5ec366c2be9b0caedc5686fff68f0fb70af4338a30bf8ab2b56aa639b4586e32 \ + --hash=sha256:65e6e21e29db824177b9282258a67f823df03c743c16e827c631bcc92a235632 \ + --hash=sha256:b703edbff5360a21fef99111c05dca5d40fba6fbc8c2b6367a9f2caee76cb952 # via cryptography -charset-normalizer==3.4.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +charset-normalizer==3.4.9 \ + --hash=sha256:f18b10e61ad57e6dcfe041ff3b09cead474856d11ec7c0f14edbdad695760780 # via requests -click==8.1.8 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +click==8.4.2 \ + --hash=sha256:368d4af9976de9fc5efc4d8a26c64d23c187c21a2eba9336254832d466dd6198 # via + # huggingface-hub # nltk - # typer # uvicorn -cloudpathlib==0.22.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +cloudpathlib==0.24.0 ; python_full_version < '3.14' \ + --hash=sha256:705101c181a990a335cd83d870583f1457083faef090eaef69e3c53274392733 # via weasel -coloredlogs==15.0.1 - # via onnxruntime -colorlog==6.10.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +colorlog==6.10.1 \ + --hash=sha256:3156d4eba09beca2edc59694c6ab680c72dc8567ee7d2cf84468e45e5a5c6224 # via robust-downloader -confection==0.1.5 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +confection==1.3.3 ; python_full_version < '3.14' \ + --hash=sha256:984c46ff067823064c604c67dc3ceb41b6d03824d5641283b3ae36b530a076af # via + # spacy # thinc # weasel -cryptography==44.0.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +cryptography==46.0.7 ; python_full_version < '3.13' \ + --hash=sha256:34ed3880d5c3f830de8cb74a57959504783bdd71001647b5a6c28787efc5136d \ + --hash=sha256:980370292281872cbfada8f102038d48ec2b223c011323f8e7bb88d51ff64a32 \ + --hash=sha256:9c6bdda5de739b10fedea371f0754385c4d3c89775a95cba856121ef10c8d77d \ + --hash=sha256:dc8b19d3cb196992bb0fcf7b169586aa00cebd8b9fecb84154b604df19fc477e # via presidio-anonymizer -cymem==2.0.11 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +cymem==2.0.13 ; python_full_version < '3.14' \ + --hash=sha256:099cbced01c64a81d26a92c836b8dcbce044a414f7b10cdf3ff7a235694d8544 \ + --hash=sha256:317d6d7c24922f8ea461aafb05e261bb0c98ea2be1165e036d978949a5e783a7 \ + --hash=sha256:6a5518f1a7e4dc32f965fa36d877e9340f82756b0b28bfdaa67036d197738efc \ + --hash=sha256:77f56c266fb31b1c53b49623587b50165b328062075c64215ea9305c44a60974 # via # preshed # spacy # thinc -dataclasses-json==0.6.7 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +dataclasses-json==0.6.7 \ + --hash=sha256:2d1875529ff60076c7aa1c36694bdb79b8b5963d7fdd3a67b21079477f36bb52 # via nemoguardrails (pyproject.toml) -distro==1.9.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +defusedxml==0.7.1 \ + --hash=sha256:884a1483dffbab373933eb9604e1ebb2a6d5e794b1c467e83ddd453a9d48b1c6 + # via nltk + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +distro==1.9.0 \ + --hash=sha256:e76c1bcd413a800244e5719cda5e981e6890b1f9ac2e6d7d8bb4e6e9fcb1299e # via openai -einops==0.8.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +einops==0.8.2 \ + --hash=sha256:8d6101bd5244fcdee471aaf8cd8bfc6be8644cbdfea35e49f5e55e37a077b552 # via nemoguardrails (pyproject.toml) -fast-langdetect==1.0.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +fast-langdetect==1.0.1 \ + --hash=sha256:687c1768a9551f3a0b665f14b2ce1b6b96b8dc503b0eb8353243ed7be8c91373 # via nemoguardrails (pyproject.toml) -fastapi==0.122.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +fastapi==0.139.0 \ + --hash=sha256:2168ec8cfcd11399fb63fd49903a53e0a49aa5f178a90dd72ee6cc482d98c3a6 # via nemoguardrails (pyproject.toml) -fastembed==0.6.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +fastembed==0.8.0 \ + --hash=sha256:ff9a7c1fd3317744f64372b3169e206dc6d3d5ffe5c8438988fed65f2e9ce61a # via nemoguardrails (pyproject.toml) -fasttext-predict==0.9.2.4 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +fasttext-predict==0.9.2.4 \ + --hash=sha256:0be162b60920eab91a1aaa63db21654186972c61fe4ce343f0c01c5dd31ada0b \ + --hash=sha256:3d13a0443a71fae2bf213385f50aed696d1c5b95ec5c1c2b4a7e3a29fe8c2bb1 \ + --hash=sha256:6ea9b7ef1ac01002e546e00e7a56816fd33ed74e03f870e58858b784725ade94 \ + --hash=sha256:e241eca74f595e4348e8e549d49d6674729f4a131ad67ff078d0afa6e371851e # via fast-langdetect -filelock==3.19.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +filelock==3.29.7 \ + --hash=sha256:23543cc34a61918869874773bcc0340e77a3b5281205c84340214d541d9d106e # via # huggingface-hub # tldextract # torch - # transformers -flatbuffers==25.2.10 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +flatbuffers==25.12.19 \ + --hash=sha256:e99ea868c91295bad73c7e8d32c76f8c33b82edb09334769340f382f3fc179b5 # via onnxruntime -frozenlist==1.7.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +frozenlist==1.8.0 \ + --hash=sha256:053403b043ebba4431ecd530760be926f862f441280a20703e157b33a5b69e2f \ + --hash=sha256:0e702e35f72baf35d3c6d8b34e664a4b90bb7bd2090e585c4419bd77a9e0eb37 \ + --hash=sha256:824190e162bc775e7f6ded9bde5897738987c51548677c213d1ff728b10efe5b \ + --hash=sha256:866c929c5c39e63efa1d48fffa6f38add29f7e97eca458963e1d078ab1d52a25 # via # aiohttp # aiosignal -fsspec==2025.9.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +fsspec==2026.6.0 \ + --hash=sha256:9a76dd86f01d5e2034c8192684e131d070de32d4d9d76843821351819e6ee2ef # via # huggingface-hub # torch -googleapis-common-protos==1.74.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +googleapis-common-protos==1.75.0 \ + --hash=sha256:371cd0ca347d6b331c0f70fbbf7aa5cbbba6092d91d27c9bbfab7701a1b6612d # via # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http -grpcio==1.80.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +grpcio==1.82.1 ; python_full_version < '3.13' \ + --hash=sha256:3e4ac899ed92dade47b27e610e2244155785a133e805a2ca2f99bcc4be19c459 \ + --hash=sha256:7eb2fd6947a1db245bda06939c4b527a909b8b2f3154bd58ce5661953a0cb187 \ + --hash=sha256:b36c17d2eea636176911879ce8fc7784609a9a5e90d53f6d91aa4498e003c24a \ + --hash=sha256:d6f37aa3638a023da59605c564406ca7bac0577f525a12eeb71c1f9b9161377c # via opentelemetry-exporter-otlp-proto-grpc -h11==0.16.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +h11==0.16.0 \ + --hash=sha256:cdf040cf1a6fd5711975544a7931d24e41901fe6dceed7f7effda231389afff3 # via # httpcore # uvicorn -hf-xet==1.1.10 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +hf-xet==1.5.1 ; platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64' \ + --hash=sha256:1c81a2bf52de7fce806473afeae8822ebabbb806cc45d6e7df906a8ebf25fcbc \ + --hash=sha256:236938f6e7b607bba83e3c69f706a88c04ac98ae40185b7993d2252c27c31512 \ + --hash=sha256:5072f2dcc3fb7d66700b2b14af25f534623b2b71166f4a6566dac091da387936 \ + --hash=sha256:e0b14eda87d8109be4ca52aa5daef4897ed046ff2e558f363be65008c048149e # via huggingface-hub -httpcore==1.0.9 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +httpcore==1.0.9 \ + --hash=sha256:fc0ea63671089523efc6fe94ec49d0b10c9660460cbca6172fc972c1c5f9c0ac # via httpx -httpx==0.28.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +httpx==0.28.1 \ + --hash=sha256:40b3fef8650d88ced417b05b236427596a6da9117b0f64ef5b0a5d548d20addb # via # nemoguardrails (pyproject.toml) + # huggingface-hub # openai -huggingface-hub==0.35.1 + # weasel + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +huggingface-hub==1.23.0 \ + --hash=sha256:02a6f0907297162b84f172e438459418d4fa1fd282270941d40da74b73be55a0 # via # fastembed # sentence-transformers # tokenizers # transformers -humanfriendly==10.0 - # via coloredlogs -idna==3.10 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +idna==3.18 \ + --hash=sha256:8a16d5d6db808e4640e6bad7349f52e09b10eba58914fb7d366902ec4fc226a8 # via # anyio # httpx # requests # tldextract # yarl -importlib-metadata==8.7.0 - # via opentelemetry-api -jinja2==3.1.6 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +jinja2==3.1.6 \ + --hash=sha256:500424e00f5a3b423f8657c8bb0bd846da38af583d9535629f9f93045865bd11 # via # nemoguardrails (pyproject.toml) # spacy # torch -jiter==0.10.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +jiter==0.16.0 \ + --hash=sha256:71e400841df4a05ff6d7eb71d0b3e57af1cb158b30506a6313a44b5cfb1e93c4 \ + --hash=sha256:71f95cc31636f2dfa4cdbc951714d7b115e4145b7b20b2bcef04076736de6d9b \ + --hash=sha256:b5ea8797b52efba14488d4e249574bf9ab72bf72a91dab20353dc41435a5cb57 \ + --hash=sha256:f97799dd09d944510feca7b3f8f3c81066c6577f8b3469b59f12ebabcb5c8c3e # via openai -joblib==1.5.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +joblib==1.5.3 \ + --hash=sha256:5abb2344270cfda261f96ba20f11fb77c3fb1a36769063440ee2ae421b0cb524 # via # nltk # scikit-learn -jsonschema==4.26.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +jsonschema==4.26.0 \ + --hash=sha256:a0c500e520dfa787df50dad9daa55eae681fd98f6532bed2fea79583b7ba41ee # via nemoguardrails (pyproject.toml) -jsonschema-specifications==2025.9.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +jsonschema-specifications==2025.9.1 \ + --hash=sha256:186d1ac186ac3a66c9303cbac3c8cda992d48c0c5b495b1ec450abe415b00c35 # via jsonschema -langcodes==3.5.0 - # via spacy -language-data==1.3.0 - # via langcodes -lark==1.3.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +lark==1.3.1 \ + --hash=sha256:b9af44fe4931da6f8fca2a8dc91540a6753234b43aa4fcc5e3b2c2b5883dd15e # via nemoguardrails (pyproject.toml) -loguru==0.7.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +loguru==0.7.3 \ + --hash=sha256:5e0951536d1f5dbab12348593288122d5c62b63ee0ebcceb2c8e8a5348abc348 # via fastembed -marisa-trie==1.3.1 - # via language-data -markdown-it-py==3.0.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +markdown-it-py==4.2.0 \ + --hash=sha256:aec8d53b1472c56d47ce05b7da68fd354ffb406b38d4245567d368f130a9e628 # via rich -markupsafe==3.0.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +markupsafe==3.0.3 \ + --hash=sha256:69df84105cae0b20755395a4ef80a8a97a9993be2a6efe47bc91aef05e26fc51 \ + --hash=sha256:df08b744fa599c9bd3bccd7d0b72a9f12c4bfb0a31a5ce3113f4b16289429e6f \ + --hash=sha256:e0404961f3e45375f32cb6a8fec8821f4dbfabb62d6880ac0e7d316ba05bfafd \ + --hash=sha256:e6c6055c4623ff263b359600373e42d2027521c5f7f453b535a5a05ea37b8537 # via jinja2 -marshmallow==3.26.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +marshmallow==3.26.2 \ + --hash=sha256:6f4fe9b5499f80c72a99efb8f31659dd75f08efd9949553aa9378b61b177a4c2 # via dataclasses-json -mdurl==0.1.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +mdurl==0.1.2 \ + --hash=sha256:3b685cb48a3cde202b232cb167ea1d9c287724d240966f2f16d2f10732b78636 # via markdown-it-py -mmh3==5.2.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +mmh3==5.2.1 \ + --hash=sha256:1a8a791ed8668218c941faff02d7d532e122ee27d13c22ac4035718b7593a901 \ + --hash=sha256:58e95f76adc4b260482e1959f58e638483283de3a174e20fd870ef5ce6f58a9c \ + --hash=sha256:cf4bc684dcc8e8d04585858d7d29d39b03b2b0f352949f62c4f4601687c96c37 \ + --hash=sha256:e4448c1a745cbf008bc1294a23c928e12955f9922816f8e2e10c8ffc03ba53be # via fastembed -mpmath==1.3.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +mpmath==1.3.0 \ + --hash=sha256:3912d9c5c6877b3a3198b133dfe5b8a7c64c87566f7b16f460c12dc30fa77405 # via sympy -multidict==6.6.4 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +multidict==6.7.1 \ + --hash=sha256:14a85a18a8d32c109c4886b8bfae4a66b55d275a86a19dd8a0b611887bde6c85 \ + --hash=sha256:4213730650f4d37161dfda5ec18ad17c62c7f2d9d36a3a2599afe58bd8a13af1 \ + --hash=sha256:b863786cc047cc648abc38b892a5575a0abcb5e1b9b348cd89f122ac4d7b304f \ + --hash=sha256:e145db09d0ab2761780a43d8380a7d8f6faffac11966d8148375ab7175a0f249 # via # aiohttp # yarl -murmurhash==1.0.13 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +murmurhash==1.0.15 ; python_full_version < '3.14' \ + --hash=sha256:3ee17e1759bcb9f2af36dbea51b7f7f21655cffca022e3bf7cf123b20b2ee34c \ + --hash=sha256:6372d5a0364b64656886382fce226ec4c00be392c920e216afe3fed0f0939999 \ + --hash=sha256:64e5be8a79111f47d75228d85c80c827badb2674c25e0e0314e15b469aa0df6c \ + --hash=sha256:a7240323b48d24cca9d1ab25bc48b1dad5cdf2e7d529d773ed20d8642a0f709d # via # preshed # spacy # thinc -mypy-extensions==1.1.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +mypy-extensions==1.1.0 \ + --hash=sha256:f7f636a7360807519bd95427d165a3c3fee64409d472d68a28ff7d1bfbfc04f1 # via typing-inspect -nest-asyncio==1.6.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +narwhals==2.24.0 \ + --hash=sha256:30285014e6754ed468b29358bc0aebff0117d6a1d64383254ae55ceef31ffb25 + # via scikit-learn + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +nest-asyncio==1.6.0 \ + --hash=sha256:bc670975ff4841edd60557a783e392e2986b15add8e0a00d1496c1e39dbc770e # via nemoguardrails (pyproject.toml) -networkx==3.5 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +networkx==3.6.1 \ + --hash=sha256:56b687ad58bed743066f1b7d5e6f56a72d2f193c8eaf35064abaedda4fba3745 # via torch -nltk==3.9.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +nltk==3.10.0 \ + --hash=sha256:a15da2911adca5c7b4574b902f6b344f3f65db72ded7f79b30617bbe7100d318 # via nemoguardrails (pyproject.toml) -numpy==2.3.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +numpy==2.5.1 \ + --hash=sha256:398208907bae47249bf42e9ec9777b0843f16ff00b184a787df82f6e9d34e2ff \ + --hash=sha256:3ac2e92457dccce781b28fef191628bca87e4faf42d32bdc9a27b9e5591ad4a9 \ + --hash=sha256:56b3c007c7d0bf3cf44f3545cf7a9056fad39835e9044d843ac8a544aae88ad0 \ + --hash=sha256:721559a7de55779c32c6affe4f08b147bffd8ea53e633f5b0a3d0282e099d053 # via # nemoguardrails (pyproject.toml) # blis @@ -196,13 +362,22 @@ numpy==2.3.3 # spacy # thinc # transformers -onnxruntime==1.22.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +onnxruntime==1.25.0 \ + --hash=sha256:00ec31c4963c1561124f278dd4058cb2cf55d83ea550cbd4b9c93f200a7b5ee0 \ + --hash=sha256:3920531be24f0904d3284df31bcd8ae9749fd43660ab7972cc79c17611d30662 \ + --hash=sha256:97e9b447874d91ea5398fb747cfe7500106a3cfdf0535102098211369096f7a9 \ + --hash=sha256:e3be21428998cad4ed823f06f2f0bc5e4cb3da9e56389e98002eacfd71b202ee # via # nemoguardrails (pyproject.toml) # fastembed -openai==2.21.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +openai==2.45.0 \ + --hash=sha256:93cbc0461f69bbd1c81c513c69d120bfe014049f02676a3f5e940541899c3238 # via nemoguardrails (pyproject.toml) -opentelemetry-api==1.38.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-api==1.43.0 \ + --hash=sha256:d5a5a56ae11c0a04240e8ce1e7e18bede5c0f755bb612a30456312e0d2b7eaeb # via # nemoguardrails (pyproject.toml) # opentelemetry-distro @@ -214,53 +389,81 @@ opentelemetry-api==1.38.0 # opentelemetry-instrumentation-httpx # opentelemetry-sdk # opentelemetry-semantic-conventions -opentelemetry-distro==0.59b0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-distro==0.64b0 \ + --hash=sha256:205d5bed29f8042184cb78d315f4af141274701fcdef9eaff07ed6149bebfddd # via nemoguardrails (pyproject.toml) -opentelemetry-exporter-otlp==1.38.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-exporter-otlp==1.43.0 \ + --hash=sha256:902e0c5f5eeb061e794a2cc6a1a503a008094e08b964d4f01b626c780c14e5ef # via nemoguardrails (pyproject.toml) -opentelemetry-exporter-otlp-proto-common==1.38.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-exporter-otlp-proto-common==1.43.0 \ + --hash=sha256:b97c66b65e267c685152a10104dfe5f8b5beac824e89cbe02ab61f33285bb125 # via # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http -opentelemetry-exporter-otlp-proto-grpc==1.38.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-exporter-otlp-proto-grpc==1.43.0 \ + --hash=sha256:2e5f27efc78a0da24dade88cf50d19bfdc64b8524b45f5ac9b421d21fceb72be # via opentelemetry-exporter-otlp -opentelemetry-exporter-otlp-proto-http==1.38.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-exporter-otlp-proto-http==1.43.0 \ + --hash=sha256:125ad3c3025f92229100555e33c8db0f0cbb8c615b27bc350cdb5933bf4b629d # via opentelemetry-exporter-otlp -opentelemetry-instrumentation==0.59b0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-instrumentation==0.64b0 \ + --hash=sha256:63e378e600f45e0a85daea1894d79e7b92633c4a6645c3fbf3deda9d7c11dcd3 # via # opentelemetry-distro # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx -opentelemetry-instrumentation-asgi==0.59b0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-instrumentation-asgi==0.64b0 \ + --hash=sha256:1e062b7704ac174879a250ab824b9fb14725130d0583720b2813c7a18de0aa19 # via opentelemetry-instrumentation-fastapi -opentelemetry-instrumentation-fastapi==0.59b0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-instrumentation-fastapi==0.64b0 \ + --hash=sha256:d94e51a6359d5795b86cc707906dceeebdf5b70de7eacd431a4673d46dde0995 # via nemoguardrails (pyproject.toml) -opentelemetry-instrumentation-httpx==0.59b0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-instrumentation-httpx==0.64b0 \ + --hash=sha256:a8f7895d72ef146680dbeee0a4914f986d718a51b4d3847f2a9bc97e37272ef9 # via nemoguardrails (pyproject.toml) -opentelemetry-proto==1.38.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-proto==1.43.0 \ + --hash=sha256:5a35c1d6e39162e5e3f7dc5bed9c0e1afc786020a5fc230b7c2f2e7699c294fd # via # opentelemetry-exporter-otlp-proto-common # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http -opentelemetry-sdk==1.38.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-sdk==1.43.0 \ + --hash=sha256:ca8bf96cfa0ca462ac17866f03f78d79523e37e06c8628a8e3aff71dc65d6dd6 # via # opentelemetry-distro # opentelemetry-exporter-otlp-proto-grpc # opentelemetry-exporter-otlp-proto-http -opentelemetry-semantic-conventions==0.59b0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-semantic-conventions==0.64b0 \ + --hash=sha256:00d10ccc86c1c169ab96e8b182b5369ad20c129d473a1e40f93ce3226786ffe0 # via # opentelemetry-instrumentation # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx # opentelemetry-sdk -opentelemetry-util-http==0.59b0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +opentelemetry-util-http==0.64b0 \ + --hash=sha256:6e0911ac1610b735842a15be10df30369014008d8d933ffddc835f3be8dc9a29 # via # opentelemetry-instrumentation-asgi # opentelemetry-instrumentation-fastapi # opentelemetry-instrumentation-httpx -packaging==25.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +packaging==26.2 \ + --hash=sha256:7c418e01ce14b2bfd2cbf95e6d0a2b1278b711cd84527100f02b0966f08cc4a5 # via # huggingface-hub # marshmallow @@ -270,150 +473,287 @@ packaging==25.0 # thinc # transformers # weasel -phonenumbers==9.0.10 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +phonenumbers==9.0.34 ; python_full_version < '3.13' \ + --hash=sha256:b7e92cfd3baf0039ab8552674db7423f82b4818bba97c932a1a99094ea2b12d5 # via presidio-analyzer -pillow==11.3.0 - # via - # fastembed - # sentence-transformers -preshed==3.0.10 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +pillow==12.3.0 ; python_full_version < '3.13' \ + --hash=sha256:292ad662c4a21daa5c557816bd36870c036fcb32f1863a474725c9a48db317f2 \ + --hash=sha256:4a904ef7f3765fc818c3a483529ff04147e97cc0390f9eec5edd30cae497fafe \ + --hash=sha256:5762ef56cdceff2319ac80ed92150106a0bf51ec2eea15226f44c9d983e7b916 \ + --hash=sha256:65a30ac6a91ac6d2d08c73441c8fe69653d0d818312b18d1dc86ee8932529cec \ + --hash=sha256:787b6ebb6a267bca4040c40296487e0428b7ba8fe3024b2863626ba09d566fc9 \ + --hash=sha256:bb4f92e67999c0820fd8a9f959f0dce3b0b0dcb8144d47aa7a1432183e7c4c98 \ + --hash=sha256:c7d40c6deb9bf0b847d4f027d55e2362d55fbee8876dbf728af0e2efe345128a \ + --hash=sha256:e803d1800d5fb6ed2fbbb8d1aa4a42f1f9080ed98b6f929646b920330031f6b1 + # via fastembed + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +preshed==3.0.13 ; python_full_version < '3.14' \ + --hash=sha256:1011fa98d050f429acaa54ae5d08b279dba95bfe3e6d2d67d622280b7e88ed9d \ + --hash=sha256:3c2ecc4dc47b2ef27b8f7591293bc898f1c87f9f91d840386112fb676b98f60e \ + --hash=sha256:9451195da0682c8690e859939094cecd1b199baec2c8abfae74c2214af8fa274 \ + --hash=sha256:c1b826f63f68121b8057c31e0bc902c603b0ab8f2a8a81f6d93625434109a9af # via # spacy # thinc -presidio-analyzer==2.2.359 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +presidio-analyzer==2.2.362 ; python_full_version < '3.13' \ + --hash=sha256:13af12e1f67866d02e6d15c2392d502dccd658522808e0cb868e12682c8857d9 # via nemoguardrails (pyproject.toml) -presidio-anonymizer==2.2.359 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +presidio-anonymizer==2.2.363 ; python_full_version < '3.13' \ + --hash=sha256:a4e5cd3058b723a4a1b6ad6249b535ba8be870d0a7b960d76ee31108dd6502c3 # via nemoguardrails (pyproject.toml) -prompt-toolkit==3.0.52 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +prompt-toolkit==3.0.52 \ + --hash=sha256:c2497d64eecaddbe2a7f3a7a69ae1d5e5a5e48caf6377662395b162224a915fc # via nemoguardrails (pyproject.toml) -propcache==0.3.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +propcache==0.5.2 \ + --hash=sha256:37db9ae1c467dce775f463680d1bf110ec3237f08f5bee36fd60c399344fa617 \ + --hash=sha256:54bc48bc3831e3961366b03767df820e5e2b94a4713cbf1df90227964217e66d \ + --hash=sha256:b2159ad520c71e28c53e8a62ec22129d09367655a79316af1540cced34b4de0f \ + --hash=sha256:c3d7df883bd7a7d3ca589088e92943521cc11a0bea9c73c2f49f862ac60da337 # via # aiohttp # yarl -protobuf==6.32.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +protobuf==7.35.1 \ + --hash=sha256:181e87b451839ee061ccc0c6b9cea83c88273050eb1ca5cb87251579e107dc5e \ + --hash=sha256:233da0f55155b17cc05d238787d6c6f8939e60d93e9c79d43a7689221f84eb81 \ + --hash=sha256:3f48a5fd3c23358a954af4bff076d0e2db0fc05c9d2a72ea0b48d60bbb25171d \ + --hash=sha256:bf9625efa333ab63c73967ea7241ccf75ee1f123055892d16f4c5c68fc7d25c7 # via # nemoguardrails (pyproject.toml) # googleapis-common-protos # onnxruntime # opentelemetry-proto -py-rust-stemmers==0.1.5 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +py-rust-stemmers==0.1.8 \ + --hash=sha256:3212d1be54c174a9bb7bb39e24846254acc6ab1fa4949284f223d85d3cded3e4 \ + --hash=sha256:8b53c547bda48c6959cdfc5a924ac0ec14a6fa79299306d0f084c3e5642109d0 \ + --hash=sha256:b2cf7a1180e115f8c04134875a6bc32f68a8f549b44c8b5955b6ac13e9d3fe49 \ + --hash=sha256:ce6de8b75d55b28b7fa0693dac65e63775d5b3289f35244c36cf39723d9ba8c1 # via fastembed -pycparser==2.22 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +pycparser==3.0 ; python_full_version < '3.13' and implementation_name != 'PyPy' and platform_python_implementation != 'PyPy' \ + --hash=sha256:c2e6198bf8dc97ba19b5f42d9d0e08d5842ffb775e0e208b150080dcf423396e # via cffi -pydantic==2.11.9 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +pydantic==2.13.4 \ + --hash=sha256:1a3d4d45204182df30dbd68890bdf1becec13f689075099866dd4bdf06b04371 # via # nemoguardrails (pyproject.toml) - # confection # fastapi # openai + # presidio-analyzer # spacy # thinc # weasel -pydantic-core==2.33.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +pydantic-core==2.46.4 \ + --hash=sha256:284014bde1fe354f45589df5638b38bc1bee9634a8b0bc9a7364f820c7c915b9 \ + --hash=sha256:2be22610c7312f3232c539a9872c1c7217f0167093e9f7ff38ee79a072528f69 \ + --hash=sha256:38235509e8f37596cc39453972c1a9b200287d92a98eb2a7c92d9708a98eec49 \ + --hash=sha256:bbc9884932978a8f52c59aac4a0a273c8e514d303fd040c38b0436b37e57ed33 # via pydantic -pygments==2.19.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +pygments==2.20.0 \ + --hash=sha256:14c06510dc5a2dbf9d83a85463d229907d0456e167a3752d361e6cd1cbfd1152 # via rich -pyyaml==6.0.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +pyyaml==6.0.3 \ + --hash=sha256:2bd6846091e45ed85468748b300a374d5b3724bf49b59a2773d15b72fd25cf09 \ + --hash=sha256:2e1123ff9917c251043614409b1660a891837de28b9d2c1210dbca78c52822e5 \ + --hash=sha256:726ba29089425e37e0a54208804a621cbeed0cba6c1156d817226bc6cdc26d4a \ + --hash=sha256:d76fd28238122285a5a5790b3fba7ccfce6006e19eb2c8fbd6700d723c3f674b # via # nemoguardrails (pyproject.toml) # huggingface-hub # presidio-analyzer # transformers -referencing==0.37.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +referencing==0.37.0 \ + --hash=sha256:b290b587a835bb688b817f9b73927f6fc273bbad723690754c815912da2bc845 # via # jsonschema # jsonschema-specifications -regex==2025.9.18 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +regex==2026.7.10 \ + --hash=sha256:08953ce98a4d4651720eb1f9eab1b6e1420e794949707fa50b99b6a8a0db74a3 \ + --hash=sha256:2137bb9688fd4e0c24b4dfba4aa53ed14516259e858840aa3fd79e3f9c144241 \ + --hash=sha256:228df7d37b129645868b12b6761f4a04fdccfa64110d5c4ec030ea40f3ece3b5 \ + --hash=sha256:7aace66aba0972be9268979cfa5364a3b5d48ae020569f395d0bbd0b762051f9 # via # nltk # presidio-analyzer # transformers -requests==2.32.5 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +requests==2.34.2 \ + --hash=sha256:ea6708de2da329a533299949db29fca0e3f7e3135068ad5171a28d07a9687631 # via # fast-langdetect # fastembed - # huggingface-hub # opentelemetry-exporter-otlp-proto-http # requests-file # robust-downloader # spacy # tldextract - # transformers - # weasel -requests-file==2.1.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +requests-file==3.0.1 ; python_full_version < '3.13' \ + --hash=sha256:ec161b0813b2050e5ceef704f0f26b1a0164a8c52b496750bd9515d8eef17de7 # via tldextract -rich==14.1.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +rich==15.0.0 \ + --hash=sha256:b78831156a60d0f5cb5d008f7f9285c48ffdbe315164c9cd396ca3b65fe8130a # via # nemoguardrails (pyproject.toml) # typer -robust-downloader==0.0.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +robust-downloader==0.0.2 \ + --hash=sha256:7959e910ff592749c356f9c54c99b5ae87daa3e8acede03398ac3cdbf28121cb # via fast-langdetect -rpds-py==2026.6.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +rpds-py==2026.6.3 \ + --hash=sha256:0d6f70f6d85d7bc4060354d68b5a8c5dfb23779a544ded172477fce6a112fae0 \ + --hash=sha256:316b43e27975b1cc162fda822f299167ee89576ef4857469d6d64ead73704327 \ + --hash=sha256:bf9210733450bc06ffa42008cae33734ebe4e69505707feedfb0518c6d83fa70 \ + --hash=sha256:cd846c9ef4996927c8af50c2fa001addd6f7ad7d9a5dbf8d169941b95f3c6130 # via # jsonschema # referencing -safetensors==0.6.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +safetensors==0.8.0 \ + --hash=sha256:23e3a3c88c19ad1a2d282a4eb04a84433aa406daeaa4e1d8f49b0123cafc9e62 \ + --hash=sha256:800d4a5cf3320f0c0b49dfb7b4ec6cfe9a5e735b33b8254a74d5a2e452dc4408 \ + --hash=sha256:ae8e482791a7348f972072ac995368904d8fe58ee62c7e410ec2b6b03cc76cab \ + --hash=sha256:b903354cbf8d3db3818b1942f9d39b0e713b5a93bd3790502412d2b01ebc217e # via transformers -scikit-learn==1.7.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +scikit-learn==1.9.0 \ + --hash=sha256:509b8c36718bb996ee7c5ea3f11a4967847d6794f23df6e736472c527169323e \ + --hash=sha256:6326a29ac3eeceb5724306cad2cfd41afac07af8ca83a8ac2a07e4063f3c71e2 \ + --hash=sha256:981a4a562bbcc91202e6c2001b059994433cc25ee0afad91f24abcc24bed4516 \ + --hash=sha256:d5a5dbfa05f48494957544feb98cb091171c403a6a862e4bcee67f128750d4f1 # via sentence-transformers -scipy==1.16.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +scipy==1.18.0 \ + --hash=sha256:15dbd1b22de5e2eb8d93eebb479e2a2f4f8399859b8caf3004ed7e0e11d4adf9 \ + --hash=sha256:68305170343635604a54b66520646c41900403aa91bf5e41f6f2973d8d751bad \ + --hash=sha256:8f2ad17ab42ed3cf1d83574ef39b5a72cd534d6a070cb9d0f634748acf0a7949 \ + --hash=sha256:db4e1e9b4ca944c34c49136e6553fe0607cdfe1ee2ada4d36037bd3c6545dcc0 # via # scikit-learn # sentence-transformers -sentence-transformers==5.1.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +sentence-transformers==5.2.0 \ + --hash=sha256:f7c0e190f00f22031351b9a1a6c166d95f79a7374ddff5bfb520303ee074f37a # via nemoguardrails (pyproject.toml) -setuptools==80.9.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +setuptools==81.0.0 \ + --hash=sha256:f6e4d2e589c5fa14b5bbda3d170eac0db8852c7fe7a357f708d172726353778e # via # spacy # thinc # torch -shellingham==1.5.4 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +shellingham==1.5.4 \ + --hash=sha256:c62d421a942ec6b2400acb0091f31f7bd860d133dfcc8e7c5a252afedba20f8f # via typer -simpleeval==1.0.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +simpleeval==1.0.7 \ + --hash=sha256:c04f6630a8ca7d652a4e7acffe931cffbcfda8b5d99c1708e47eed7c031f7dd0 # via nemoguardrails (pyproject.toml) -smart-open==7.3.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +smart-open==8.0.0 ; python_full_version < '3.14' \ + --hash=sha256:fe571f1d98d54fc4c7237c09b02bf1fcaf6aac90f50abe8fc441046ddb13f246 # via weasel -sniffio==1.3.1 - # via - # anyio - # openai -spacy==3.8.7 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +sniffio==1.3.1 \ + --hash=sha256:a9433d031973b1b14953cf89c651d1034e4a242d527a9b9302db215e722c5b9c + # via openai + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +spacy==3.8.13 ; python_full_version < '3.14' \ + --hash=sha256:6b5ef29ad85299d0fa910ff4f79e812e78c2e5979f1048c9eef4136252734406 \ + --hash=sha256:ac7fed251388b4eafbc9c3b87add7bffaabc182982cb813a5b7e0315f9fb7adc \ + --hash=sha256:cbf427fbd4535825466afdbd7c71d6ebd3af94a60d0564278be0eafaffa7eaba \ + --hash=sha256:ce209ce45b7e7a29e94284b7facd0c7219bbea56103f56c35c607aef47849f08 # via # nemoguardrails (pyproject.toml) # presidio-analyzer -spacy-legacy==3.0.12 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +spacy-legacy==3.0.12 ; python_full_version < '3.14' \ + --hash=sha256:ed57c60885ee1e8e1c445ce6782a5ac6ff934e46c1735575386eddbd7e3156b9 # via spacy -spacy-loggers==1.0.5 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +spacy-loggers==1.0.5 ; python_full_version < '3.14' \ + --hash=sha256:fcf4bcaf82a068bb8f9198b92fc8c55d21e5844b6e8a8323485275927a59a1f5 # via spacy -srsly==2.5.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +srsly==2.5.3 ; python_full_version < '3.14' \ + --hash=sha256:1f6a33b2dd8d1427720f8f26991461730cc4f0dffbb5ade50eb5c10a335d6a08 \ + --hash=sha256:bfb40d5b40e112aa5890a49040227bb03e6d1813f255c41a1471f100e4eec047 \ + --hash=sha256:ed438c0537b83b931fb3f62bb505da361fdfef77ed2629841efa74deb854c488 \ + --hash=sha256:f965387962495a3ed7d5be3885767c61357d682d61392694254da42dae7c6193 # via - # confection # spacy # thinc # weasel -starlette==0.50.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +starlette==1.3.1 \ + --hash=sha256:19acd5bfb037734bb027cb753f36379bca5f72da9b79fa7fb3ef4639b1999f6b # via # nemoguardrails (pyproject.toml) # fastapi -sympy==1.14.0 - # via - # onnxruntime - # torch -thinc==8.3.6 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +sympy==1.14.0 \ + --hash=sha256:6cf6a1e379dbba75ca560e2cbd4394144f9e7e7335ee1be872c224f004eeb172 + # via torch + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +thinc==8.3.13 ; python_full_version < '3.14' \ + --hash=sha256:006895dca2e213a187891843603f7f73c852046c1fd08e00124b83aa859c7a12 \ + --hash=sha256:dc8ff2f3b31c8984d7a3f016df64c7542a8146ef8f7ef55c1c683f3dcabff8c1 \ + --hash=sha256:f06a4cb1f7d627e1d1a4d3ebf301b45e6ac4db0beb792572560816431d8eb5a5 \ + --hash=sha256:fd0ce02dfd8f342cd08624a764aac2241618e1d6356c7d1f2d35aa444c256516 # via spacy -threadpoolctl==3.6.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +threadpoolctl==3.6.0 \ + --hash=sha256:583c55d12dfac4ba91b2d41e1a334cba51d2c5fbab1e4cd4b918cf88dbff6184 # via scikit-learn -tldextract==5.3.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +tldextract==5.3.1 ; python_full_version < '3.13' \ + --hash=sha256:30720324060fa191338fb6cfcc142d2c50ecdac3c58a18195ec3cee281715bf4 # via presidio-analyzer -tokenizers==0.22.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +tokenizers==0.22.2 \ + --hash=sha256:19a5651dc0f6d0dbcb98030c43d7da01d9e9069159fde96100105b9ae9ee1762 \ + --hash=sha256:4004617b00a81bab27af6ae5380a45e4477e0aa544715ddb6548e0f112c5ca23 \ + --hash=sha256:48eb9560e0e190853b056a9b31055989b36d1ca480f26d67873dd79e9431fbd8 \ + --hash=sha256:dfe8f5ac54094113be1d091cdcfd6f43b8b6b5d91a53e63ecefceb0c7043c8e8 # via # fastembed # transformers -torch==2.9.0 - # via + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +torch==2.11.0 \ + --hash=sha256:163f4e9c4b0343bb77d50676450aa911df677985bcc8dd7396f08bf82f150368 \ + --hash=sha256:295792d7e9bc15de90102b759af7c9f992a79e63237cbc4533a3fc22a35a341b \ + --hash=sha256:2d4bdff625895d89ef136b804824b3a1830aea24088968cf8a952bf99baf7196 \ + --hash=sha256:4a952ae1aac7c6e29887b95e85bf42a684d26b1cb15454eb0dfb2fdc0661ec03 \ + --hash=sha256:511b340c8a5b380ce2ea5a2b7facb288dd86fe96f7bd8135013b235123dce68f \ + --hash=sha256:6b40f508c63fd697a5db30b500f672546a80b90245734c952b7e299a95fa82f3 \ + --hash=sha256:8868279107548716a4fff5285592010e52a2f863527260e75e8581676b151e3e \ + --hash=sha256:92bf12ddbbc3f4ca61212f33c4dc020522a3d7c70ceecb7e56aa4f5fe1195e6c \ + --hash=sha256:a3a2b44e5026163bd71578bca9fa2bb39ac44e08d2b530e8ceb8f1737d373ca9 \ + --hash=sha256:cae92e5cb6b1441eb6e1def8dbaef7f1d719dd551d6e956fdfee0790e0975ffd \ + --hash=sha256:e2fdbbbd77a87f448677fbfc7ea1c94d987e64b0d16e8850d50b682e836b2aeb + # via + # -c constraints-aipcc.txt # nemoguardrails (pyproject.toml) # sentence-transformers -tqdm==4.67.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +tqdm==4.68.4 \ + --hash=sha256:7c284248ba07342aa594e6607f4292d976f23b11c8390f7d0aea13fc8063bad2 # via # fastembed # huggingface-hub @@ -423,15 +763,29 @@ tqdm==4.67.1 # sentence-transformers # spacy # transformers -transformers==4.57.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +transformers==5.13.1 \ + --hash=sha256:578ad82628ac5204686739b66d4dbad55a50297d8cc2001a00a40e35eab23ee3 # via sentence-transformers -typer==0.19.2 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +triton==3.6.0 ; platform_machine != 's390x' \ + --hash=sha256:1fd543ee4b888f749e186f87fb4c669894fd2f74849b820ffee3014a54e99d05 \ + --hash=sha256:669850f373cd9bd588b5a4d86c6849f16be98b3e8087130ad945082842ae631b \ + --hash=sha256:a64f6de7b2d45d0426474a980776161e626ccdcbb35e8b540686411fe204e0c9 + # via torch + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +typer==0.26.8 \ + --hash=sha256:e11064797c5ea712f3b5f3b762d3a612db240d9ce99da8d06d7ec2dbe624c07d # via # nemoguardrails (pyproject.toml) # spacy + # transformers # weasel -typing-extensions==4.15.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +typing-extensions==4.16.0 \ + --hash=sha256:78810d1eaf917205639551515696b3d972fa471eda49bc837bc44acfb648345e # via + # aiohttp # aiosignal # anyio # fastapi @@ -449,36 +803,71 @@ typing-extensions==4.15.0 # sentence-transformers # starlette # torch - # typer # typing-inspect # typing-inspection -typing-inspect==0.9.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +typing-inspect==0.9.0 \ + --hash=sha256:8c5903958b978eb4835204c8403c2ffdc1c1c9f28591793c9dcf46da7c23c665 # via dataclasses-json -typing-inspection==0.4.1 - # via pydantic -urllib3==2.5.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +typing-inspection==0.4.2 \ + --hash=sha256:85a10e16fc7005753b83d70ef286b14e193c23152775de9df8a384a397da44f0 + # via + # fastapi + # pydantic + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +urllib3==2.7.0 \ + --hash=sha256:8c0d942cee38135eb54435268fa34bceed0d0a7dff31d8aaee06c06ef8637942 # via requests -uvicorn==0.37.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +uvicorn==0.51.0 \ + --hash=sha256:e510a18c6896c39d758bd41eeddb9f736034fe2fcb19c55d0b601762e34ac193 # via nemoguardrails (pyproject.toml) -wasabi==1.1.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +wasabi==1.1.3 ; python_full_version < '3.14' \ + --hash=sha256:999983422dcbeeea83f94d1dd268f788477645e9face0deb7743b630ef5f8dbf # via # spacy # thinc # weasel -watchdog==6.0.0 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +watchdog==6.0.0 \ + --hash=sha256:aa10cfd258744f999dbc8fab566c4487ffacb777723ea068dfd8dfed3778c074 # via nemoguardrails (pyproject.toml) -wcwidth==0.2.14 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +wcwidth==0.8.2 \ + --hash=sha256:ebd629eb2ba09f9535a63cbbcd47e675d48876f52909675dc91db331cb7ff7a8 # via prompt-toolkit -weasel==0.4.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +weasel==1.0.0 ; python_full_version < '3.14' \ + --hash=sha256:31172dae6ae2e1a0d4c9ac72717900003899abb4dfb3f4d293bd703025e79be4 # via spacy -wrapt==1.17.3 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +wrapt==2.2.2 \ + --hash=sha256:698a80dd35c7080737798b222fa96624b02e33043ff92bc43b0bddb964f0d746 \ + --hash=sha256:bf894552e1d68d5a2b694271eb86bc353b48fbcd6db78b54c9e248abdd7f257e \ + --hash=sha256:f1b572d87d9d2b325525a5ea4467361345124f3b6aecdb123fe30b33eed0bbfe \ + --hash=sha256:fe22871052b38da0f29509f09fd136767bdeae3cf9e37261b977af139dbd9be2 # via # opentelemetry-instrumentation # opentelemetry-instrumentation-httpx # smart-open -yara-python==4.5.4 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +yara-python==4.5.4 \ + --hash=sha256:1946f9dfc547d47687368d1e9193f94d407a2d5d854543d1738a37499158f412 \ + --hash=sha256:63c9ddd9d7d5771d45c7066fb8854d11c0793ec32540e83bf2fef0b9ac5fb5e2 \ + --hash=sha256:db04e74c691e6146922e3faf9f58e6ca3851d11a8abcc6c7c9bf40cdcb65ba80 \ + --hash=sha256:e18c070be34a730c3d1c91166569defa85ce49255a2f565e022dcd76be3697fd # via nemoguardrails (pyproject.toml) -yarl==1.20.1 + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ +yarl==1.24.2 \ + --hash=sha256:0c25026803293aa01955606c53270f4306b4196169570198a3a29b3a054f3d86 \ + --hash=sha256:16ecb00a9b23f75686d3cdcd098105dd71f4e4ce21ffe13c181be7af349adc61 \ + --hash=sha256:31f672aadd67c499c13777c60cce25b75f1c1f3c8006fed3b2fdcbb474ae410d \ + --hash=sha256:3af19c86bfd747dd5324eda948c4e93c9fd57a47bf89f0fa9f51a019529b7081 \ + --hash=sha256:b60a3ea96299c776f65c02e3714c4a34a608fdd95831d3861ee3ab0797eff0b0 \ + --hash=sha256:c2cc773c104456911cfd309315909b4c0a90918d4883b2e9f025729a504a3e6e \ + --hash=sha256:c72aabbf544bceb3fa895376a188a90b7152efd47045b589fd358505ad8a85d4 \ + --hash=sha256:fcf4442656e2947f3a7e7d3cc85c8030a92570c133df0c9a3ab576a8be8e55fd # via aiohttp -zipp==3.23.0 - # via importlib-metadata + # from https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9-test/simple/ diff --git a/scripts/generate_model_lockfile.py b/scripts/generate_model_lockfile.py new file mode 100644 index 0000000000..045c3f4c5e --- /dev/null +++ b/scripts/generate_model_lockfile.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Generate artifacts.lock.yaml for hermetic model prefetching. + +Discovers all ML models required by NeMo Guardrails and generates a lockfile +with download URLs and checksums for the Konflux generic fetcher. + +Usage: + uv run --with pyyaml --with fastembed scripts/generate_model_lockfile.py +""" + +import hashlib +import json +import logging +import os +import sys +import urllib.request +from pathlib import Path +from typing import Any + +import yaml + +logging.basicConfig(level=logging.INFO, format="%(message)s") + +HUGGINGFACE_API = "https://huggingface.co/api/models" +HUGGINGFACE_RESOLVE = "https://huggingface.co" +NLTK_DATA_BASE = "https://raw.githubusercontent.com/nltk/nltk_data/gh-pages" + +SKIP_FILES = { + ".gitattributes", + "README.md", + "train_script.py", +} + +SKIP_EXTENSIONS = { + ".bin", # pytorch_model.bin (duplicate of safetensors) + ".h5", # tf_model.h5 + ".ot", # rust_model.ot +} + +SKIP_PREFIXES = [ + "onnx/", + "openvino/", +] + + +def hf_api_get(url: str) -> Any: + req = urllib.request.Request(url) + token = os.environ.get("HF_TOKEN") + if token: + req.add_header("Authorization", f"Bearer {token}") + with urllib.request.urlopen(req) as resp: + return json.loads(resp.read()) + + +def download_and_hash(url: str) -> str: + req = urllib.request.Request(url) + token = os.environ.get("HF_TOKEN") + if token: + req.add_header("Authorization", f"Bearer {token}") + sha = hashlib.sha256() + with urllib.request.urlopen(req) as resp: + while True: + chunk = resp.read(65536) + if not chunk: + break + sha.update(chunk) + return sha.hexdigest() + + +def flat_filename(prefix: str, org: str, repo: str, filepath: str) -> str: + safe_path = filepath.replace("/", "--") + return f"{prefix}--{org}--{repo}--{safe_path}" + + +def get_hf_model_commit(model_id: str) -> str: + info = hf_api_get(f"{HUGGINGFACE_API}/{model_id}") + return info["sha"] + + +def list_hf_files(model_id: str, path: str = "") -> list[dict]: + url = f"{HUGGINGFACE_API}/{model_id}/tree/main" + if path: + url += f"/{path}" + return hf_api_get(url) + + +def collect_hf_files( + model_id: str, + skip_files: set[str] | None = None, + skip_extensions: set[str] | None = None, + skip_prefixes: list[str] | None = None, +) -> list[dict]: + skip_files = skip_files or set() + skip_extensions = skip_extensions or set() + skip_prefixes = skip_prefixes or [] + + entries = list_hf_files(model_id) + result = [] + dirs_to_visit = [] + + for entry in entries: + if entry["type"] == "directory": + dirname = entry["path"] + if not any(dirname.startswith(p.rstrip("/")) for p in skip_prefixes): + dirs_to_visit.append(dirname) + continue + result.append(entry) + + for d in dirs_to_visit: + for entry in list_hf_files(model_id, d): + if entry["type"] == "file": + result.append(entry) + + filtered = [] + for f in result: + path = f["path"] + if path in skip_files: + continue + if any(path.endswith(ext) for ext in skip_extensions): + continue + if any(path.startswith(p) for p in skip_prefixes): + continue + filtered.append(f) + + return filtered + + +def build_hf_artifacts( + model_id: str, + prefix: str, + skip_files: set[str] | None = None, + skip_extensions: set[str] | None = None, + skip_prefixes: list[str] | None = None, +) -> tuple[str, list[dict]]: + org, repo = model_id.split("/", 1) + commit = get_hf_model_commit(model_id) + files = collect_hf_files(model_id, skip_files, skip_extensions, skip_prefixes) + + artifacts = [] + for f in files: + path = f["path"] + download_url = f"{HUGGINGFACE_RESOLVE}/{model_id}/resolve/main/{path}" + filename = flat_filename(prefix, org, repo, path) + + lfs = f.get("lfs") + if lfs: + checksum = f"sha256:{lfs['oid']}" + logging.info(f" {path} (LFS, checksum from API)") + else: + logging.info(f" {path} (downloading to compute checksum...)") + sha = download_and_hash(download_url) + checksum = f"sha256:{sha}" + + artifacts.append( + { + "download_url": download_url, + "filename": filename, + "checksum": checksum, + } + ) + + return commit, artifacts + + +def build_nltk_artifacts(resources: set[str]) -> list[dict]: + artifacts = [] + for resource in sorted(resources): + url = f"{NLTK_DATA_BASE}/packages/tokenizers/{resource}.zip" + logging.info(f" {resource} (downloading to compute checksum...)") + sha = download_and_hash(url) + artifacts.append( + { + "download_url": url, + "filename": f"nltk--{resource}.zip", + "checksum": f"sha256:{sha}", + } + ) + return artifacts + + +def get_fastembed_hf_sources(model_names: set[str]) -> dict[str, str]: + try: + from fastembed import TextEmbedding + except ImportError: + logging.warning("fastembed not available — skipping ONNX model discovery") + return {} + + mapping = {} + supported = TextEmbedding.list_supported_models() + for model_name in model_names: + for m in supported: + if m["model"] == model_name: + hf_source = m.get("sources", {}).get("hf") + if hf_source: + mapping[model_name] = hf_source + logging.info(f" FastEmbed maps {model_name} -> {hf_source}") + break + return mapping + + +def discover_models(profile: str = "opensource") -> dict[str, set[str]]: + scripts_dir = Path(__file__).parent + sys.path.insert(0, str(scripts_dir)) + from discover_required_models import ModelDiscoverer + + discoverer = ModelDiscoverer(profile) + return discoverer.discover() + + +SUPPORTED_PROFILES = {"opensource"} + + +def main(): + profile = os.environ.get("GUARDRAILS_PROFILE", "opensource") + if profile not in SUPPORTED_PROFILES: + logging.error( + f"Profile '{profile}' is not yet supported for hermetic model prefetch. " + f"Supported profiles: {', '.join(sorted(SUPPORTED_PROFILES))}" + ) + sys.exit(1) + + logging.info(f"Generating model lockfile for profile: {profile}") + + models = discover_models(profile) + + all_artifacts = [] + metadata_comments = [f"# profile: {profile}"] + + st_models = models.get("sentence_transformers", set()) + hf_models = models.get("huggingface", set()) + + logging.info("\n--- Sentence Transformers models ---") + for model_id in sorted(st_models): + if "/" not in model_id: + continue + logging.info(f"Processing {model_id}:") + commit, artifacts = build_hf_artifacts( + model_id, + prefix="hf", + skip_files=SKIP_FILES, + skip_extensions=SKIP_EXTENSIONS, + skip_prefixes=SKIP_PREFIXES, + ) + all_artifacts.extend(artifacts) + metadata_comments.append(f"# {model_id} commit: {commit}") + + logging.info("\n--- FastEmbed ONNX models ---") + fastembed_mapping = get_fastembed_hf_sources(st_models) + for original_name, onnx_repo in sorted(fastembed_mapping.items()): + logging.info(f"Processing {onnx_repo} (ONNX for {original_name}):") + commit, artifacts = build_hf_artifacts( + onnx_repo, + prefix="hf", + skip_files={".gitattributes", "README.md"}, + ) + all_artifacts.extend(artifacts) + metadata_comments.append(f"# {onnx_repo} commit: {commit}") + + hf_only = hf_models - st_models + if hf_only: + logging.info("\n--- HuggingFace-only models ---") + for model_id in sorted(hf_only): + if "/" not in model_id: + logging.info(f" Skipping {model_id} (no org/repo format)") + continue + logging.info(f"Processing {model_id}:") + commit, artifacts = build_hf_artifacts( + model_id, + prefix="hf", + skip_files=SKIP_FILES, + ) + all_artifacts.extend(artifacts) + metadata_comments.append(f"# {model_id} commit: {commit}") + + nltk_resources = models.get("nltk", set()) + if nltk_resources: + logging.info("\n--- NLTK data ---") + nltk_artifacts = build_nltk_artifacts(nltk_resources) + all_artifacts.extend(nltk_artifacts) + + lockfile = { + "metadata": {"version": "1.0"}, + "artifacts": all_artifacts, + } + + output_path = Path("artifacts.lock.yaml") + header_lines = [ + "# Auto-generated by scripts/generate_model_lockfile.py", + "# Re-run to update: uv run --with pyyaml --with fastembed scripts/generate_model_lockfile.py", + "", + ] + header_lines.extend(metadata_comments) + if metadata_comments: + header_lines.append("") + + with open(output_path, "w") as f: + f.write("\n".join(header_lines) + "\n") + yaml.dump(lockfile, f, default_flow_style=False, sort_keys=False) + + logging.info(f"\nWrote {len(all_artifacts)} artifacts to {output_path}") + + +if __name__ == "__main__": + main() diff --git a/scripts/setup_prefetched_models.sh b/scripts/setup_prefetched_models.sh new file mode 100755 index 0000000000..357b70a6b1 --- /dev/null +++ b/scripts/setup_prefetched_models.sh @@ -0,0 +1,115 @@ +#!/bin/bash +set -euo pipefail + +# Reconstruct ML model cache directories from prefetched generic artifacts. +# Called during the Docker build in place of pre_download_required_models.py. +# +# Usage: GUARDRAILS_PROFILE=opensource ./scripts/setup_prefetched_models.sh +# +# Expects: +# - GUARDRAILS_PROFILE env var (default: opensource) +# - Prefetched files at /cachi2/output/deps/generic/hf--* and nltk--* +# - Environment variables: HF_HOME, SENTENCE_TRANSFORMERS_HOME, FASTEMBED_CACHE_PATH, NLTK_DATA + +PROFILE="${GUARDRAILS_PROFILE:-opensource}" +GENERIC_DIR="${CACHI2_GENERIC_DIR:-/cachi2/output/deps/generic}" + +setup_hf_model() { + local model_id="$1" # e.g. sentence-transformers/all-MiniLM-L6-v2 + local cache_base="$2" # e.g. /app/.cache/huggingface + local commit="$3" # git commit hash + local use_hub="${4:-false}" # true for HF_HOME (uses hub/ prefix), false for library caches + + local org="${model_id%%/*}" + local repo="${model_id#*/}" + local cache_name="models--${org}--${repo}" + local cache_root="${cache_base}" + if [ "${use_hub}" = "true" ]; then + cache_root="${cache_base}/hub" + fi + local snapshot_dir="${cache_root}/${cache_name}/snapshots/${commit}" + local refs_dir="${cache_root}/${cache_name}/refs" + + mkdir -p "${snapshot_dir}" "${refs_dir}" + echo -n "${commit}" > "${refs_dir}/main" + + local prefix="hf--${org}--${repo}--" + for src in "${GENERIC_DIR}/${prefix}"*; do + [ -f "$src" ] || continue + local basename="${src##*/}" + # Strip the prefix to get the original filename, converting -- back to / + local relpath="${basename#"${prefix}"}" + relpath="${relpath//--//}" + + local dest_dir="${snapshot_dir}/$(dirname "${relpath}")" + mkdir -p "${dest_dir}" + cp "$src" "${dest_dir}/$(basename "${relpath}")" + done + + echo "Installed HF model ${model_id} into ${cache_base}" +} + +setup_nltk_data() { + local resource="$1" # e.g. punkt + local src="${GENERIC_DIR}/nltk--${resource}.zip" + + if [ ! -f "$src" ]; then + echo "Warning: NLTK resource ${resource} not found at ${src}" + return + fi + + local dest_dir="${NLTK_DATA}/tokenizers" + mkdir -p "${dest_dir}" + python3 -c "import zipfile; zipfile.ZipFile('${src}').extractall('${dest_dir}/')" + echo "Installed NLTK resource ${resource}" +} + +# Read commit hashes from artifacts.lock.yaml header comments. +# Format: "# org/repo commit: " +get_commit_from_lockfile() { + local model_id="$1" + local lockfile="${2:-/app/artifacts.lock.yaml}" + grep "^# ${model_id} commit:" "${lockfile}" 2>/dev/null | sed 's/.*commit: //' +} + +setup_opensource() { + local lockfile="/app/artifacts.lock.yaml" + + # Sentence Transformers model -> HF_HOME and SENTENCE_TRANSFORMERS_HOME + local st_commit + st_commit=$(get_commit_from_lockfile "sentence-transformers/all-MiniLM-L6-v2" "${lockfile}") + if [ -n "${st_commit}" ]; then + setup_hf_model "sentence-transformers/all-MiniLM-L6-v2" "${HF_HOME}" "${st_commit}" true + # sentence_transformers passes cache_dir directly (no hub/ prefix) + setup_hf_model "sentence-transformers/all-MiniLM-L6-v2" "${SENTENCE_TRANSFORMERS_HOME}" "${st_commit}" false + fi + + # FastEmbed ONNX model -> FASTEMBED_CACHE_PATH + local fe_commit + fe_commit=$(get_commit_from_lockfile "qdrant/all-MiniLM-L6-v2-onnx" "${lockfile}") + if [ -n "${fe_commit}" ]; then + setup_hf_model "qdrant/all-MiniLM-L6-v2-onnx" "${FASTEMBED_CACHE_PATH}" "${fe_commit}" false + fi + + # NLTK data + setup_nltk_data "punkt" +} + +main() { + echo "Setting up prefetched models for profile: ${PROFILE}" + + case "${PROFILE}" in + opensource) + setup_opensource + ;; + *) + echo "ERROR: Profile '${PROFILE}' is not yet supported for hermetic model setup." + echo "Supported profiles: opensource" + exit 1 + ;; + esac + + echo "Model setup complete" +} + +main "$@"