filter out models that don't have a valid id (#4920)

3668e95d9513f7732d52201210601896ddadba43

Ben <44178664+cxmplex@users.noreply.github.com>

Signed
1 files changed, +3 -1Showing whitespace changes
src/endpoints/backends/chat-completions.js+3 -1
@@ -1842,7 +1842,9 @@ router.post('/status', async function (request, statusResponse) {
18421842 }
18431843
18441844 if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.CHUTES && Array.isArray(data?.data)) {
18451845 data.data = data.data.map(model => {
1846+ .filter(model => model?.id)
1847+ .map(model => {
18461848 if (model.pricing?.prompt !== undefined && model.pricing?.completion !== undefined) {
18471849 return {
18481850 ...model,