Skip to content

🦉 feat: Claude Opus 4.7 Model Support#12698

Merged
danny-avila merged 3 commits into
devfrom
claude/kind-pike
Apr 16, 2026
Merged

🦉 feat: Claude Opus 4.7 Model Support#12698
danny-avila merged 3 commits into
devfrom
claude/kind-pike

Conversation

@danny-avila

@danny-avila danny-avila commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Summary

I added first-class support for Anthropic's newly released Claude Opus 4.7 model across the backend, configuration, and tests, mirroring the pattern established for Opus 4.6. The model ships with a 1M-token context window, 128K max output, adaptive thinking, and tiered premium pricing for prompts above 200K tokens. Opus 4.7 also introduces a new xhigh effort level between high and max for the output_config.effort API parameter, which I wired through the AnthropicEffort enum so it is selectable from the UI and forwarded to both the Anthropic API and Bedrock adaptive-thinking parser.

  • Added claude-opus-4-7 to sharedAnthropicModels and anthropic.claude-opus-4-7 to bedrockModels in packages/data-provider/src/config.ts.
  • Registered the 1M context window and 128K max output entries in packages/api/src/utils/tokens.ts.
  • Added token pricing ($5 / $25 per MTok), cache rates (6.25 write / 0.5 read), and the premium tier (threshold 200K → $10 / $37.50) in packages/data-schemas/src/methods/tx.ts.
  • Introduced AnthropicEffort.xhigh between high and max in packages/data-provider/src/schemas.ts, exposed it in anthropicSettings.effort.options and the effort slider enumMappings in packages/data-provider/src/parameterSettings.ts, and reused the existing com_ui_xhigh translation key.
  • Updated .env.example with Opus 4.7 entries in the ANTHROPIC_MODELS and BEDROCK_AWS_MODELS comment examples, including cross-region inference IDs.
  • Extended tests with parallel Opus 4.7 cases covering token/cache/premium rates (with exact threshold/prompt/completion values), context length, max output, name-variation matching via matchModelName / getValueKey, and the supportsContext1m qualifier for Bedrock.
  • Added dedicated xhigh coverage: enum position + zod acceptance in schemas.spec.ts, bedrockInputParser emitting output_config: { effort: 'xhigh' } in bedrock.spec.ts, and getLLMConfig setting adaptive thinking with output_config.effort = 'xhigh' in llm.spec.ts.
  • Relied on existing future-proofed parsing: parseOpusVersion with opus.minor >= 6 in packages/data-provider/src/bedrock.ts and the [6-9] regex in packages/data-provider/src/schemas.ts already route 4.7 through the correct adaptive-thinking and 128K output caps.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

Verified the new model metadata, effort enum, and pricing wiring through the affected Jest suites.

  • cd packages/data-provider && npx jest → 17 suites, 934 passed
  • cd packages/data-schemas && npx jest src/methods/tx.spec.ts → 197/197 pass
  • cd packages/api && npx jest src/endpoints/anthropic src/endpoints/bedrock/initialize.spec.ts → 205/205 pass

Test Configuration:

  • Node.js v20+, Windows 11, Jest per-workspace

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

- Add `claude-opus-4-7` to shared Anthropic models and `anthropic.claude-opus-4-7` to Bedrock models
- Register 1M context window and 128K max output in anthropic token maps
- Add token pricing ($5/$25), cache rates (6.25/0.5), and premium tier ($10/$37.50 above 200K) in tx.ts
- Update `.env.example` with Opus 4.7 IDs in `ANTHROPIC_MODELS` and `BEDROCK_AWS_MODELS` examples
- Add parallel Opus 4.7 test cases for token/cache/premium rates, context length, max output, name-variation matching, and 1M-context qualification
Copilot AI review requested due to automatic review settings April 16, 2026 18:15
@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

- Add `xhigh` variant to `AnthropicEffort` enum between `high` and `max`
- Expose `xhigh` in `anthropicSettings.effort.options` and the UI slider `enumMappings`
- Reuse existing `com_ui_xhigh` translation key

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for the claude-opus-4-7 model across model allowlists, token limits (context/max output), pricing (prompt/completion/cache/premium tier), env examples, and unit tests—following the existing Opus 4.6 integration patterns.

Changes:

  • Added claude-opus-4-7 / anthropic.claude-opus-4-7 to default model lists (Anthropic + Bedrock).
  • Registered 1M context + 128K max output for Opus 4.7 in the API token utility maps.
  • Added pricing + cache rates + premium tier pricing for Opus 4.7, plus corresponding test coverage updates.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/data-schemas/src/methods/tx.ts Adds Opus 4.7 token pricing, cache pricing, and premium tier pricing entries.
packages/data-schemas/src/methods/tx.spec.ts Adds tests validating Opus 4.7 pricing, cache rates, premium entry presence, and model name variation matching.
packages/data-provider/src/config.ts Adds Opus 4.7 to shared Anthropic model list and Bedrock model ID list.
packages/data-provider/specs/bedrock.spec.ts Extends supportsContext1m coverage to include claude-opus-4-7.
packages/api/src/utils/tokens.ts Adds Opus 4.7 to Anthropic max context and max output token maps.
api/utils/tokens.spec.js Adds tests for Opus 4.7 context length, max output tokens, and model name matching.
.env.example Updates example env comments to include Opus 4.7 in Anthropic/Bedrock model lists and cross-region examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-12698 index is now live on the MCP server.
Deploy run

- Assert `xhigh` position (between high and max), inclusion in
  `anthropicSettings.effort.options`, zod acceptance, and rejection of
  unknown values in schemas.spec.ts
- Verify bedrockInputParser emits `output_config: { effort: 'xhigh' }`
  for adaptive `anthropic.claude-opus-4-7`
- Verify getLLMConfig sets adaptive thinking and `output_config.effort =
  'xhigh'` for `claude-opus-4-7`
- Pin Opus 4.7 premium pricing to exact threshold/prompt/completion
  values (200000 / 10 / 37.5) so silent rate drift fails the test
@danny-avila
danny-avila changed the base branch from main to dev April 16, 2026 18:50
@danny-avila
danny-avila merged commit e2e3284 into dev Apr 16, 2026
14 of 15 checks passed
@danny-avila
danny-avila deleted the claude/kind-pike branch April 16, 2026 18:51
krgokul pushed a commit to syedhabib39/LibreChat that referenced this pull request Apr 20, 2026
* 🦉 feat: Claude Opus 4.7 Model Support

- Add `claude-opus-4-7` to shared Anthropic models and `anthropic.claude-opus-4-7` to Bedrock models
- Register 1M context window and 128K max output in anthropic token maps
- Add token pricing ($5/$25), cache rates (6.25/0.5), and premium tier ($10/$37.50 above 200K) in tx.ts
- Update `.env.example` with Opus 4.7 IDs in `ANTHROPIC_MODELS` and `BEDROCK_AWS_MODELS` examples
- Add parallel Opus 4.7 test cases for token/cache/premium rates, context length, max output, name-variation matching, and 1M-context qualification

* feat: Add `xhigh` Effort Level for Opus 4.7

- Add `xhigh` variant to `AnthropicEffort` enum between `high` and `max`
- Expose `xhigh` in `anthropicSettings.effort.options` and the UI slider `enumMappings`
- Reuse existing `com_ui_xhigh` translation key

* test: Cover `xhigh` Effort and Exact Opus 4.7 Premium Rates

- Assert `xhigh` position (between high and max), inclusion in
  `anthropicSettings.effort.options`, zod acceptance, and rejection of
  unknown values in schemas.spec.ts
- Verify bedrockInputParser emits `output_config: { effort: 'xhigh' }`
  for adaptive `anthropic.claude-opus-4-7`
- Verify getLLMConfig sets adaptive thinking and `output_config.effort =
  'xhigh'` for `claude-opus-4-7`
- Pin Opus 4.7 premium pricing to exact threshold/prompt/completion
  values (200000 / 10 / 37.5) so silent rate drift fails the test
krgokul pushed a commit to syedhabib39/LibreChat that referenced this pull request Apr 20, 2026
* 🦉 feat: Claude Opus 4.7 Model Support

- Add `claude-opus-4-7` to shared Anthropic models and `anthropic.claude-opus-4-7` to Bedrock models
- Register 1M context window and 128K max output in anthropic token maps
- Add token pricing ($5/$25), cache rates (6.25/0.5), and premium tier ($10/$37.50 above 200K) in tx.ts
- Update `.env.example` with Opus 4.7 IDs in `ANTHROPIC_MODELS` and `BEDROCK_AWS_MODELS` examples
- Add parallel Opus 4.7 test cases for token/cache/premium rates, context length, max output, name-variation matching, and 1M-context qualification

* feat: Add `xhigh` Effort Level for Opus 4.7

- Add `xhigh` variant to `AnthropicEffort` enum between `high` and `max`
- Expose `xhigh` in `anthropicSettings.effort.options` and the UI slider `enumMappings`
- Reuse existing `com_ui_xhigh` translation key

* test: Cover `xhigh` Effort and Exact Opus 4.7 Premium Rates

- Assert `xhigh` position (between high and max), inclusion in
  `anthropicSettings.effort.options`, zod acceptance, and rejection of
  unknown values in schemas.spec.ts
- Verify bedrockInputParser emits `output_config: { effort: 'xhigh' }`
  for adaptive `anthropic.claude-opus-4-7`
- Verify getLLMConfig sets adaptive thinking and `output_config.effort =
  'xhigh'` for `claude-opus-4-7`
- Pin Opus 4.7 premium pricing to exact threshold/prompt/completion
  values (200000 / 10 / 37.5) so silent rate drift fails the test
krgokul pushed a commit to syedhabib39/LibreChat that referenced this pull request Apr 21, 2026
* 🦉 feat: Claude Opus 4.7 Model Support

- Add `claude-opus-4-7` to shared Anthropic models and `anthropic.claude-opus-4-7` to Bedrock models
- Register 1M context window and 128K max output in anthropic token maps
- Add token pricing ($5/$25), cache rates (6.25/0.5), and premium tier ($10/$37.50 above 200K) in tx.ts
- Update `.env.example` with Opus 4.7 IDs in `ANTHROPIC_MODELS` and `BEDROCK_AWS_MODELS` examples
- Add parallel Opus 4.7 test cases for token/cache/premium rates, context length, max output, name-variation matching, and 1M-context qualification

* feat: Add `xhigh` Effort Level for Opus 4.7

- Add `xhigh` variant to `AnthropicEffort` enum between `high` and `max`
- Expose `xhigh` in `anthropicSettings.effort.options` and the UI slider `enumMappings`
- Reuse existing `com_ui_xhigh` translation key

* test: Cover `xhigh` Effort and Exact Opus 4.7 Premium Rates

- Assert `xhigh` position (between high and max), inclusion in
  `anthropicSettings.effort.options`, zod acceptance, and rejection of
  unknown values in schemas.spec.ts
- Verify bedrockInputParser emits `output_config: { effort: 'xhigh' }`
  for adaptive `anthropic.claude-opus-4-7`
- Verify getLLMConfig sets adaptive thinking and `output_config.effort =
  'xhigh'` for `claude-opus-4-7`
- Pin Opus 4.7 premium pricing to exact threshold/prompt/completion
  values (200000 / 10 / 37.5) so silent rate drift fails the test
jcbartle pushed a commit to jcbartle/LibreChat that referenced this pull request May 11, 2026
* 🦉 feat: Claude Opus 4.7 Model Support

- Add `claude-opus-4-7` to shared Anthropic models and `anthropic.claude-opus-4-7` to Bedrock models
- Register 1M context window and 128K max output in anthropic token maps
- Add token pricing ($5/$25), cache rates (6.25/0.5), and premium tier ($10/$37.50 above 200K) in tx.ts
- Update `.env.example` with Opus 4.7 IDs in `ANTHROPIC_MODELS` and `BEDROCK_AWS_MODELS` examples
- Add parallel Opus 4.7 test cases for token/cache/premium rates, context length, max output, name-variation matching, and 1M-context qualification

* feat: Add `xhigh` Effort Level for Opus 4.7

- Add `xhigh` variant to `AnthropicEffort` enum between `high` and `max`
- Expose `xhigh` in `anthropicSettings.effort.options` and the UI slider `enumMappings`
- Reuse existing `com_ui_xhigh` translation key

* test: Cover `xhigh` Effort and Exact Opus 4.7 Premium Rates

- Assert `xhigh` position (between high and max), inclusion in
  `anthropicSettings.effort.options`, zod acceptance, and rejection of
  unknown values in schemas.spec.ts
- Verify bedrockInputParser emits `output_config: { effort: 'xhigh' }`
  for adaptive `anthropic.claude-opus-4-7`
- Verify getLLMConfig sets adaptive thinking and `output_config.effort =
  'xhigh'` for `claude-opus-4-7`
- Pin Opus 4.7 premium pricing to exact threshold/prompt/completion
  values (200000 / 10 / 37.5) so silent rate drift fails the test
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
* 🦉 feat: Claude Opus 4.7 Model Support

- Add `claude-opus-4-7` to shared Anthropic models and `anthropic.claude-opus-4-7` to Bedrock models
- Register 1M context window and 128K max output in anthropic token maps
- Add token pricing ($5/$25), cache rates (6.25/0.5), and premium tier ($10/$37.50 above 200K) in tx.ts
- Update `.env.example` with Opus 4.7 IDs in `ANTHROPIC_MODELS` and `BEDROCK_AWS_MODELS` examples
- Add parallel Opus 4.7 test cases for token/cache/premium rates, context length, max output, name-variation matching, and 1M-context qualification

* feat: Add `xhigh` Effort Level for Opus 4.7

- Add `xhigh` variant to `AnthropicEffort` enum between `high` and `max`
- Expose `xhigh` in `anthropicSettings.effort.options` and the UI slider `enumMappings`
- Reuse existing `com_ui_xhigh` translation key

* test: Cover `xhigh` Effort and Exact Opus 4.7 Premium Rates

- Assert `xhigh` position (between high and max), inclusion in
  `anthropicSettings.effort.options`, zod acceptance, and rejection of
  unknown values in schemas.spec.ts
- Verify bedrockInputParser emits `output_config: { effort: 'xhigh' }`
  for adaptive `anthropic.claude-opus-4-7`
- Verify getLLMConfig sets adaptive thinking and `output_config.effort =
  'xhigh'` for `claude-opus-4-7`
- Pin Opus 4.7 premium pricing to exact threshold/prompt/completion
  values (200000 / 10 / 37.5) so silent rate drift fails the test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants