You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an UnsupportedParamsError when using the COPRO optimizer with Amazon Bedrock models:
mistral.mistral-small-2402-v1:0
us.meta.llama3-2-3b-instruct-v1:0
The error occurs due to unsupported parameter {'n': 9}.
At the beginig I get this warning :
2025/04/11 12:02:47 WARNING dspy.adapters.json_adapter: Failed to use structured output format. Falling back to JSON mode. Error: litellm.UnsupportedParamsError: bedrock does not support parameters: {'n': 9}, for model=mistral.mistral-small-2402-v1:0. To drop these, set litellm.drop_params=True or for proxy: litellm_settings: drop_params: true
Then I get following exception error:
File ~/dev/work/playground/.venv/lib/python3.10/site-packages/dspy/adapters/json_adapter.py:69, in JSONAdapter.call(self, lm, lm_kwargs, signature, demos, inputs) 67 return super().call(lm, lm_kwargs, signature, demos, inputs) 68 except Exception as e:
---> 69 raise RuntimeError( 70 "Both structured output format and JSON mode failed. Please choose a model that supports " 71 f"response_format argument. Original error: {e}" 72 ) from e
RuntimeError: Both structured output format and JSON mode failed. Please choose a model that supports response_format argument. Original error: litellm.UnsupportedParamsError: bedrock does not support parameters: {'n': 9}, for model=mistral.mistral-small-2402-v1:0. To drop these, set litellm.drop_params=True or for proxy:
litellm_settings: drop_params: true
Steps to reproduce
Configure and compile COPRO optimizer with Bedrock.
Hey @Nasreddine , the error trace states you need to drop the n parameter to work with Bedrock models To drop these, set litellm.drop_params=True
Feel free to reference the LiteLLM AWS Bedrock guide and issues in the LiteLLM repo for anything Bedrock related here.
What happened?
I'm encountering an UnsupportedParamsError when using the COPRO optimizer with Amazon Bedrock models:
The error occurs due to unsupported parameter {'n': 9}.
At the beginig I get this warning :
Then I get following exception error:
Steps to reproduce
Configure and compile COPRO optimizer with Bedrock.
DSPy version
2.6.17
The text was updated successfully, but these errors were encountered: