Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ OPENAI_API_KEY=sk-pro
ANTHROPIC_API_KEY=your_anthropic_api_key_here
GOOGLE_API_KEY=your_google_api_key_here
OPENROUTER_API_KEY=sk-or
CEREBRAS_API_KEY=your_cerebras_api_key_here


# Banner system configuration
Expand Down
8 changes: 6 additions & 2 deletions backend/modules/llm/litellm_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def _get_litellm_model_name(self, model_name: str) -> str:
return f"anthropic/{model_id}"
elif "google" in model_config.model_url:
return f"google/{model_id}"
elif "cerebras" in model_config.model_url:
return f"cerebras/{model_id}"
else:
# For custom endpoints, use the model_id directly
return model_id
Expand Down Expand Up @@ -95,10 +97,12 @@ def _get_model_kwargs(self, model_name: str, temperature: Optional[float] = None
os.environ["ANTHROPIC_API_KEY"] = api_key
elif "google" in model_config.model_url:
os.environ["GOOGLE_API_KEY"] = api_key
elif "cerebras" in model_config.model_url:
os.environ["CEREBRAS_API_KEY"] = api_key

# Set custom API base for non-standard endpoints
if hasattr(model_config, 'model_url') and model_config.model_url:
if not any(provider in model_config.model_url for provider in ["openrouter", "api.openai.com", "api.anthropic.com"]):
if not any(provider in model_config.model_url for provider in ["openrouter", "api.openai.com", "api.anthropic.com", "api.cerebras.ai"]):
kwargs["api_base"] = model_config.model_url

# Handle extra headers with environment variable expansion
Expand Down Expand Up @@ -339,4 +343,4 @@ def _format_rag_metadata(self, metadata) -> str:
summary_parts.append(f" • ... and {remaining} more document(s)")

summary_parts.append(f" **Retrieval Method:** {metadata.retrieval_method}")
return "\n".join(summary_parts)
return "\n".join(summary_parts)
7 changes: 6 additions & 1 deletion config/overrides/llmconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ models:
model_url: "https://api.openai.com/v1/chat/completions"
model_name: "gpt-4.1-nano"
api_key: "${OPENAI_API_KEY}"
compliance_level: "External"
compliance_level: "External"
cerebras-gpt-oss-120b:
model_url: "https://api.cerebras.ai/v1"
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model_url for Cerebras appears incomplete compared to other providers. OpenAI uses the full endpoint path https://api.openai.com/v1/chat/completions, but Cerebras only specifies https://api.cerebras.ai/v1.

If LiteLLM's Cerebras provider requires the full endpoint path (like /v1/chat/completions), this configuration may not work correctly. Please verify that https://api.cerebras.ai/v1 is the correct format for LiteLLM's Cerebras integration, or update it to include the complete endpoint path if needed.

Suggested change
model_url: "https://api.cerebras.ai/v1"
model_url: "https://api.cerebras.ai/v1/chat/completions"

Copilot uses AI. Check for mistakes.
model_name: "gpt-oss-120b"
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model name gpt-oss-120b appears to be incorrect for a Cerebras model. This same model name is used for OpenRouter configurations (see line 14 in this file), which suggests it might be a copy-paste error.

Cerebras models typically have names like llama3.1-8b or llama3.1-70b. Please verify and update the model name to match an actual Cerebras model identifier that will be recognized by LiteLLM's Cerebras provider.

Suggested change
model_name: "gpt-oss-120b"
model_name: "llama3.1-70b"

Copilot uses AI. Check for mistakes.
api_key: "${CEREBRAS_API_KEY}"
compliance_level: "External"
Loading