Try detect LM Studio in status check Fixes #2849
| @@ -137,6 +137,7 @@ router.post('/status', jsonParser, async function (request, response) { | ||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | const modelsReply = await fetch(url, args); |
| 140 | + const isPossiblyLmStudio = modelsReply.headers.get('x-powered-by') === 'Express'; | |
| 140 | 141 | |
| 141 | 142 | if (!modelsReply.ok) { |
| 142 | 143 | console.log('Models endpoint is offline.'); |
| @@ -174,7 +175,7 @@ router.post('/status', jsonParser, async function (request, response) { | ||
| 174 | 175 | // Set result to the first model ID |
| 175 | 176 | result = modelIds[0] || 'Valid'; |
| 176 | 177 | |
| 177 | 178 | if (apiType === TEXTGEN_TYPES.OOBA && !isPossiblyLmStudio) { |
| 178 | 179 | try { |
| 179 | 180 | const modelInfoUrl = baseUrl + '/v1/internal/model/info'; |
| 180 | 181 | const modelInfoReply = await fetch(modelInfoUrl, args); |