[GH-ISSUE #1398] Bug: API - Chat docs examples are using api/generate in URL instead of api/chat #26502

Closed
opened 2026-04-22 02:48:22 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @calderonsamuel on GitHub (Dec 6, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1398

32f62fbb8e/docs/api.md (L317-L327)

32f62fbb8e/docs/api.md (L366-L384)

Originally created by @calderonsamuel on GitHub (Dec 6, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1398 https://github.com/jmorganca/ollama/blob/32f62fbb8e0b1ecb4ec8369586562abce86c8e50/docs/api.md?plain=1#L317-L327 https://github.com/jmorganca/ollama/blob/32f62fbb8e0b1ecb4ec8369586562abce86c8e50/docs/api.md?plain=1#L366-L384
Author
Owner

@jmorganca commented on GitHub (Dec 6, 2023):

Thanks for the issue and sorry about this – should be fixed now!

<!-- gh-comment-id:1843615665 --> @jmorganca commented on GitHub (Dec 6, 2023): Thanks for the issue and sorry about this – should be fixed now!
Author
Owner

@Joao-Pimenta commented on GitHub (Dec 6, 2023):

I actually get <Response [404]> when I try to use the chat API. I was using:

url = "http://127.0.0.1:11434/api/generate"
data = {
"model": "wizard",
"stream": False,
"prompt": prompt,
"options":{
"num_predict":50
}
}

And getting great results.
I was just now reading the documentation, trying to switch to a chat with history, and was still not able to make it work.
I now have:
url = "http://127.0.0.1:11434/api/chat"
data = {
"model": "wizard",
"stream": False,
"messages": chats,
"options":{
"num_predict":50
}
}
where chats is [{'role': 'user', 'content': 'Test 1'}]. And I get <Response [404]>

<!-- gh-comment-id:1843649262 --> @Joao-Pimenta commented on GitHub (Dec 6, 2023): I actually get <Response [404]> when I try to use the chat API. I was using: url = "http://127.0.0.1:11434/api/generate" data = { "model": "wizard", "stream": False, "prompt": prompt, "options":{ "num_predict":50 } } And getting great results. I was just now reading the documentation, trying to switch to a chat with history, and was still not able to make it work. I now have: url = "http://127.0.0.1:11434/api/chat" data = { "model": "wizard", "stream": False, "messages": chats, "options":{ "num_predict":50 } } where chats is [{'role': 'user', 'content': 'Test 1'}]. And I get <Response [404]>
Author
Owner

@calderonsamuel commented on GitHub (Dec 6, 2023):

I get the same when I use the docker ollama:latest image. I think we just need to wait until they sync it.

I actually get <Response [404]> when I try to use the chat API. I was using:

url = "http://127.0.0.1:11434/api/generate" data = { "model": "wizard", "stream": False, "prompt": prompt, "options":{ "num_predict":50 } }

And getting great results. I was just now reading the documentation, trying to switch to a chat with history, and was still not able to make it work. I now have: url = "http://127.0.0.1:11434/api/chat" data = { "model": "wizard", "stream": False, "messages": chats, "options":{ "num_predict":50 } } where chats is [{'role': 'user', 'content': 'Test 1'}]. And I get <Response [404]>

<!-- gh-comment-id:1843655906 --> @calderonsamuel commented on GitHub (Dec 6, 2023): I get the same when I use the docker ollama:latest image. I think we just need to wait until they sync it. > I actually get <Response [404]> when I try to use the chat API. I was using: > > url = "http://127.0.0.1:11434/api/generate" data = { "model": "wizard", "stream": False, "prompt": prompt, "options":{ "num_predict":50 } } > > And getting great results. I was just now reading the documentation, trying to switch to a chat with history, and was still not able to make it work. I now have: url = "http://127.0.0.1:11434/api/chat" data = { "model": "wizard", "stream": False, "messages": chats, "options":{ "num_predict":50 } } where chats is [{'role': 'user', 'content': 'Test 1'}]. And I get <Response [404]>
Author
Owner

@tbirand commented on GitHub (Dec 6, 2023):

I'm also getting the same 404 api error with the docker container.

<!-- gh-comment-id:1843783046 --> @tbirand commented on GitHub (Dec 6, 2023): I'm also getting the same 404 api error with the docker container.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#26502