ollama - 💡(How to fix) Fix bge-m3 embedding API 500 error with Chinese text + single quote apostrophe on Windows [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15987Fetched 2026-05-07 03:32:09
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Error Message

{"error":{"message":"failed to encode response: json: unsupported value: NaN","type":"api_error","param":null,"code":null}}

RAW_BUFFERClick to expand / collapse

What is the issue?

When using the bge-m3 embedding model via Ollama local API on Windows, the API returns HTTP 500 error if input text contains Chinese characters + English single quote '.

Reproduce with PowerShell

Success case (without single quote)

$body = @{ model = "bge-m3" input = @( "方正科技信息有限公司云计算 is a technology company, the customers company, involved in cloud computing" ) } | ConvertTo-Json -Depth 10

Invoke-RestMethod -Uri "http://127.0.0.1:11434/v1/embeddings" -Method Post -ContentType "application/json" -Body $body

Failed case (with single quote)

$body = @{ model = "bge-m3" input = @( "方正科技信息有限公司云计算 is a technology company, the customer's company, involved in cloud computing" ) } | ConvertTo-Json -Depth 10

Invoke-RestMethod -Uri "http://127.0.0.1:11434/v1/embeddings" -Method Post -ContentType "application/json" -Body $body

Error Message

{"error":{"message":"failed to encode response: json: unsupported value: NaN","type":"api_error","param":null,"code":null}}

Environment

  • Ollama version: 0.21.0
  • OS: Windows 11
  • Model: bge-m3
  • Client: Windows PowerShell

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING