[GH-ISSUE #4030] Integrate json_repair package to overcome the slow json feature #28260

Closed
opened 2026-04-22 06:12:40 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @ArslanKAS on GitHub (Apr 29, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4030

Hi there,

Ollama is a great tool to get started with LLMs but the issue I'm facing is the JSON processing. The JSON format enforcer argument by the Ollama package just takes too long. It turns a 8 second response from LLaMa3 into a 90 second response. I don't know why it takes too long. I've come across a great package called "json_repair" that fixes broken JSON responses.

If the Ollama team can kindly integrate it so whenever the LLMs give out a broken JSON response, it can be fixed within 1 or 2 seconds. That'd be a great help in Function Calling too.

Here's the repo:
https://github.com/mangiucugna/json_repair

Originally created by @ArslanKAS on GitHub (Apr 29, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4030 Hi there, Ollama is a great tool to get started with LLMs but the issue I'm facing is the JSON processing. The JSON format enforcer argument by the Ollama package just takes too long. It turns a 8 second response from LLaMa3 into a 90 second response. I don't know why it takes too long. I've come across a great package called "json_repair" that fixes broken JSON responses. If the Ollama team can kindly integrate it so whenever the LLMs give out a broken JSON response, it can be fixed within 1 or 2 seconds. That'd be a great help in Function Calling too. Here's the repo: https://github.com/mangiucugna/json_repair
GiteaMirror added the feature request label 2026-04-22 06:12:40 -05:00
Author
Owner

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

Hi @ArslanKAS. Thanks for the issue! This is an incredibly cool project. In terms of improving the JSON output with Ollama, this is something we'd want to fix in the inference code vs post-processing if we can. However I'd be excited to let folks know about this project via an example or in our discord

<!-- gh-comment-id:2089244024 --> @jmorganca commented on GitHub (May 1, 2024): Hi @ArslanKAS. Thanks for the issue! This is an incredibly cool project. In terms of improving the JSON output with Ollama, this is something we'd want to fix in the inference code vs post-processing if we can. However I'd be excited to let folks know about this project via an example or in our discord
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#28260