Skip to content

Commit

Permalink
🐛 fix: Handle optional endpoints in processModelSpecs function
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila committed Jan 9, 2025
1 parent 0f95604 commit ea1a5c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/server/services/start/modelSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { logger } = require('~/config');

/**
* Sets up Model Specs from the config (`librechat.yaml`) file.
* @param {TCustomConfig['endpoints']} endpoints - The loaded custom configuration for endpoints.
* @param {TCustomConfig['endpoints']} [endpoints] - The loaded custom configuration for endpoints.
* @param {TCustomConfig['modelSpecs'] | undefined} [modelSpecs] - The loaded custom configuration for model specs.
* @returns {TCustomConfig['modelSpecs'] | undefined} The processed model specs, if any.
*/
Expand All @@ -18,7 +18,7 @@ function processModelSpecs(endpoints, _modelSpecs) {
/** @type {TCustomConfig['modelSpecs']['list']} */
const list = _modelSpecs.list;

const customEndpoints = endpoints[EModelEndpoint.custom] ?? [];
const customEndpoints = endpoints?.[EModelEndpoint.custom] ?? [];

for (const spec of list) {
if (EModelEndpoint[spec.preset.endpoint] && spec.preset.endpoint !== EModelEndpoint.custom) {
Expand Down

0 comments on commit ea1a5c8

Please sign in to comment.