[GH-ISSUE #779] API stream false doesn't seem to work #46884

Closed
opened 2026-04-28 01:33:02 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @jgunzelman88 on GitHub (Oct 13, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/779

I am trying to use the rest api and I am posting the following

{ "model": "mistral", "prompt":"tell me a fancy joke", "stream": false }

And I get the following response. Doesn't stream false disable partial responses? I am using the 0.1.2 image from docker hub.

{ "model": "mistral", "created_at": "2023-10-13T15:23:36.463078827Z", "response": "\n", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:36.63979395Z", "response": "Why", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:36.818460356Z", "response": " did", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:36.995619125Z", "response": " the", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.168520786Z", "response": " tom", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.33740151Z", "response": "ato", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.512231358Z", "response": " turn", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.682994442Z", "response": " red", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.855768719Z", "response": "?", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.03340991Z", "response": "\n", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.204668394Z", "response": "\n", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.380301847Z", "response": "Because", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.558119569Z", "response": " it", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.737065138Z", "response": " saw", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.910857111Z", "response": " the", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.082354702Z", "response": " salad", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.257027457Z", "response": " dressing", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.434786137Z", "response": "!", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.60969303Z", "done": true, "context": [ 733, 16289, 28793, 1912, 528, 264, 19602, 13015, 733, 28748, 16289, 28793, 13, 13, 7638, 863, 272, 6679, 1827, 1527, 2760, 28804, 13, 13, 17098, 378, 2672, 272, 25256, 21993, 28808 ], "total_duration": 3323485053, "load_duration": 792966, "prompt_eval_count": 1, "eval_count": 19, "eval_duration": 3300021000 }

Originally created by @jgunzelman88 on GitHub (Oct 13, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/779 I am trying to use the rest api and I am posting the following `{ "model": "mistral", "prompt":"tell me a fancy joke", "stream": false }` And I get the following response. Doesn't stream false disable partial responses? I am using the [0.1.2](https://hub.docker.com/layers/ollama/ollama/0.1.2/images/sha256-465621f7398c2a51ea1b4a377f70e97905c3605e7ee93cde7a39aa7d7eaec26f?context=explore) image from docker hub. `{ "model": "mistral", "created_at": "2023-10-13T15:23:36.463078827Z", "response": "\n", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:36.63979395Z", "response": "Why", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:36.818460356Z", "response": " did", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:36.995619125Z", "response": " the", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.168520786Z", "response": " tom", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.33740151Z", "response": "ato", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.512231358Z", "response": " turn", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.682994442Z", "response": " red", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:37.855768719Z", "response": "?", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.03340991Z", "response": "\n", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.204668394Z", "response": "\n", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.380301847Z", "response": "Because", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.558119569Z", "response": " it", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.737065138Z", "response": " saw", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:38.910857111Z", "response": " the", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.082354702Z", "response": " salad", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.257027457Z", "response": " dressing", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.434786137Z", "response": "!", "done": false }{ "model": "mistral", "created_at": "2023-10-13T15:23:39.60969303Z", "done": true, "context": [ 733, 16289, 28793, 1912, 528, 264, 19602, 13015, 733, 28748, 16289, 28793, 13, 13, 7638, 863, 272, 6679, 1827, 1527, 2760, 28804, 13, 13, 17098, 378, 2672, 272, 25256, 21993, 28808 ], "total_duration": 3323485053, "load_duration": 792966, "prompt_eval_count": 1, "eval_count": 19, "eval_duration": 3300021000 }`
Author
Owner

@jmorganca commented on GitHub (Oct 13, 2023):

Hi @jgunzelman88 . Which platform are you on? It may be the case that you're not hitting the API endpoint of the container

Here's what I see from the latest Docker image (ollama/ollama:0.1.2):

curl -X POST http://localhost:11434/api/generate -d '{"model": "llama2", "stream": false, "prompt": "hello"}'

{"model":"llama2","created_at":"2023-10-13T16:10:13.407234042Z","response":" Hello! It's nice to meet you. Is there something I can help you with or would you like to chat?" ...}
<!-- gh-comment-id:1761819132 --> @jmorganca commented on GitHub (Oct 13, 2023): Hi @jgunzelman88 . Which platform are you on? It may be the case that you're not hitting the API endpoint of the container Here's what I see from the latest Docker image (`ollama/ollama:0.1.2`): ``` curl -X POST http://localhost:11434/api/generate -d '{"model": "llama2", "stream": false, "prompt": "hello"}' {"model":"llama2","created_at":"2023-10-13T16:10:13.407234042Z","response":" Hello! It's nice to meet you. Is there something I can help you with or would you like to chat?" ...} ```
Author
Owner

@jmorganca commented on GitHub (Oct 13, 2023):

I'll close this for now since I think there's a version mismatch, but please do re-open it if the issue keeps happening 😊

<!-- gh-comment-id:1761819420 --> @jmorganca commented on GitHub (Oct 13, 2023): I'll close this for now since I think there's a version mismatch, but please do re-open it if the issue keeps happening 😊
Author
Owner

@ZechangSun commented on GitHub (Oct 15, 2023):

Hi @jmorganca I faced the same problem on Mac. Should I install from the source if I want to get the latest Ollama?

<!-- gh-comment-id:1763337944 --> @ZechangSun commented on GitHub (Oct 15, 2023): Hi @jmorganca I faced the same problem on Mac. Should I install from the source if I want to get the latest Ollama?
Author
Owner

@chiefMarlin commented on GitHub (Oct 16, 2023):

For those that are still having this issue, this is what solved it for me

docker pull ollama/ollama:latest
<!-- gh-comment-id:1765044001 --> @chiefMarlin commented on GitHub (Oct 16, 2023): For those that are still having this issue, this is what solved it for me ```bash docker pull ollama/ollama:latest ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46884