[GH-ISSUE #3845] JSON Mode OpenAI Compatibility #64420

Closed
opened 2026-05-03 17:35:27 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @developersdigest on GitHub (Apr 23, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3845

I would love to have the OpenAI compatibility for JSON mode with Ollama. Is it be possible to add in support to also allow the value of "json_object" instead of just "json".

OpenAI TS SDK when trying to use Ollama for Json mode:

Type '"json"' is not assignable to type '"text" | "json_object" | undefined'.

Thanks!

Originally created by @developersdigest on GitHub (Apr 23, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3845 I would love to have the OpenAI compatibility for JSON mode with Ollama. Is it be possible to add in support to also allow the value of "json_object" instead of just "json". OpenAI TS SDK when trying to use Ollama for Json mode: Type **'"json"' is not assignable to type '"text" | "json_object"** | undefined'. Thanks!
GiteaMirror added the feature request label 2026-05-03 17:35:27 -05:00
Author
Owner

@jmorganca commented on GitHub (May 9, 2024):

json_object should work in the OpenAI compatible API - let me know if that's not the case though! Make sure to pass injson_object as well to the TS SDK

<!-- gh-comment-id:2103504884 --> @jmorganca commented on GitHub (May 9, 2024): `json_object` should work in the OpenAI compatible API - let me know if that's not the case though! Make sure to pass in`json_object` as well to the TS SDK
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#64420