Closed (fixed)
Project:
Anthropic Provider
Version:
1.3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Jan 2025 at 11:46 UTC
Updated:
1 Jul 2026 at 20:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
vinayakmk47When the AI module is installed and Anthropic is configured as the provider, the Max Tokens setting can be adjusted directly in the admin interface. Navigate to the following URL to access this setting:
URL: admin/config/ai/explorers/chat_generator
On this page, under the Provider Configuration section (as shown in the screenshot), you will find the Max Tokens input field. This field allows you to specify the desired maximum token limit for chat completions. For example, you can input 4096 to accommodate your requirements.
This ensures flexibility and control over the token limit for your specific use case without requiring any code-level changes.
Comment #3
vinayakmk47Comment #4
abhineshAdded the possibility to alter the max output tokens in the forked repo.
Comment #6
abhineshComment #10
pavnish commentedHi Marcus,
Could you please review the MR? We have provided the configuration option to set the token limit and ensured it is used from this configuration.
Please let me know if you need any changes.
Thanks,
Pavnish
Comment #11
pavnish commentedComment #12
majorrobot commentedI've tested the fork, and it worked as intended (and helped us get past a painful token bottleneck). It would be great to have this feature available. Thanks for your work on this!
(I suspect it may need a rebase, tho.)
Comment #13
robloachI can review.
Comment #14
robloachMay need the Config Schema to be updated to include max_tokens.
Comment #15
robloachComment #16
robloachAdded the config schema as nullable. Tested export, and it's working. Thanks!
Comment #17
camoa commentedThis feature is now fully implemented in the 1.3.x
branch, which ships as
1.3.0-beta2(and also as
1.2.0-beta2).The native-SDK rewrite introduced a proper API definitions layer.
max_tokensis declared indefinitions/api_defaults.ymlas a configurable integerfield with a default of 4096 and is exposed automatically through the
standard Drupal AI model-settings UI. The provider reads the stored
value at runtime and auto-adjusts it upward when extended thinking is
enabled (so the budget never exceeds max tokens).
MR !10
targeted the old 1.0.x compatibility-layer codebase; that code path has
been superseded. No further work is needed here.
Thank you to everyone who tested and reviewed MR !10 — your feedback
confirmed the need for this setting and it was prioritised in the
rewrite accordingly.
Closing as fixed.
Comment #19
camoa commented