📋 feat: Log Custom Config File and Add Known Model Limits to Custom Endpoint (#1657)

* refactor(custom): add all recognized models to maxTokensMap for custom endpoint

* feat(librechat.yaml): log the custom config file on initial load

* fix(OpenAIClient): pass endpointType/endpoint to `getModelMaxTokens` call
This commit is contained in:
Danny Avila 2024-01-27 08:59:04 -05:00 committed by GitHub
parent c470147ea2
commit f7f7f929a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 21 deletions

View file

@ -131,7 +131,8 @@ class OpenAIClient extends BaseClient {
const { isChatGptModel } = this;
this.isUnofficialChatGptModel =
model.startsWith('text-chat') || model.startsWith('text-davinci-002-render');
this.maxContextTokens = getModelMaxTokens(model) ?? 4095; // 1 less than maximum
this.maxContextTokens =
getModelMaxTokens(model, this.options.endpointType ?? this.options.endpoint) ?? 4095; // 1 less than maximum
if (this.shouldSummarize) {
this.maxContextTokens = Math.floor(this.maxContextTokens / 2);