Why Ollama is so terribly slow when I set format="json" #53

Closed
opened 2026-02-15 16:27:44 -05:00 by yindo · 1 comment
Owner

Originally created by @eliranwong on GitHub (Mar 14, 2024).

When I use format="json" the speed is extremely slow. However, I just tried llamafile with JSON output with the same prompt. What takes Ollama to response in two minutes, takes llamafile of the same model a few seconds. Please advise, if this issue is not to be sorted, obviously Ollama is not a suitable choice for developing applications that need JSON output. I really like Ollama as it is easy to be set up.

            completion = ollama.chat(
                model="mistral",
                messages=messages,
                format="json",
                options=Options(
                    temperature=0.0,
                    num_ctx=100000,
                    num_predict=-1,
                ),
Originally created by @eliranwong on GitHub (Mar 14, 2024). When I use format="json" the speed is extremely slow. However, I just tried llamafile with JSON output with the same prompt. What takes Ollama to response in two minutes, takes llamafile of the same model a few seconds. Please advise, if this issue is not to be sorted, obviously Ollama is not a suitable choice for developing applications that need JSON output. I really like Ollama as it is easy to be set up. ``` completion = ollama.chat( model="mistral", messages=messages, format="json", options=Options( temperature=0.0, num_ctx=100000, num_predict=-1, ), ```
yindo closed this issue 2026-02-15 16:27:44 -05:00
Author
Owner

@eliranwong commented on GitHub (Mar 15, 2024):

I got response at https://github.com/ollama/ollama/issues/3154

@eliranwong commented on GitHub (Mar 15, 2024): I got response at https://github.com/ollama/ollama/issues/3154
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#53