@@ -57,6 +57,8 @@ def _get_litellm_model_name(self, model_name: str) -> str:
5757 return f"anthropic/{ model_id } "
5858 elif "google" in model_config .model_url :
5959 return f"google/{ model_id } "
60+ elif "cerebras" in model_config .model_url :
61+ return f"cerebras/{ model_id } "
6062 else :
6163 # For custom endpoints, use the model_id directly
6264 return model_id
@@ -95,10 +97,12 @@ def _get_model_kwargs(self, model_name: str, temperature: Optional[float] = None
9597 os .environ ["ANTHROPIC_API_KEY" ] = api_key
9698 elif "google" in model_config .model_url :
9799 os .environ ["GOOGLE_API_KEY" ] = api_key
100+ elif "cerebras" in model_config .model_url :
101+ os .environ ["CEREBRAS_API_KEY" ] = api_key
98102
99103 # Set custom API base for non-standard endpoints
100104 if hasattr (model_config , 'model_url' ) and model_config .model_url :
101- if not any (provider in model_config .model_url for provider in ["openrouter" , "api.openai.com" , "api.anthropic.com" ]):
105+ if not any (provider in model_config .model_url for provider in ["openrouter" , "api.openai.com" , "api.anthropic.com" , "api.cerebras.ai" ]):
102106 kwargs ["api_base" ] = model_config .model_url
103107
104108 # Handle extra headers with environment variable expansion
@@ -339,4 +343,4 @@ def _format_rag_metadata(self, metadata) -> str:
339343 summary_parts .append (f" • ... and { remaining } more document(s)" )
340344
341345 summary_parts .append (f" **Retrieval Method:** { metadata .retrieval_method } " )
342- return "\n " .join (summary_parts )
346+ return "\n " .join (summary_parts )
0 commit comments