-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Custom LLM API timeout instead of default 10 minutes for self-hosted LLMs #4076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8d753f1
5b3964d
665f0c9
0e9c2fb
6aa0163
0bd84b7
f3237a6
70e9ab6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,28 @@ export const LMStudio = ({ apiConfiguration, setApiConfigurationField }: LMStudi | |
| className="w-full"> | ||
| <label className="block font-medium mb-1">{t("settings:providers.lmStudio.modelId")}</label> | ||
| </VSCodeTextField> | ||
| <VSCodeTextField | ||
| value={apiConfiguration?.lmStudioApiTimeout?.toString() || "10"} | ||
| onInput={handleInputChange("lmStudioApiTimeout", (e) => { | ||
| const value = parseInt((e.target as HTMLInputElement).value) | ||
| return isNaN(value) ? undefined : value | ||
| })} | ||
| type="text" | ||
| inputMode="numeric" | ||
| placeholder="10" | ||
| style={{ | ||
| borderColor: (() => { | ||
| const value = apiConfiguration?.lmStudioApiTimeout | ||
| if (!value) return "var(--vscode-input-border)" | ||
| return value > 0 ? "var(--vscode-charts-green)" : "var(--vscode-errorForeground)" | ||
| })(), | ||
| }} | ||
| className="w-full mt-4"> | ||
| <label className="block font-medium mb-1">{t("settings:providers.openAiApiTimeout")}</label> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The translation key used in this label is "settings:providers.openAiApiTimeout", which seems inconsistent with the LMStudio component (e.g., other keys use "lmStudio"). This might be a typographical error—please check if the key should be corrected to match the LMStudio naming, such as "settings:providers.lmStudioApiTimeout". This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX. |
||
| </VSCodeTextField> | ||
| <div className="text-sm text-vscode-descriptionForeground -mt-2 mb-2"> | ||
| {t("settings:providers.openAiApiTimeoutDescription")} | ||
| </div> | ||
| {lmStudioModels.length > 0 && ( | ||
| <VSCodeRadioGroup | ||
| value={ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -63,6 +63,28 @@ export const Ollama = ({ apiConfiguration, setApiConfigurationField }: OllamaPro | |||||||||
| className="w-full"> | ||||||||||
| <label className="block font-medium mb-1">{t("settings:providers.ollama.modelId")}</label> | ||||||||||
| </VSCodeTextField> | ||||||||||
| <VSCodeTextField | ||||||||||
| value={apiConfiguration?.ollamaApiTimeout?.toString() || "10"} | ||||||||||
| onInput={handleInputChange("ollamaApiTimeout", (e) => { | ||||||||||
| const value = parseInt((e.target as HTMLInputElement).value) | ||||||||||
| return isNaN(value) ? undefined : value | ||||||||||
| })} | ||||||||||
| type="text" | ||||||||||
| inputMode="numeric" | ||||||||||
| placeholder="10" | ||||||||||
| style={{ | ||||||||||
| borderColor: (() => { | ||||||||||
| const value = apiConfiguration?.ollamaApiTimeout | ||||||||||
| if (!value) return "var(--vscode-input-border)" | ||||||||||
| return value > 0 ? "var(--vscode-charts-green)" : "var(--vscode-errorForeground)" | ||||||||||
| })(), | ||||||||||
| }} | ||||||||||
| className="w-full mt-4"> | ||||||||||
| <label className="block font-medium mb-1">{t("settings:providers.openAiApiTimeout")}</label> | ||||||||||
|
||||||||||
| <label className="block font-medium mb-1">{t("settings:providers.openAiApiTimeout")}</label> | |
| <label className="block font-medium mb-1">{t("settings:providers.ollamaApiTimeout")}</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical issue: The label text key here is "settings:providers.openAiApiTimeout" but given that this configuration is for Ollama (using ollamaApiTimeout), it seems like it might be a mistake. Please verify if this should be "settings:providers.ollamaApiTimeout" instead.
| <label className="block font-medium mb-1">{t("settings:providers.openAiApiTimeout")}</label> | |
| <label className="block font-medium mb-1">{t("settings:providers.ollamaApiTimeout")}</label> |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical issue: The description text key is "settings:providers.openAiApiTimeoutDescription" which may be unintended given the context of using Ollama. Confirm whether this key should refer to Ollama rather than OpenAI.
| {t("settings:providers.openAiApiTimeoutDescription")} | |
| {t("settings:providers.ollamaApiTimeoutDescription")} |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The label translation key here is
settings:providers.openAiApiTimeout, but this is in the LMStudio component and the value comes fromlmStudioApiTimeout. Consider renaming the translation key to be consistent (e.g.,lmStudioApiTimeout).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the LMStudio, Ollama, and OpenAI-Compatible providers all use the OpenAI API library, the timeout name, description, and behavior are identical. Therefore, a common translation key is intentionally used for all three providers.