[GH-ISSUE #6196] llm decode error: 500 Internal Server Error - detokenize doesn't handle unicode characters from server.cpp properly on windows #65906

Closed
opened 2026-05-03 23:07:36 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @iBog on GitHub (Aug 6, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6196

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

Happened few times when same chat log (history) was used after local model was switched.
For example chat was started with "llava:7b-v1.6" when switched to "llama3.1:latest" without clear context array (not sure with exact same llm's pair)

LOG:

time=2024-08-05T14:54:58.212+03:00 level=INFO source=server.go:623 msg="llama runner started in 2.92 seconds"
time=2024-08-05T14:54:58.214+03:00 level=INFO source=server.go:1028 msg="llm decode error: 500 Internal Server Error\n[json.exception.type_error.316] invalid UTF-8 byte at index 181: 0x6C"
[GIN] 2024/08/05 - 14:54:58 | 500 |    3.3204013s |       127.0.0.1 | POST     "/api/generate"

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.3.3

Originally created by @iBog on GitHub (Aug 6, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6196 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? Happened few times when same chat log (history) was used after local model was switched. For example chat was started with "llava:7b-v1.6" when switched to "llama3.1:latest" without clear context array (not sure with exact same llm's pair) LOG: ``` time=2024-08-05T14:54:58.212+03:00 level=INFO source=server.go:623 msg="llama runner started in 2.92 seconds" time=2024-08-05T14:54:58.214+03:00 level=INFO source=server.go:1028 msg="llm decode error: 500 Internal Server Error\n[json.exception.type_error.316] invalid UTF-8 byte at index 181: 0x6C" [GIN] 2024/08/05 - 14:54:58 | 500 | 3.3204013s | 127.0.0.1 | POST "/api/generate" ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.3.3
GiteaMirror added the bugwindows labels 2026-05-03 23:07:37 -05:00
Author
Owner

@dhiltgen commented on GitHub (Aug 9, 2024):

My suspicion is the subprocess is emitting unicode characters in a way that the json deserializer isn't expecting. This looks to be happening in Detokenize. We're switching this implementation to cgo in an upcoming release which should resolve this. #5034

<!-- gh-comment-id:2278696813 --> @dhiltgen commented on GitHub (Aug 9, 2024): My suspicion is the subprocess is emitting unicode characters in a way that the json deserializer isn't expecting. This looks to be happening in Detokenize. We're switching this implementation to cgo in an upcoming release which should resolve this. #5034
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65906