Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🐛 fix: Handle optional endpoints in processModelSpecs function

Danny Avilaea1a5c8a30b9
diff --git a/api/server/services/start/modelSpecs.js b/api/server/services/start/modelSpecs.js
index 551f42b1cf..f249a9c90b 100644
--- a/api/server/services/start/modelSpecs.js
+++ b/api/server/services/start/modelSpecs.js
@@ -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.
*/
@@ -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) {