[GH-ISSUE #8553] When LLM generates empty string response, eval_duration is missing. #5520

Open
opened 2026-04-12 16:46:23 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @wch on GitHub (Jan 23, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8553

What is the issue?

I noticed that ollama sometimes produces responses where eval_duration is missing. I've seen it happen with the response is simply an empty string -- just the stop message for a streaming response.

To reproduce:

curl http://localhost:11434/api/chat -d \
  '{"model":"llama3.2:3b","options":{"temperature":0},"messages":[
    {"content":"If the user asks you to say nothing, simply respond with an empty string.","role":"system"},
    {"content":"say nothing","role":"user"}
  ]}'

This is the response I get:

{"model":"llama3.2:3b","created_at":"2025-01-23T19:17:22.121346Z","message":{"role":"assistant","content":""},"done_reason":"stop","done":true,"total_duration":141674875,"load_duration":13300000,"prompt_eval_count":43,"prompt_eval_duration":127000000,"eval_count":1}

Notice that eval_duration is missing. This causes problems with some code that we're using which expects that field to be present.

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.5.7

Originally created by @wch on GitHub (Jan 23, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8553 ### What is the issue? I noticed that ollama sometimes produces responses where `eval_duration` is missing. I've seen it happen with the response is simply an empty string -- just the stop message for a streaming response. To reproduce: ```bash curl http://localhost:11434/api/chat -d \ '{"model":"llama3.2:3b","options":{"temperature":0},"messages":[ {"content":"If the user asks you to say nothing, simply respond with an empty string.","role":"system"}, {"content":"say nothing","role":"user"} ]}' ``` This is the response I get: ```json {"model":"llama3.2:3b","created_at":"2025-01-23T19:17:22.121346Z","message":{"role":"assistant","content":""},"done_reason":"stop","done":true,"total_duration":141674875,"load_duration":13300000,"prompt_eval_count":43,"prompt_eval_duration":127000000,"eval_count":1} ``` Notice that `eval_duration` is missing. This causes problems with some code that we're using which expects that field to be present. ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.5.7
GiteaMirror added the bug label 2026-04-12 16:46:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5520