[FEATURE] Model Specific Feature Mechanism
Problem Statement
Currently, different models on Bedrock and other providers have specific requirements and limitations that can cause runtime failures. For example, DeepSeek R1 has issues with reasoningContent in messages that other models like Claude don't have (as seen in PR #652 ). We need a systematic way to handle these model-specific configurations and requirements.
Proposed Solution
No response
Use Case
The system should implement a configuration registry pattern where model-specific behaviors are defined in external configuration files rather than scattered throughout the codebase with if-statements. This approach would be similar to how the SDK currently handles other features (as seen in various issues like #652 and #713).
For example, instead of:
if model == "deepseek":
strip_reasoning_content()
elif model == "claude":
handle_token_limits()
The system would use a declarative configuration approach where model capabilities and limitations are defined in configuration files, and a single handler processes these configurations. This keeps the core code clean and maintainable while moving model-specific logic to configuration rather than implementation.
This design would align with the SDK's existing architecture while preventing the proliferation of model-specific conditional statements throughout the codebase, as evidenced by the challenges seen in the DeepSeek reasoning content issue (#652) and other model-specific issues in the repository.
Alternatives Solutions
No response
Additional Context
No response
Additional example of model/provider specific logic https://github.com/strands-agents/sdk-python/issues/630
model = BedrockModel(
model_id="openai.gpt-oss-120b-1:0",
streaming=False,
)
Strands should know gpt oss must use Converse and automatically use it.
Additional example https://github.com/strands-agents/sdk-python/pull/686 relating to non-claude models and the inclusion of the status field.
Hey, any news on it? Thanks!
Qwen model has same issue with Deepseek. It rejects messages that include reasoning content. Currently only when using Deepseek model, it filtered out them
https://github.com/strands-agents/sdk-python/blob/8cae18cdc9a70cd892188485c2df47698a17af55/src/strands/models/bedrock.py#L335
For the just workaround, I replace if statement as bellow then it worked.
if any(model in self.config["model_id"].lower() for model in ["deepseek", "qwen"]) and "reasoningContent" in content_block:
I don't think it's a good idea at all, but it seems like this is the only option at the moment.
@dbschmigelski We should also consider https://github.com/strands-agents/sdk-python/issues/1241 while implementing this.