Skip to content

server: use OpenAI compatible finish_reason#782

Merged
awni merged 1 commit into
ml-explore:mainfrom
percontation:patch-1
Jan 20, 2026
Merged

server: use OpenAI compatible finish_reason#782
awni merged 1 commit into
ml-explore:mainfrom
percontation:patch-1

Conversation

@percontation
Copy link
Copy Markdown
Contributor

@percontation percontation commented Jan 20, 2026

finish_reason should be "tool_calls" rather than "tool_call", as per https://platform.openai.com/docs/api-reference/chat/object#chat-object-choices-finish_reason

I ran into this trying to swap in mlx_lm.server as a OpenAIProvider backend for pydantic-ai. It complains about "tool_call", but seems happy about this patch.

Copy link
Copy Markdown
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@awni awni merged commit 8c08a46 into ml-explore:main Jan 20, 2026
2 checks passed
@percontation percontation deleted the patch-1 branch January 22, 2026 11:34
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