def completion_to_prompt(completion): return f"[INST] {completion} [/INST] " def messages_to_prompt(messages): messages_str = "\n".join([str(x) for x in messages]) return completion_to_prompt(messages_str) llm = Vllm(..., messages_to_prompt=messages_to_prompt, completion_to_prompt=completion_to_prompt)