mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: allow Ollama to connect to external servers without model validation blocking
- Modified validation logic to only validate Ollama models when there are more than 1 model in the list - This prevents blocking users from connecting to external Ollama servers where model discovery might not work properly - Fixes issue #6589 where users could not connect to non-localhost Ollama instances
This commit is contained in:
parent
8513263a67
commit
892c3ae202
1 changed files with 13 additions and 1 deletions
|
|
@ -259,7 +259,19 @@ export function validateModelId(apiConfiguration: ProviderSettings, routerModels
|
|||
|
||||
const models = routerModels?.[provider]
|
||||
|
||||
if (models && Object.keys(models).length > 1 && !Object.keys(models).includes(modelId)) {
|
||||
// For Ollama, we should not validate against the model list if it's empty or has only one model
|
||||
// This allows users to connect to external Ollama servers where model discovery might not work
|
||||
if (provider === "ollama") {
|
||||
// Only validate if we have a substantial list of models (more than 1)
|
||||
// This prevents blocking users from using custom models on external servers
|
||||
if (models && Object.keys(models).length > 1 && !Object.keys(models).includes(modelId)) {
|
||||
return i18next.t("settings:validation.modelAvailability", { modelId })
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
// For other providers, validate if we have any models in the list
|
||||
if (models && Object.keys(models).length > 0 && !Object.keys(models).includes(modelId)) {
|
||||
return i18next.t("settings:validation.modelAvailability", { modelId })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue