🦙 fix: normalized endpoint for Ollama (#4681)

This commit is contained in:
Danny Avila 2024-11-10 14:13:14 -05:00 committed by GitHub
parent 81f29360e8
commit 3c94ff2c04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
const { CacheKeys, EModelEndpoint } = require('librechat-data-provider'); const { CacheKeys, EModelEndpoint } = require('librechat-data-provider');
const { normalizeEndpointName } = require('~/server/utils');
const loadCustomConfig = require('./loadCustomConfig'); const loadCustomConfig = require('./loadCustomConfig');
const getLogStores = require('~/cache/getLogStores'); const getLogStores = require('~/cache/getLogStores');
@ -34,7 +35,9 @@ const getCustomEndpointConfig = async (endpoint) => {
const { endpoints = {} } = customConfig; const { endpoints = {} } = customConfig;
const customEndpoints = endpoints[EModelEndpoint.custom] ?? []; const customEndpoints = endpoints[EModelEndpoint.custom] ?? [];
return customEndpoints.find((endpointConfig) => endpointConfig.name === endpoint); return customEndpoints.find(
(endpointConfig) => normalizeEndpointName(endpointConfig.name) === endpoint,
);
}; };
module.exports = { getCustomConfig, getCustomEndpointConfig }; module.exports = { getCustomConfig, getCustomEndpointConfig };