Skip to content

Conversation

windspirit95
Copy link
Contributor

Hi, this pull request is my small update/modification to add logprobs and top_logprobs arguments when creating chat completion request into llama cpp server (align with OpenAI API template).

Sample request:
POST https://host:port/v1/chat/completions
{
"model": "mixtral-8x7b",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello! Could you help me plan for 3-day trip in Hanoi?"
}
],
"logprobs": true,
"top_logprobs": 1,
"max_tokens": 1024,
"temperature": 0.0001,
"stream": false
}

Could you help me to review it? Thanks ^^

@abetlen
Copy link
Owner

abetlen commented Mar 31, 2024

Hey @windspirit95 great contribution, I just changed the default to logprobs=False to match the OpenAI api and added an example to the OpenAPI schema.

image

@abetlen abetlen merged commit aa9f1ae into abetlen:main Mar 31, 2024
@windspirit95 windspirit95 deleted the chat-completion-logprobs branch March 31, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants