Skip to content

Commit 351c4b9

Browse files
authored
chore: inference=remote::llama-openai-compat does not support /v1/completion (#3683)
## What does this PR do? skip completion tests for inference=remote::llama-openai-compat ## Test Plan ci
1 parent 045a0c1 commit 351c4b9

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

llama_stack/providers/remote/inference/llama_openai_compat/llama.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#
44
# This source code is licensed under the terms described in the LICENSE file in
55
# the root directory of this source tree.
6+
from typing import Any
7+
8+
from llama_stack.apis.inference.inference import OpenAICompletion
69
from llama_stack.log import get_logger
710
from llama_stack.providers.remote.inference.llama_openai_compat.config import LlamaCompatConfig
811
from llama_stack.providers.utils.inference.litellm_openai_mixin import LiteLLMOpenAIMixin
@@ -51,3 +54,28 @@ async def initialize(self):
5154

5255
async def shutdown(self):
5356
await super().shutdown()
57+
58+
async def openai_completion(
59+
self,
60+
model: str,
61+
prompt: str | list[str] | list[int] | list[list[int]],
62+
best_of: int | None = None,
63+
echo: bool | None = None,
64+
frequency_penalty: float | None = None,
65+
logit_bias: dict[str, float] | None = None,
66+
logprobs: bool | None = None,
67+
max_tokens: int | None = None,
68+
n: int | None = None,
69+
presence_penalty: float | None = None,
70+
seed: int | None = None,
71+
stop: str | list[str] | None = None,
72+
stream: bool | None = None,
73+
stream_options: dict[str, Any] | None = None,
74+
temperature: float | None = None,
75+
top_p: float | None = None,
76+
user: str | None = None,
77+
guided_choice: list[str] | None = None,
78+
prompt_logprobs: int | None = None,
79+
suffix: str | None = None,
80+
) -> OpenAICompletion:
81+
raise NotImplementedError()

tests/integration/inference/test_openai_completion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def skip_if_model_doesnt_support_openai_completion(client_with_models, model_id)
5959
# again. You can learn more about which models can be used with each operation here:
6060
# https://go.microsoft.com/fwlink/?linkid=2197993.'}}"}
6161
"remote::watsonx", # return 404 when hitting the /openai/v1 endpoint
62+
"remote::llama-openai-compat",
6263
):
6364
pytest.skip(f"Model {model_id} hosted by {provider.provider_type} doesn't support OpenAI completions.")
6465

0 commit comments

Comments
 (0)