🧠 feat: Add Claude Opus 4.8 Support (#13380)
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
GitNexus Index / index (push) Waiting to run
GitNexus Index / post-index (push) Blocked by required conditions

* feat: add Claude Opus 4.8 support

* fix: omit sampling params for Claude Opus 4.8

* fix: flatten Bedrock beta header merge

* fix: strip Bedrock sampling params for Opus 4.8
This commit is contained in:
Danny Avila 2026-05-28 13:50:39 -07:00 committed by GitHub
parent 0d981b08d8
commit 62dff69300
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 234 additions and 17 deletions

View file

@ -1459,6 +1459,37 @@ describe('Claude Model Tests', () => {
});
});
it('should return correct context length for Claude Opus 4.8 (1M)', () => {
expect(getModelMaxTokens('claude-opus-4-8', EModelEndpoint.anthropic)).toBe(
maxTokensMap[EModelEndpoint.anthropic]['claude-opus-4-8'],
);
expect(getModelMaxTokens('claude-opus-4-8')).toBe(
maxTokensMap[EModelEndpoint.anthropic]['claude-opus-4-8'],
);
});
it('should return correct max output tokens for Claude Opus 4.8 (128K)', () => {
const { getModelMaxOutputTokens } = require('@librechat/api');
expect(getModelMaxOutputTokens('claude-opus-4-8', EModelEndpoint.anthropic)).toBe(
maxOutputTokensMap[EModelEndpoint.anthropic]['claude-opus-4-8'],
);
});
it('should match model names correctly for Claude Opus 4.8', () => {
const modelVariations = [
'claude-opus-4-8',
'claude-opus-4-8-20260528',
'claude-opus-4-8-latest',
'anthropic/claude-opus-4-8',
'claude-opus-4-8/anthropic',
'claude-opus-4-8-preview',
];
modelVariations.forEach((model) => {
expect(matchModelName(model, EModelEndpoint.anthropic)).toBe('claude-opus-4-8');
});
});
it('should return correct context length for Claude Sonnet 4.6 (1M)', () => {
expect(getModelMaxTokens('claude-sonnet-4-6', EModelEndpoint.anthropic)).toBe(
maxTokensMap[EModelEndpoint.anthropic]['claude-sonnet-4-6'],