Skip to content

Commit

Permalink
persist token window for NIM and not only on model change
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Dec 5, 2024
1 parent b2dd35f commit 4b09a06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/utils/AiProviders/nvidiaNim/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class NvidiaNimLLM {
}

/**
* Set the model token limit `NVIDIA_NIM_LLM_TOKEN_LIMIT` for the given model ID
* Set the model token limit `NVIDIA_NIM_LLM_MODEL_TOKEN_LIMIT` for the given model ID
* @param {string} modelId
* @param {string} basePath
* @returns {Promise<void>}
Expand All @@ -69,7 +69,7 @@ class NvidiaNimLLM {
if (!model.length) return;
const modelInfo = model.find((model) => model.id === modelId);
if (!modelInfo) return;
process.env.NVIDIA_NIM_LLM_TOKEN_LIMIT = Number(
process.env.NVIDIA_NIM_LLM_MODEL_TOKEN_LIMIT = Number(
modelInfo.max_model_len || 4096
);
}
Expand Down
3 changes: 3 additions & 0 deletions server/utils/helpers/updateENV.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,9 @@ function dumpENV() {
"SIMPLE_SSO_ENABLED",
// Community Hub
"COMMUNITY_HUB_BUNDLE_DOWNLOADS_ENABLED",

// Nvidia NIM Keys that are automatically managed
"NVIDIA_NIM_LLM_MODEL_TOKEN_LIMIT",
];

// Simple sanitization of each value to prevent ENV injection via newline or quote escaping.
Expand Down

0 comments on commit 4b09a06

Please sign in to comment.