diff --git a/cli/main.py b/cli/main.py index 53837db2..93a69aba 100644 --- a/cli/main.py +++ b/cli/main.py @@ -927,6 +927,10 @@ def run_analysis(): config["deep_think_llm"] = selections["deep_thinker"] config["backend_url"] = selections["backend_url"] config["llm_provider"] = selections["llm_provider"].lower() + # Override with Cerebras + config["llm_provider"] = "cerebras" + config["deep_think_llm"] = "llama-4-scout-17b-16e-instruct" + config["quick_think_llm"] = "llama-4-scout-17b-16e-instruct" # Provider-specific thinking configuration config["google_thinking_level"] = selections.get("google_thinking_level") config["openai_reasoning_effort"] = selections.get("openai_reasoning_effort") diff --git a/cli/utils.py b/cli/utils.py index 18abc3a7..afe51a22 100644 --- a/cli/utils.py +++ b/cli/utils.py @@ -171,6 +171,10 @@ def select_shallow_thinking_agent(provider) -> str: ("GPT-OSS:latest (20B, local)", "gpt-oss:latest"), ("GLM-4.7-Flash:latest (30B, local)", "glm-4.7-flash:latest"), ], + "cerebras": [ + ("Llama 3.1 8B - Fastest, lightweight", "llama3.1-8b"), + ("Qwen 3 235B - Most capable", "qwen-3-235b-a22b-instruct-2507"), + ], } choice = questionary.select( @@ -238,6 +242,10 @@ def select_deep_thinking_agent(provider) -> str: ("GPT-OSS:latest (20B, local)", "gpt-oss:latest"), ("Qwen3:latest (8B, local)", "qwen3:latest"), ], + "cerebras": [ + ("Qwen 3 235B - Most capable", "qwen-3-235b-a22b-instruct-2507"), + ("Llama 3.1 8B - Fastest, lightweight", "llama3.1-8b"), + ], } choice = questionary.select( @@ -272,6 +280,7 @@ def select_llm_provider() -> tuple[str, str]: ("xAI", "https://api.x.ai/v1"), ("Openrouter", "https://openrouter.ai/api/v1"), ("Ollama", "http://localhost:11434/v1"), + ("Cerebras", "https://api.cerebras.ai/v1"), ] choice = questionary.select( diff --git a/main.py b/main.py index 26cab658..d83b27f4 100644 --- a/main.py +++ b/main.py @@ -8,9 +8,10 @@ load_dotenv() # Create a custom config config = DEFAULT_CONFIG.copy() -config["deep_think_llm"] = "gpt-5-mini" # Use a different model -config["quick_think_llm"] = "gpt-5-mini" # Use a different model -config["max_debate_rounds"] = 1 # Increase debate rounds +config["llm_provider"] = "cerebras" +config["deep_think_llm"] = "llama3.1-8b" +config["quick_think_llm"] = "llama3.1-8b" +config["max_debate_rounds"] = 1 # Configure data vendors (default uses yfinance, no extra API keys needed) config["data_vendors"] = { diff --git a/tradingagents/llm_clients/factory.py b/tradingagents/llm_clients/factory.py index 93c2a7d3..6d2bc987 100644 --- a/tradingagents/llm_clients/factory.py +++ b/tradingagents/llm_clients/factory.py @@ -34,7 +34,7 @@ def create_llm_client( """ provider_lower = provider.lower() - if provider_lower in ("openai", "ollama", "openrouter"): + if provider_lower in ("openai", "ollama", "openrouter", "cerebras"): return OpenAIClient(model, base_url, provider=provider_lower, **kwargs) if provider_lower == "xai": diff --git a/tradingagents/llm_clients/openai_client.py b/tradingagents/llm_clients/openai_client.py index fd9b4e33..4c4487ed 100644 --- a/tradingagents/llm_clients/openai_client.py +++ b/tradingagents/llm_clients/openai_client.py @@ -29,6 +29,7 @@ _PROVIDER_CONFIG = { "xai": ("https://api.x.ai/v1", "XAI_API_KEY"), "openrouter": ("https://openrouter.ai/api/v1", "OPENROUTER_API_KEY"), "ollama": ("http://localhost:11434/v1", None), + "cerebras": ("https://api.cerebras.ai/v1", "CEREBRAS_API_KEY"), } diff --git a/tradingagents/llm_clients/validators.py b/tradingagents/llm_clients/validators.py index 1e2388b3..ad840389 100644 --- a/tradingagents/llm_clients/validators.py +++ b/tradingagents/llm_clients/validators.py @@ -48,6 +48,10 @@ VALID_MODELS = { "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", ], + "cerebras": [ + "qwen-3-235b-a22b-instruct-2507", + "llama3.1-8b", + ], }