Skip to content

Commit eaf686e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into multiple_sources
2 parents 7ea5244 + b9a7046 commit eaf686e

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

tests/llama_stack/core/test_llamastack_core.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import pytest
22

33
from tests.llama_stack.constants import LlamaStackProviders
4+
from llama_stack_client import LlamaStackClient
45
from utilities.constants import MinIo, QWEN_MODEL_NAME
6+
from ocp_resources.pod import Pod
7+
from ocp_resources.secret import Secret
58

69

710
@pytest.mark.parametrize(
@@ -19,7 +22,9 @@
1922
@pytest.mark.rawdeployment
2023
@pytest.mark.smoke
2124
class TestLlamaStackCore:
22-
def test_lls_server_initial_state(self, minio_pod, minio_data_connection, llama_stack_client):
25+
def test_lls_server_initial_state(
26+
self, minio_pod: Pod, minio_data_connection: Secret, llama_stack_client: LlamaStackClient
27+
) -> None:
2328
models = llama_stack_client.models.list()
2429
assert models is not None, "No models returned from LlamaStackClient"
2530

@@ -36,13 +41,17 @@ def test_lls_server_initial_state(self, minio_pod, minio_data_connection, llama_
3641
embedding_dimension = embedding_model.metadata["embedding_dimension"]
3742
assert embedding_dimension is not None, "No embedding_dimension set in embedding model"
3843

39-
def test_model_register(self, minio_pod, minio_data_connection, llama_stack_client):
44+
def test_model_register(
45+
self, minio_pod: Pod, minio_data_connection: Secret, llama_stack_client: LlamaStackClient
46+
) -> None:
4047
response = llama_stack_client.models.register(
4148
provider_id=LlamaStackProviders.Inference.VLLM_INFERENCE, model_type="llm", model_id=QWEN_MODEL_NAME
4249
)
4350
assert response
4451

45-
def test_model_list(self, minio_pod, minio_data_connection, llama_stack_client):
52+
def test_model_list(
53+
self, minio_pod: Pod, minio_data_connection: Secret, llama_stack_client: LlamaStackClient
54+
) -> None:
4655
models = llama_stack_client.models.list()
4756

4857
# We only need to check the first model;
@@ -52,7 +61,9 @@ def test_model_list(self, minio_pod, minio_data_connection, llama_stack_client):
5261
assert models[0].model_type == "llm"
5362
assert models[0].provider_id == LlamaStackProviders.Inference.VLLM_INFERENCE
5463

55-
def test_inference(self, minio_pod, minio_data_connection, llama_stack_client):
64+
def test_inference(
65+
self, minio_pod: Pod, minio_data_connection: Secret, llama_stack_client: LlamaStackClient
66+
) -> None:
5667
response = llama_stack_client.chat.completions.create(
5768
model=QWEN_MODEL_NAME,
5869
messages=[

tests/llama_stack/rag/test_rag.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,16 @@
66
from llama_stack_client.types import EmbeddingsResponse, QueryChunksResponse
77
from llama_stack_client.types.vector_io_insert_params import Chunk
88
from simple_logger.logger import get_logger
9-
10-
from utilities.constants import MinIo, QWEN_MODEL_NAME
119
from utilities.rag_utils import TurnExpectation, validate_rag_agent_responses
1210

1311
LOGGER = get_logger(name=__name__)
1412

1513

1614
@pytest.mark.parametrize(
17-
"model_namespace, minio_pod, minio_data_connection, llama_stack_server_config",
15+
"model_namespace",
1816
[
1917
pytest.param(
2018
{"name": "test-llamastack-rag"},
21-
MinIo.PodConfig.QWEN_HAP_BPIV2_MINIO_CONFIG,
22-
{"bucket": "llms"},
23-
{
24-
"vllm_url_fixture": "qwen_isvc_url",
25-
"inference_model": QWEN_MODEL_NAME,
26-
},
2719
)
2820
],
2921
indirect=True,
@@ -37,9 +29,7 @@ class TestLlamaStackRag:
3729
"""
3830

3931
@pytest.mark.smoke
40-
def test_rag_inference_embeddings(
41-
self, minio_pod, minio_data_connection, llama_stack_client: LlamaStackClient
42-
) -> None:
32+
def test_rag_inference_embeddings(self, llama_stack_client: LlamaStackClient) -> None:
4333
"""
4434
Test embedding model functionality and vector generation.
4535
@@ -61,9 +51,7 @@ def test_rag_inference_embeddings(
6151
assert isinstance(embeddings_response.embeddings[0][0], float)
6252

6353
@pytest.mark.smoke
64-
def test_rag_vector_io_ingestion_retrieval(
65-
self, minio_pod, minio_data_connection, llama_stack_client: LlamaStackClient
66-
) -> None:
54+
def test_rag_vector_io_ingestion_retrieval(self, llama_stack_client: LlamaStackClient) -> None:
6755
"""
6856
Validates basic vector_db API in llama-stack using milvus
6957
@@ -122,7 +110,7 @@ def test_rag_vector_io_ingestion_retrieval(
122110
LOGGER.warning(f"Failed to unregister vector database {vector_db_id}: {e}")
123111

124112
@pytest.mark.smoke
125-
def test_rag_simple_agent(self, minio_pod, minio_data_connection, llama_stack_client: LlamaStackClient) -> None:
113+
def test_rag_simple_agent(self, llama_stack_client: LlamaStackClient) -> None:
126114
"""
127115
Test basic agent creation and conversation capabilities.
128116
@@ -153,12 +141,15 @@ def test_rag_simple_agent(self, minio_pod, minio_data_connection, llama_stack_cl
153141
session_id=s_id,
154142
stream=False,
155143
)
156-
content = response.output_message.content
144+
content = response.output_message.content.lower()
157145
assert content is not None, "LLM response content is None"
158-
assert "answers" in content, "The LLM didn't provide the expected answer to the prompt"
146+
assert "answer" in content, "The LLM didn't provide the expected answer to the prompt"
147+
assert "translate" in content, "The LLM didn't provide the expected answer to the prompt"
148+
assert "summarize" in content, "The LLM didn't provide the expected answer to the prompt"
149+
assert "chat" in content, "The LLM didn't provide the expected answer to the prompt"
159150

160151
@pytest.mark.smoke
161-
def test_rag_build_rag_agent(self, minio_pod, minio_data_connection, llama_stack_client: LlamaStackClient) -> None:
152+
def test_rag_build_rag_agent(self, llama_stack_client: LlamaStackClient) -> None:
162153
"""
163154
Test full RAG pipeline with vector database integration and knowledge retrieval.
164155

tests/model_registry/async_job/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Job identification
22
ASYNC_UPLOAD_JOB_NAME = "model-sync-async-job"
3-
ASYNC_UPLOAD_IMAGE = "quay.io/opendatahub/model-registry-job-async-upload:v0.2.22"
3+
ASYNC_UPLOAD_IMAGE = "quay.io/opendatahub/model-registry-job-async-upload:v0.3.0"
44

55
# Job labels and annotations
66
ASYNC_JOB_LABELS = {

0 commit comments

Comments
 (0)