Commit d43a3df
authored
Warn about small context windows on self-hosted AI providers (#7776)
Replaces #7770, which put this in `engine/.env` where an admin
configuring AI through the settings UI would never see it.
Shown only when the provider is Ollama or Custom (OpenAI-compatible),
directly under the existing SSRF warning on the base URL field - the
point where someone is actually pointing the engine at their own
endpoint.
Ollama defaults `OLLAMA_CONTEXT_LENGTH` to 4096 and divides it further
between parallel request slots, leaving roughly 2,000 tokens of usable
prompt. Measured against a local qwen3:8b: prompts up to ~2,685 tokens
arrive intact, anything larger is clipped to exactly 2,050, and the
overflow is discarded from the **start** of the prompt - which is where
the planner puts the user's request. The model then selects tools
without having seen what was asked. Nothing errors and nothing logs.
The engine cannot set this itself: it is an Ollama server option with no
equivalent on the OpenAI-compatible endpoint the engine speaks. So the
useful thing it can do is tell the person configuring it, at the moment
they configure it.
String added to en-GB and en-US only; other locales pick it up through
the usual translation flow and fall back to English until then.1 parent 84ac22a commit d43a3df
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| 821 | + | |
821 | 822 | | |
822 | 823 | | |
823 | 824 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
373 | 390 | | |
374 | 391 | | |
375 | 392 | | |
| |||
0 commit comments