mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-02 21:03:34 +03:00
feat(editor): warn about small context windows on self-hosted AI providers
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -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."
|
||||
|
||||
+17
@@ -370,6 +370,23 @@ export default function AdminAiModelsSection() {
|
||||
</Text>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{showBaseUrl && (
|
||||
<Alert
|
||||
variant="light"
|
||||
color="blue"
|
||||
icon={
|
||||
<LocalIcon icon="info-rounded" width="1rem" height="1rem" />
|
||||
}
|
||||
>
|
||||
<Text size="xs">
|
||||
{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.",
|
||||
)}
|
||||
</Text>
|
||||
</Alert>
|
||||
)}
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user