The OpenAI compatible server should match the response structure of the OpenAI API for chat completions. Unfortunately there is a discrepancy with the format of logprobs: we return the logprobs format for the completions API, rather than the chat completions API.
This PR:
updates the types to match the OpenAI API
adds a function _convert_text_completion_logprobs_to_chat which is used in the chat completion responses to convert the logprobs to the new API format
updates the documentation on running the server locally, as I discovered this was outdated when I went to test things out
Summary
The OpenAI compatible server should match the response structure of the OpenAI API for chat completions. Unfortunately there is a discrepancy with the format of logprobs: we return the logprobs format for the completions API, rather than the chat completions API.
This PR:
_convert_text_completion_logprobs_to_chat
which is used in the chat completion responses to convert the logprobs to the new API formatIssues fixed
Fixes #1787