client
client copied to clipboard
fix: logprobs may not exist on completion response choice
What:
- [x] Bug Fix
- [ ] New Feature
Description:
Some openai server implementation miss logprobs attributes (localai).
curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{
"model": "custom",
"prompt": "Calculate 2*2"
}'
{
"created": 1713099889,
"object": "text_completion",
"id": "59fd6975-64ff-4220-8576-9b6e3a6848b5",
"model": "custom",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"text": "2 * 2 = 4"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 11,
"total_tokens": 11
}
}
Related:
When I was working with other compatible OpenAI APIs, I also discovered this issue. Should have been marked.