From d88cccaf22d3320e9267d822d48bf82ed3af8c0a Mon Sep 17 00:00:00 2001 From: Nathan Weinberg Date: Thu, 2 Oct 2025 14:53:39 -0400 Subject: [PATCH] feat: add TrustyAI Ragas inline and remote providers Signed-off-by: Nathan Weinberg --- .github/workflows/redhat-distro-container.yml | 1 + distribution/Containerfile | 2 ++ distribution/README.md | 2 ++ distribution/build.yaml | 2 ++ distribution/run.yaml | 17 +++++++++++++++++ tests/smoke.sh | 1 + 6 files changed, 25 insertions(+) diff --git a/.github/workflows/redhat-distro-container.yml b/.github/workflows/redhat-distro-container.yml index ad8aff5af..0ab868425 100644 --- a/.github/workflows/redhat-distro-container.yml +++ b/.github/workflows/redhat-distro-container.yml @@ -31,6 +31,7 @@ jobs: runs-on: ubuntu-latest env: INFERENCE_MODEL: meta-llama/Llama-3.2-1B-Instruct + EMBEDDING_MODEL: granite-embedding-125m VLLM_URL: http://localhost:8000/v1 strategy: matrix: diff --git a/distribution/Containerfile b/distribution/Containerfile index af140be54..9187a8cc2 100644 --- a/distribution/Containerfile +++ b/distribution/Containerfile @@ -41,6 +41,8 @@ RUN pip install \ uvicorn RUN pip install \ llama_stack_provider_lmeval==0.2.4 +RUN pip install \ + llama_stack_provider_ragas[remote]==0.3.0 RUN pip install \ --extra-index-url https://test.pypi.org/simple/ llama_stack_provider_trustyai_fms==0.2.3 RUN pip install --extra-index-url https://download.pytorch.org/whl/cpu torch 'torchao>=0.12.0' torchvision diff --git a/distribution/README.md b/distribution/README.md index 490cadb52..497877cb9 100644 --- a/distribution/README.md +++ b/distribution/README.md @@ -13,7 +13,9 @@ You can see an overview of the APIs and Providers the image ships with in the ta | agents | inline::meta-reference | Yes | N/A | | datasetio | inline::localfs | Yes | N/A | | datasetio | remote::huggingface | Yes | N/A | +| eval | inline::trustyai_ragas | No | Set the `EMBEDDING_MODEL` environment variable | | eval | remote::trustyai_lmeval | Yes | N/A | +| eval | remote::trustyai_ragas | No | Set the `KUBEFLOW_LLAMA_STACK_URL` environment variable | | files | inline::localfs | Yes | N/A | | inference | inline::sentence-transformers | Yes | N/A | | inference | remote::azure | No | Set the `AZURE_API_KEY` environment variable | diff --git a/distribution/build.yaml b/distribution/build.yaml index 52a8aa6e8..1f3f05dd8 100644 --- a/distribution/build.yaml +++ b/distribution/build.yaml @@ -21,6 +21,8 @@ distribution_spec: eval: - provider_type: remote::trustyai_lmeval module: llama_stack_provider_lmeval==0.2.4 + - provider_type: inline::trustyai_ragas + module: llama_stack_provider_ragas[remote]==0.3.0 datasetio: - provider_type: remote::huggingface - provider_type: inline::localfs diff --git a/distribution/run.yaml b/distribution/run.yaml index f4ae270bc..dcda98865 100644 --- a/distribution/run.yaml +++ b/distribution/run.yaml @@ -108,6 +108,23 @@ providers: config: use_k8s: ${env.TRUSTYAI_LMEVAL_USE_K8S:=true} base_url: ${env.VLLM_URL:=} + - provider_id: ${env.EMBEDDING_MODEL:+trustyai_ragas_inline} + provider_type: inline::trustyai_ragas + module: llama_stack_provider_ragas.inline + config: + embedding_model: ${env.EMBEDDING_MODEL:=} + - provider_id: ${env.KUBEFLOW_LLAMA_STACK_URL:+trustyai_ragas_remote} + provider_type: remote::trustyai_ragas + module: llama_stack_provider_ragas.remote + config: + embedding_model: ${env.EMBEDDING_MODEL:=} + kubeflow_config: + results_s3_prefix: ${env.KUBEFLOW_RESULTS_S3_PREFIX:=} + s3_credentials_secret_name: ${env.KUBEFLOW_S3_CREDENTIALS_SECRET_NAME:=} + pipelines_endpoint: ${env.KUBEFLOW_PIPELINES_ENDPOINT:=} + namespace: ${env.KUBEFLOW_NAMESPACE:=} + llama_stack_url: ${env.KUBEFLOW_LLAMA_STACK_URL:=} + base_image: ${env.KUBEFLOW_BASE_IMAGE:=} datasetio: - provider_id: huggingface provider_type: remote::huggingface diff --git a/tests/smoke.sh b/tests/smoke.sh index d3f08706a..b261253c9 100755 --- a/tests/smoke.sh +++ b/tests/smoke.sh @@ -10,6 +10,7 @@ function start_and_wait_for_llama_stack_container { --net=host \ -p 8321:8321 \ --env INFERENCE_MODEL="$INFERENCE_MODEL" \ + --env EMBEDDING_MODEL="$EMBEDDING_MODEL" \ --env VLLM_URL="$VLLM_URL" \ --env TRUSTYAI_LMEVAL_USE_K8S=False \ --name llama-stack \