-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mismatch of parameters when using OpenAI Compatible API causing alternative tokens to not be returned? #101
Comments
Additional note: it seems most models on OpenRouter actually do not return logprobs anyway, but some do, like the o4 models. However, even with these models, the logprobs are not being displayed in Mikupad. I tested the API and it does return a list top token logprobs. I have yet to test whether streaming vs full message produce different results though. |
Are you sure you're using an
You mean, using the text completion API and |
I was not aware only certain model loaders may pass through the top token information. I assumed the API would automatically provide identical functionality as the underlying llama.cpp API. I need to double check.
This is quite confusing but you are right.
I had a look at the response I get when directly I The corresponding request is like this:
I think OpenRouter may have rerouted traffic to chat completion... |
I can confirm that OpenRouter is faking text completion by using the chat API for models like gpt4o (which are available only through a chat API), and that's what is causing this issue. |
It seems when switching to Chat Completion API in the configurations, now the alternative tokens will show properly for models with top tokens support. However I am not able to click on the alternative tokens and re-generate from there. Is this a limitation of the API or fixable? |
Expected:
When using OpenAI Compatible API, you should be able to obtain top 10 alternative tokens and their probabilities as when using llama.cpp API.
Observed:
Whenever using OpenAI Compatible API (tested locally with oobabooga and also remotely with OpenRouter), top token options are never returned.
Possible reason:
Mikupad is trying to pass
logprobs: 10
in the completion requests, but as per OpenAI documentation (https://openrouter.ai/docs/requests#request-headers) and this OpenRouter example, the correct parameter name should betop_logprobs
, whereaslogprobs
is a boolean variable serving as a switch. I think maybe the problem is when using OpenAI Compatible API, this parameter is not recognised on the server side due to this mismatch.The text was updated successfully, but these errors were encountered: