Ollama /v1/systemone errors: 400, 404, 413 explained
curl to /v1/systemone returns 400, 404 or 413 instead of answers
错误信息
{"error": "request body must not exceed 64 KiB without images"}| 如果你看到 | 原因是 | 前往 |
|---|---|---|
| 404 on every request, even with a correct model name — or a 404 that names the model | Ollama is older than 0.35 (or an old server is still running), or the model was never pulled or its tag is misspelled | Fix 1, then Fix 2 |
400 with a chat model, a :cloud tag or an MLX model | That model isn't a local System One model | Fix 3: use a System One model |
| 400 after adding more options or questions, or on long input only | A limit: 1–64 questions and 2–26 options, or the rendered prompt doesn't fit the loaded context | Fix 4 or Fix 5 |
| 400 from PowerShell only; the same JSON works in bash | ConvertTo-Json depth, or curl being an alias for Invoke-WebRequest | Fix 6: PowerShell builds a different JSON |
| 413 | The request body is over 64 KiB (or over 32 MiB when it carries images) | Fix 7: keep the body under 64 KiB |
| Works in curl, fails from a web page | CORS: the page’s origin is not allowed | Fix 8: allow your page’s origin |
何时出现
Ollama's decision-model endpoint, POST /v1/systemone, arrived in Ollama 0.35. It is strict by design: it never truncates your input, never guesses at a malformed schema and never falls back to a chat model. That strictness means most failures come back as a clear HTTP status — if you know what each one means. Only the size limit has a documented error body; everything else is a status code plus a JSON error field whose wording can change between releases, so read the status first: 400 is an invalid request, an unsupported model or a prompt that is too long; 404 is a model that isn't pulled or an endpoint that doesn't exist; 413 is a body over 64 KiB; 500 is a model that failed to load, render or score.
- Following a tutorial written for TypeSafe's hosted Jev and pointing it at localhost.
- After upgrading Ollama on Windows or macOS while the old server kept running in the tray.
- Moving from a short test string to real documents — contracts, email threads, logs.
- Building the request in PowerShell instead of pasting JSON into curl.
- Trying a chat model you already have (
llama3,qwen3) instead of a decision model.
实际原因
A decision model doesn't generate an answer; the runner scores each allowed option against the full prompt. For that to work, Ollama needs three things to be exactly right: a model whose weights were trained for this scoring (today nimble, tev1, tev1:0.8b, clef and clef-flash), a schema it can render into a prompt, and a prompt that fits in the model's loaded context window with two token positions spare for the scoring itself. Each question is rendered and scored separately against the whole state, so a long state is paid for once per question. Ollama checks all of this before loading anything and refuses with 400 rather than silently cutting your text — a truncated contract would give you a confident answer about half a contract.
如何修复
- 1
Upgrade Ollama and restart the server
You need
0.35.0or later (clefandclef-flashneed0.35.1). On macOS and Windows, quit Ollama from the menu bar or system tray before installing the new version — otherwise the old server keeps answering on port 11434 and the new endpoint seems missing. On Linux, the commands below upgrade it and restart the service.ollama -v # Linux upgrade curl -fsSL https://ollama.com/install.sh | sh sudo systemctl restart ollama生效了吗?ollama -vshows 0.35.0 or later and the same request no longer returns 404. Ifollama -vwarns that the client and server versions differ, an old server is still running — quit it fully and start Ollama again. - 2
Pull the model
Model names must match exactly —
tev1:0.8b, nottev1-0.8bortev1:0.8B.ollama pull nimble ollama list生效了吗?ollama listshows the model, and the request returnsanswers. - 3
Use a System One model
The endpoint accepts only local models trained for System One, packaged as GGUF with a scoring-capable runner. It rejects chat models (
llama3,qwen3,gemma4…), which weren't trained for this scoring; anything with a:cloudtag, because cloud models are refused on this endpoint; and MLX or Safetensors models imported on a Mac. Switch"model"tonimble,tev1,tev1:0.8b,cleforclef-flash. Ollama also lists MLX tags for Clef, but its System One reference says MLX models are not supported on/v1/systemone, so use the default tag. For open models beyond these, use the model's own server.生效了吗?The same request with"model": "tev1"returns answers. - 4
Stay inside the schema limits
The limits are: 1 to 64
questionsper request; achoicecriteriaobject with 2 to 26 keys, none blank; ascorecriteriaarray of 2 to 26 strings, lowest first; an optionalnoulcriteriawith only the keys"false"and"true"; atypeof exactlychoice,noulorscore, lowercase; and a non-emptystateandinstructions(a string, or a JSON object or array). Achoicewith 40 labels needs splitting: first route to a group, then choose within the group, in two requests — or use a runtime that supports up to 255 options (Decider, JevK5).生效了吗?Remove questions or options until the request succeeds, then add back one at a time. - 5
Shorten the state最常见的修复方法
Every question's rendered prompt must fit the loaded context with 2 tokens to spare. Nimble's must fit 8,192 tokens; Tev1's card recommends keeping inputs to roughly 2,000 tokens. First, send only the part of the document the question is about — extract the relevant section in code, which also improves accuracy because irrelevant detail distracts decision models. Second, split one long request into several with shorter states. Third, check
usage.input_tokenson a request that works: it is the total across all questions, so divide by your question count to see the size of each prompt.生效了吗?The request succeeds andusage.input_tokens÷ the number of questions is comfortably under the model’s limit.检查哪些模型适配你的硬件check that the decision model fits, then build a valid request打开显存检查器 → - 6
PowerShell builds a different JSON than you think
Two traps. First, in Windows PowerShell 5.1,
curlis an alias forInvoke-WebRequest, which doesn't understand curl's flags — callcurl.exeexplicitly. Second,ConvertTo-Jsonstops at a depth of 2 by default and turns anything deeper into a type name. Yourcriteriaobject sits three levels below the root, so it is silently replaced; PowerShell 7 at least warns that the resulting JSON is truncated as serialization has exceeded the set depth of 2. Always pass-Depth 8, and use[ordered]@{}so options keep their order.$body | ConvertTo-Json -Depth 8 | Set-Content -Encoding utf8 request.json Get-Content request.json # inspect before sending生效了吗?request.jsonshows your fullcriteriaobjects, notSystem.Collections.Hashtable. - 7
Keep the body under 64 KiB
Large states are usually whole documents or long chat histories. Trim them in code, or split the work across requests. Remember that 64 KiB is the whole JSON body, including instructions and option descriptions. A request that carries images may be up to 32 MiB; if an image request is rejected, see Ollama /v1/systemone image errors.
生效了吗?The file is under 65,536 bytes. In PowerShell the equivalent check is(Get-Item request.json).Length.wc -c request.json - 8
Allow your web page’s origin
A browser calling
http://localhost:11434from a page on another origin gets a console message saying the request "has been blocked by CORS policy". Ollama allows extra browser origins through theOLLAMA_ORIGINSenvironment variable, set on the server, then restart Ollama. How to set server environment variables differs by OS — on Linux it goes in the systemd unit, not your shell. Allow only the origins you need, not*.生效了吗?The browser request succeeds and the console shows no CORS error.
如果以上都没用
Try the smallest model, tev1:0.8b, with a one-question request copied from the setup guide. If that works, the problem is your request, not your install. One more thing before you expose the endpoint: Ollama's API has no authentication. Binding it to 0.0.0.0 so another computer can send decision requests also lets anyone who can reach that port pull models and use your hardware. Prefer, in order, an SSH tunnel (ssh -N -L 11434:127.0.0.1:11434 user@your-box), a reverse proxy with authentication in front of Ollama, or a firewall rule restricted to one source address.
- Decision models setup with Ollama (the one-question request)
- Connection refused
- Ollama not reachable from another machine (Windows firewall)
- Headless Linux server: disk and remote access
- Report it upstream
ollama -v, your OS, GPU model and driver version- The model tag and the request body with private data removed
- The full error response
- The server log: macOS
~/.ollama/logs/server.log, Windows$env:LOCALAPPDATA\Ollama, Linuxjournalctl -u ollama --no-pager --pager-end
相关内容
常见问题
Why does Ollama refuse long input instead of truncating it?
Because a decision about half a document is worse than no decision. Ollama's spec states that input is never truncated. If the prompt doesn't fit, you get a 400 and can decide yourself what to cut.
Can I raise the context limit to fit longer documents?
The limit comes from the loaded model’s context window. The decision models in Ollama were trained on short prompts — Nimble up to 8,192 tokens — so accuracy on much longer inputs is untested even where the window allows it. Extract the relevant part instead.
My request works but the answers look random. Is that an error?
Not one Ollama can detect. Check that your option descriptions are specific, that the state contains the evidence the question needs, and that you are not asking for arithmetic or date comparisons — known weak spots for decision models. The confidence and thresholds guide shows how to measure accuracy on your own examples.
Does a 500 mean my GPU is broken?
Usually not. It means loading, rendering or scoring failed — most often the model didn’t fit in memory. Check ollama ps and the server log, and try tev1:0.8b to confirm the endpoint itself works.