[GH-ISSUE #6397] Warning "Prompt does not specify that the LLM should response in JSON, but JSON format is expected." #4019

Closed
opened 2026-04-12 14:53:35 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @itinance on GitHub (Aug 17, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6397

What is the issue?

As written in title, from where comes this message using llama 3.1?

In my prompt, it clearly states

Answer in JSON. The JSON should be a list (length 5) of dictionaries whose keys are "missing_entities" and "denser_summary".
Properly escape all special characters, especially double quotes within strings.

running sudo journalctl -u ollama --no-pager -f, I see this log message then:

Prompt does not specify that the LLM should response in JSON, but JSON format is expected.

The response is valid JSON, so that is not an issue. However, the message indicates that some pre-processing step seems to not be able to "read" the prompt catefully.

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.3.6

Originally created by @itinance on GitHub (Aug 17, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6397 ### What is the issue? As written in title, from where comes this message using llama 3.1? In my prompt, it clearly states > Answer in JSON. The JSON should be a list (length 5) of dictionaries whose keys are "missing_entities" and "denser_summary". > Properly escape all special characters, especially double quotes within strings. running `sudo journalctl -u ollama --no-pager -f`, I see this log message then: _Prompt does not specify that the LLM should response in JSON, but JSON format is expected._ The response is valid JSON, so that is not an issue. However, the message indicates that some pre-processing step seems to not be able to "read" the prompt catefully. ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.3.6
GiteaMirror added the bug label 2026-04-12 14:53:35 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 17, 2024):

Warning comes from here, which just checks the the presence of the string "json" in the prompt. Can you show the code that takes your prompt and sends it to ollama?

<!-- gh-comment-id:2294848696 --> @rick-github commented on GitHub (Aug 17, 2024): Warning comes from [here](https://github.com/ollama/ollama/blob/d29cd4c2ed104a1f6fba16a264c3cc7785a7d82f/llm/server.go#L767), which just checks the the presence of the string "json" in the prompt. Can you show the code that takes your prompt and sends it to ollama?
Author
Owner

@itinance commented on GitHub (Aug 17, 2024):

Warning comes from here, which just checks the the presence of the string "json" in the prompt. Can you show the code that takes your prompt and sends it to ollama?

@rick-github it's the same like here https://github.com/ollama/ollama/issues/6380#issuecomment-2294829833

<!-- gh-comment-id:2294852891 --> @itinance commented on GitHub (Aug 17, 2024): > Warning comes from [here](https://github.com/ollama/ollama/blob/d29cd4c2ed104a1f6fba16a264c3cc7785a7d82f/llm/server.go#L767), which just checks the the presence of the string "json" in the prompt. Can you show the code that takes your prompt and sends it to ollama? @rick-github it's the same like here https://github.com/ollama/ollama/issues/6380#issuecomment-2294829833
Author
Owner

@rick-github commented on GitHub (Aug 17, 2024):

Can you show the code that takes your prompt and sends it to FastAPI app?

<!-- gh-comment-id:2294854200 --> @rick-github commented on GitHub (Aug 17, 2024): Can you show the code that takes your prompt and sends it to FastAPI app?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4019