## What this teaches

How to strands agent can't support LiteLLM model with Groq and Cerebras.

## The problem

Issue strands-agents/harness-sdk#729 (closed, 11 comments): ### Checks - [x] I have updated to the lastest minor and patch version of Strands - [x] I have checked the documentation and this is not expected behavior - [x] I have searched [./issues](./issues?q=) and there are no duplicates of my issue ### Strands Version 1.5.0 ### Python Version 3.12.11 ### Operating System Colab notebook ### Installation Method pip ### Steps to Reproduce # Problem Statement Currently, LiteLLM model supports Cerebras and Groq provider, but i cannot use them in strands agent - It appears strands_agents wrapper of litellm did not passed the input correctly, which result...

## What worked (verified answer)

If a Strands agent can't use LiteLLM with Groq or Cerebras, especially when tools are involved, the root cause is LiteLLM's inconsistent content format across providers: OpenAI expects content as a list of parts ([{type: text, text: ...}]) while Cerebras and Groq expect a plain string. A community fix addresses this by overriding message formatting in LiteLLMModel (_format_request_message_contents / _format_request_messages) so tool messages get provider-compatible formatting too. When debugging similar provider errors in Strands, check how message content is shaped for the target provider before assuming the provider key or model is the problem.

## Source

gh:strands-agents/harness-sdk#729 - https://github.com/strands-agents/harness-sdk/issues/729
