mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-12 04:50:39 +00:00
fix: Make remote::vllm compatible with vLLM <= v0.6.3
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
parent
7f9b767277
commit
d6204b072f
1 changed files with 6 additions and 0 deletions
|
@ -270,6 +270,12 @@ class VLLMInferenceAdapter(Inference, ModelsProtocolPrivate):
|
||||||
tool_config: Optional[ToolConfig] = None,
|
tool_config: Optional[ToolConfig] = None,
|
||||||
) -> AsyncGenerator:
|
) -> AsyncGenerator:
|
||||||
model = await self.model_store.get_model(model_id)
|
model = await self.model_store.get_model(model_id)
|
||||||
|
# This is to be consistent with OpenAI API and support vLLM <= v0.6.3
|
||||||
|
# References:
|
||||||
|
# * https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice
|
||||||
|
# * https://github.com/vllm-project/vllm/pull/10000
|
||||||
|
if (tools is None or len(tools) == 0) and tool_config is not None:
|
||||||
|
tool_config.tool_choice = ToolChoice.none
|
||||||
request = ChatCompletionRequest(
|
request = ChatCompletionRequest(
|
||||||
model=model.provider_resource_id,
|
model=model.provider_resource_id,
|
||||||
messages=messages,
|
messages=messages,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue