mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
🤖 feat: Tool Calling Support for DeepSeek V3.2 + OpenRouter Reasoning (#10752)
Some checks are pending
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 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
* 🔧 chore: Update @librechat/agents to version 3.0.35 * ✨ feat: Add DeepSeek Model Pricing and Token Handling - Introduced pricing and token limits for 'deepseek-chat' and 'deepseek-reasoner' models, including prompt and completion rates. - Enhanced tests to validate pricing and token limits for DeepSeek models, ensuring correct handling of model variations and provider prefixes. - Updated cache multipliers for DeepSeek models to reflect new pricing structure. - Improved max output token handling for DeepSeek models, ensuring consistency across different endpoints.
This commit is contained in:
parent
026890cd27
commit
4202db1c99
7 changed files with 144 additions and 11 deletions
|
|
@ -665,7 +665,7 @@ describe('Meta Models Tests', () => {
|
|||
|
||||
test('should match Deepseek model variations', () => {
|
||||
expect(getModelMaxTokens('deepseek-chat')).toBe(
|
||||
maxTokensMap[EModelEndpoint.openAI]['deepseek'],
|
||||
maxTokensMap[EModelEndpoint.openAI]['deepseek-chat'],
|
||||
);
|
||||
expect(getModelMaxTokens('deepseek-coder')).toBe(
|
||||
maxTokensMap[EModelEndpoint.openAI]['deepseek'],
|
||||
|
|
@ -677,6 +677,20 @@ describe('Meta Models Tests', () => {
|
|||
maxTokensMap[EModelEndpoint.openAI]['deepseek.r1'],
|
||||
);
|
||||
});
|
||||
|
||||
test('should return 128000 context tokens for all DeepSeek models', () => {
|
||||
expect(getModelMaxTokens('deepseek-chat')).toBe(128000);
|
||||
expect(getModelMaxTokens('deepseek-reasoner')).toBe(128000);
|
||||
expect(getModelMaxTokens('deepseek-r1')).toBe(128000);
|
||||
expect(getModelMaxTokens('deepseek-v3')).toBe(128000);
|
||||
expect(getModelMaxTokens('deepseek.r1')).toBe(128000);
|
||||
});
|
||||
|
||||
test('should handle DeepSeek models with provider prefixes', () => {
|
||||
expect(getModelMaxTokens('deepseek/deepseek-chat')).toBe(128000);
|
||||
expect(getModelMaxTokens('openrouter/deepseek-reasoner')).toBe(128000);
|
||||
expect(getModelMaxTokens('openai/deepseek-v3')).toBe(128000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('matchModelName', () => {
|
||||
|
|
@ -705,11 +719,42 @@ describe('Meta Models Tests', () => {
|
|||
});
|
||||
|
||||
test('should match Deepseek model variations', () => {
|
||||
expect(matchModelName('deepseek-chat')).toBe('deepseek');
|
||||
expect(matchModelName('deepseek-chat')).toBe('deepseek-chat');
|
||||
expect(matchModelName('deepseek-coder')).toBe('deepseek');
|
||||
});
|
||||
});
|
||||
|
||||
describe('DeepSeek Max Output Tokens', () => {
|
||||
const { getModelMaxOutputTokens } = require('@librechat/api');
|
||||
|
||||
test('should return correct max output tokens for deepseek-chat', () => {
|
||||
expect(getModelMaxOutputTokens('deepseek-chat')).toBe(8000);
|
||||
expect(getModelMaxOutputTokens('deepseek-chat', EModelEndpoint.openAI)).toBe(8000);
|
||||
expect(getModelMaxOutputTokens('deepseek-chat', EModelEndpoint.custom)).toBe(8000);
|
||||
});
|
||||
|
||||
test('should return correct max output tokens for deepseek-reasoner', () => {
|
||||
expect(getModelMaxOutputTokens('deepseek-reasoner')).toBe(64000);
|
||||
expect(getModelMaxOutputTokens('deepseek-reasoner', EModelEndpoint.openAI)).toBe(64000);
|
||||
expect(getModelMaxOutputTokens('deepseek-reasoner', EModelEndpoint.custom)).toBe(64000);
|
||||
});
|
||||
|
||||
test('should return correct max output tokens for deepseek-r1', () => {
|
||||
expect(getModelMaxOutputTokens('deepseek-r1')).toBe(64000);
|
||||
expect(getModelMaxOutputTokens('deepseek-r1', EModelEndpoint.openAI)).toBe(64000);
|
||||
});
|
||||
|
||||
test('should return correct max output tokens for deepseek base pattern', () => {
|
||||
expect(getModelMaxOutputTokens('deepseek')).toBe(8000);
|
||||
expect(getModelMaxOutputTokens('deepseek-v3')).toBe(8000);
|
||||
});
|
||||
|
||||
test('should handle DeepSeek models with provider prefixes for max output tokens', () => {
|
||||
expect(getModelMaxOutputTokens('deepseek/deepseek-chat')).toBe(8000);
|
||||
expect(getModelMaxOutputTokens('openrouter/deepseek-reasoner')).toBe(64000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('processModelData with Meta models', () => {
|
||||
test('should process Meta model data correctly', () => {
|
||||
const input = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue