@@ -56,7 +56,7 @@ func (p *HTTPProvider) Chat(ctx context.Context, messages []Message, tools []Too
5656 // Strip provider prefix from model name (e.g., moonshot/kimi-k2.5 -> kimi-k2.5, groq/openai/gpt-oss-120b -> openai/gpt-oss-120b, ollama/qwen2.5:14b -> qwen2.5:14b)
5757 if idx := strings .Index (model , "/" ); idx != - 1 {
5858 prefix := model [:idx ]
59- if prefix == "moonshot" || prefix == "nvidia" || prefix == "groq" || prefix == "ollama" || prefix == "qwen" {
59+ if prefix == "moonshot" || prefix == "nvidia" || prefix == "groq" || prefix == "ollama" || prefix == "qwen" || prefix == "cerebras" {
6060 model = model [idx + 1 :]
6161 }
6262 }
@@ -313,6 +313,14 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
313313 workspace = "."
314314 }
315315 return NewCodexCliProvider (workspace ), nil
316+ case "cerebras" :
317+ if cfg .Providers .Cerebras .APIKey != "" {
318+ apiKey = cfg .Providers .Cerebras .APIKey
319+ apiBase = cfg .Providers .Cerebras .APIBase
320+ if apiBase == "" {
321+ apiBase = "https://api.cerebras.ai/v1"
322+ }
323+ }
316324 case "deepseek" :
317325 if cfg .Providers .DeepSeek .APIKey != "" {
318326 apiKey = cfg .Providers .DeepSeek .APIKey
@@ -425,6 +433,14 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
425433 if apiBase == "" {
426434 apiBase = "https://integrate.api.nvidia.com/v1"
427435 }
436+ case (strings .Contains (lowerModel , "cerebras" ) || strings .HasPrefix (model , "cerebras/" )) && cfg .Providers .Cerebras .APIKey != "" :
437+ apiKey = cfg .Providers .Cerebras .APIKey
438+ apiBase = cfg .Providers .Cerebras .APIBase
439+ proxy = cfg .Providers .Cerebras .Proxy
440+ if apiBase == "" {
441+ apiBase = "https://api.cerebras.ai/v1"
442+ }
443+
428444 case (strings .Contains (lowerModel , "ollama" ) || strings .HasPrefix (model , "ollama/" )) && cfg .Providers .Ollama .APIKey != "" :
429445 fmt .Println ("Ollama provider selected based on model name prefix" )
430446 apiKey = cfg .Providers .Ollama .APIKey
0 commit comments