From 88170a6b12bdbb0a3c4bf83730dea21ffe952d45 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Wed, 2 Sep 2026 10:35:55 +0100 Subject: [PATCH] feat(editor): warn about small context windows on self-hosted AI providers --- .../public/locales/en-GB/translation.toml | 1 + .../public/locales/en-US/translation.toml | 1 + .../configSections/AdminAiModelsSection.tsx | 17 +++++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/frontend/editor/public/locales/en-GB/translation.toml b/frontend/editor/public/locales/en-GB/translation.toml index d2b2aa38e3..71510f202a 100644 --- a/frontend/editor/public/locales/en-GB/translation.toml +++ b/frontend/editor/public/locales/en-GB/translation.toml @@ -818,6 +818,7 @@ openai = "OpenAI API key" setPlaceholder = "Saved - leave blank to keep the current key" [admin.settings.ai.models.baseUrl] +contextWindow = "Check the model's context window. The engine sends prompts of several thousand tokens and a window below 16,384 will silently truncate them - the oldest part of the prompt is dropped, so the model answers without having seen the request. Ollama defaults to 4,096 and divides that between parallel requests; raise it with OLLAMA_CONTEXT_LENGTH on the server." description = "Base URL of the OpenAI-compatible / Ollama endpoint, e.g. http://ollama:11434/v1." label = "Provider base URL" warning = "The base URL must point at a trusted internal endpoint. The engine will make server-side requests to it, so an untrusted value is SSRF-sensitive." diff --git a/frontend/editor/public/locales/en-US/translation.toml b/frontend/editor/public/locales/en-US/translation.toml index 681bca4dd8..8a724a2a48 100644 --- a/frontend/editor/public/locales/en-US/translation.toml +++ b/frontend/editor/public/locales/en-US/translation.toml @@ -818,6 +818,7 @@ openai = "OpenAI API key" setPlaceholder = "Saved - leave blank to keep the current key" [admin.settings.ai.models.baseUrl] +contextWindow = "Check the model's context window. The engine sends prompts of several thousand tokens and a window below 16,384 will silently truncate them - the oldest part of the prompt is dropped, so the model answers without having seen the request. Ollama defaults to 4,096 and divides that between parallel requests; raise it with OLLAMA_CONTEXT_LENGTH on the server." description = "Base URL of the OpenAI-compatible / Ollama endpoint, e.g. http://ollama:11434/v1." label = "Provider base URL" warning = "The base URL must point at a trusted internal endpoint. The engine will make server-side requests to it, so an untrusted value is SSRF-sensitive." diff --git a/frontend/editor/src/proprietary/components/shared/config/configSections/AdminAiModelsSection.tsx b/frontend/editor/src/proprietary/components/shared/config/configSections/AdminAiModelsSection.tsx index acba1c9571..ce30b1df82 100644 --- a/frontend/editor/src/proprietary/components/shared/config/configSections/AdminAiModelsSection.tsx +++ b/frontend/editor/src/proprietary/components/shared/config/configSections/AdminAiModelsSection.tsx @@ -370,6 +370,23 @@ export default function AdminAiModelsSection() { )} + + {showBaseUrl && ( + + } + > + + {t( + "admin.settings.ai.models.baseUrl.contextWindow", + "Check the model's context window. The engine sends prompts of several thousand tokens and a window below 16,384 will silently truncate them - the oldest part of the prompt is dropped, so the model answers without having seen the request. Ollama defaults to 4,096 and divides that between parallel requests; raise it with OLLAMA_CONTEXT_LENGTH on the server.", + )} + + + )}