Skip to content

[Bug]: for mistral model, After the optional system message, conversation roles must alternate user/assistant/user/assistant/#6862

Description

@yanan1116

Your current environment

vllm version: v0.5.3.post1

馃悰 Describe the bug

launch the vllm: CUDA_VISIBLE_DEVICES=7 python -m vllm.entrypoints.openai.api_server --model mistralai/Mistral-7B-Instruct-v0.3 --api-key "yyy" --port 1703

call the mistral model via python :

import openai
client = openai.OpenAI(
    api_key="yyy",
    base_url="http://localhost:1704/v1/",
)


response = client.chat.completions.create(model="mistralai/Mistral-7B-Instruct-v0.3", 
                                         messages=[{'role':'system', 'content':'you are wikipedia agent.'}, 
                                                    {'role':'user', 'content':'whta is the capital city of ontario ?'},
                                                    {'role':'user', 'content':'and tell me about its history.'}], 
                                         max_tokens=128, 
                                         temperature=0)

error message:

BadRequestError: Error code: 400 - {'object': 'error', 'message': 'After the optional system message, conversation roles must 
alternate user/assistant/user/assistant/...', 'type': 'BadRequestError', 'param': None, 'code': 400}

This error does not appear in other model series other than mistral.
Any hint ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleOver 90 days of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions