mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🫴 refactor: Add Broader Support for GPT-OSS Naming (#9978)
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
This commit is contained in:
parent
7897801fbc
commit
7288449011
4 changed files with 25 additions and 2 deletions
|
|
@ -152,7 +152,10 @@ const tokenValues = Object.assign(
|
||||||
'ministral-8b': { prompt: 0.1, completion: 0.1 },
|
'ministral-8b': { prompt: 0.1, completion: 0.1 },
|
||||||
'ministral-3b': { prompt: 0.04, completion: 0.04 },
|
'ministral-3b': { prompt: 0.04, completion: 0.04 },
|
||||||
// GPT-OSS models
|
// GPT-OSS models
|
||||||
|
'gpt-oss': { prompt: 0.05, completion: 0.2 },
|
||||||
|
'gpt-oss:20b': { prompt: 0.05, completion: 0.2 },
|
||||||
'gpt-oss-20b': { prompt: 0.05, completion: 0.2 },
|
'gpt-oss-20b': { prompt: 0.05, completion: 0.2 },
|
||||||
|
'gpt-oss:120b': { prompt: 0.15, completion: 0.6 },
|
||||||
'gpt-oss-120b': { prompt: 0.15, completion: 0.6 },
|
'gpt-oss-120b': { prompt: 0.15, completion: 0.6 },
|
||||||
},
|
},
|
||||||
bedrockValues,
|
bedrockValues,
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,16 @@ describe('getValueKey', () => {
|
||||||
expect(getValueKey('claude-3.5-haiku-turbo')).toBe('claude-3.5-haiku');
|
expect(getValueKey('claude-3.5-haiku-turbo')).toBe('claude-3.5-haiku');
|
||||||
expect(getValueKey('claude-3.5-haiku-0125')).toBe('claude-3.5-haiku');
|
expect(getValueKey('claude-3.5-haiku-0125')).toBe('claude-3.5-haiku');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return expected value keys for "gpt-oss" models', () => {
|
||||||
|
expect(getValueKey('openai/gpt-oss-120b')).toBe('gpt-oss-120b');
|
||||||
|
expect(getValueKey('openai/gpt-oss:120b')).toBe('gpt-oss:120b');
|
||||||
|
expect(getValueKey('openai/gpt-oss-570b')).toBe('gpt-oss');
|
||||||
|
expect(getValueKey('gpt-oss-570b')).toBe('gpt-oss');
|
||||||
|
expect(getValueKey('groq/gpt-oss-1080b')).toBe('gpt-oss');
|
||||||
|
expect(getValueKey('gpt-oss-20b')).toBe('gpt-oss-20b');
|
||||||
|
expect(getValueKey('oai/gpt-oss:20b')).toBe('gpt-oss:20b');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getMultiplier', () => {
|
describe('getMultiplier', () => {
|
||||||
|
|
|
||||||
|
|
@ -396,8 +396,15 @@ describe('getModelMaxTokens', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should return correct tokens for GPT-OSS models', () => {
|
test('should return correct tokens for GPT-OSS models', () => {
|
||||||
const expected = maxTokensMap[EModelEndpoint.openAI]['gpt-oss-20b'];
|
const expected = maxTokensMap[EModelEndpoint.openAI]['gpt-oss'];
|
||||||
['gpt-oss-20b', 'gpt-oss-120b', 'openai/gpt-oss-20b', 'openai/gpt-oss-120b'].forEach((name) => {
|
[
|
||||||
|
'gpt-oss:20b',
|
||||||
|
'gpt-oss-20b',
|
||||||
|
'gpt-oss-120b',
|
||||||
|
'openai/gpt-oss-20b',
|
||||||
|
'openai/gpt-oss-120b',
|
||||||
|
'openai/gpt-oss:120b',
|
||||||
|
].forEach((name) => {
|
||||||
expect(getModelMaxTokens(name)).toBe(expected);
|
expect(getModelMaxTokens(name)).toBe(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,10 @@ const aggregateModels = {
|
||||||
// misc.
|
// misc.
|
||||||
kimi: 131000,
|
kimi: 131000,
|
||||||
// GPT-OSS
|
// GPT-OSS
|
||||||
|
'gpt-oss': 131000,
|
||||||
|
'gpt-oss:20b': 131000,
|
||||||
'gpt-oss-20b': 131000,
|
'gpt-oss-20b': 131000,
|
||||||
|
'gpt-oss:120b': 131000,
|
||||||
'gpt-oss-120b': 131000,
|
'gpt-oss-120b': 131000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue