Skip to content

Commit f74a11f

Browse files
mattfiamemilio
authored andcommitted
fix: return llama stack model id from embeddings (llamastack#3525)
# What does this PR do? the openai_embeddings method on OpenAIMixin was returning the provider's model id instead of the llama stack name ## Test Plan before - ``` $ ./scripts/integration-tests.sh --stack-config server:ci-tests --setup gpt --subdirs inference --inference-mode live --pattern test_openai_embeddings_single_string ... FAILED tests/integration/inference/test_openai_embeddings.py::test_openai_embeddings_single_string[openai_client-emb=openai/text-embedding-3-small] - AssertionError: assert 'text-embedding-3-small' == 'openai/text-...dding-3-small' FAILED tests/integration/inference/test_openai_embeddings.py::test_openai_embeddings_single_string[llama_stack_client-emb=openai/text-embedding-3-small] - AssertionError: assert 'text-embedding-3-small' == 'openai/text-...dding-3-small' ========================================== 2 failed, 95 deselected, 4 warnings in 3.87s =========================================== ``` after - ``` $ ./scripts/integration-tests.sh --stack-config server:ci-tests --setup gpt --subdirs inference --inference-mode live --pattern test_openai_embeddings_single_string ... ========================================== 2 passed, 95 deselected, 4 warnings in 2.12s =========================================== ```
1 parent e817100 commit f74a11f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llama_stack/providers/utils/inference/openai_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ async def openai_embeddings(
296296

297297
return OpenAIEmbeddingsResponse(
298298
data=data,
299-
model=response.model,
299+
model=model,
300300
usage=usage,
301301
)
302302

tests/integration/suites.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Setup(BaseModel):
8787
description="OpenAI GPT models for high-quality responses and tool calling",
8888
defaults={
8989
"text_model": "openai/gpt-4o",
90-
"embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
90+
"embedding_model": "openai/text-embedding-3-small",
9191
},
9292
),
9393
"tgi": Setup(

0 commit comments

Comments
 (0)