diff --git a/docs/docs/usage-guide/changing_a_model.md b/docs/docs/usage-guide/changing_a_model.md index 140a16c612..736147d43f 100644 --- a/docs/docs/usage-guide/changing_a_model.md +++ b/docs/docs/usage-guide/changing_a_model.md @@ -18,6 +18,7 @@ You can give parameters via a configuration file, or from environment variables. Failing to set the needed keys of a specific model will usually result in litellm not identifying the model type, and failing to utilize it. ### OpenAI like API + To use an OpenAI like API, set the following in your `.secrets.toml` file: ```toml @@ -111,7 +112,7 @@ Please note that the `custom_model_max_tokens` setting should be configured in a Commercial models such as GPT-5, Claude Sonnet, and Gemini have demonstrated robust capabilities in generating structured output for code analysis tasks with large input. In contrast, most open-source models currently available (as of January 2025) face challenges with these complex tasks. Based on our testing, local open-source models are suitable for experimentation and learning purposes (mainly for the `ask` command), but they are not suitable for production-level code analysis tasks. - + Hence, for production workflows and real-world usage, we recommend using commercial models. ### Hugging Face @@ -161,6 +162,20 @@ key = ... # your Groq api key (you can obtain a Groq key from [here](https://console.groq.com/keys)) +### SambaNova + +To use MiniMax-M2.5 model with SambaNova, for example, set: + +```toml +[config] # in configuration.toml +model = "sambanova/MiniMax-M2.5" +fallback_models = ["sambanova/MiniMax-M2.5"] +[sambanova] # in .secrets.toml +key = ... # your SambaNova api key +``` + +(you can obtain a SambaNova key from [here](https://cloud.sambanova.ai/apis)) + ### xAI To use xAI's models with PR-Agent, set: @@ -339,7 +354,7 @@ key = "..." # your Codestral api key To use model from Openrouter, for example, set: ```toml -[config] # in configuration.toml +[config] # in configuration.toml model="openrouter/anthropic/claude-3.7-sonnet" fallback_models=["openrouter/deepseek/deepseek-chat"] custom_model_max_tokens=20000 @@ -372,7 +387,7 @@ custom_model_max_tokens= ... 3. Go to [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms), find the model you want to use, and set the relevant environment variables. 4. Most reasoning models do not support chat-style inputs (`system` and `user` messages) or temperature settings. -To bypass chat templates and temperature controls, set `config.custom_reasoning_model = true` in your configuration file. + To bypass chat templates and temperature controls, set `config.custom_reasoning_model = true` in your configuration file. ## Dedicated parameters diff --git a/pr_agent/algo/__init__.py b/pr_agent/algo/__init__.py index a035d08fe8..3ffb037b07 100644 --- a/pr_agent/algo/__init__.py +++ b/pr_agent/algo/__init__.py @@ -201,6 +201,10 @@ 'groq/meta-llama/llama-4-scout-17b-16e-instruct': 131072, 'groq/llama-3.3-70b-versatile': 128000, 'groq/llama-3.1-8b-instant': 128000, + 'sambanova/MiniMax-M2.5': 128000, + 'sambanova/Meta-Llama-3.3-70B-Instruct': 128000, + 'sambanova/gpt-oss-120b': 128000, + 'sambanova/DeepSeek-V3.1': 128000, 'xai/grok-2': 131072, 'xai/grok-2-1212': 131072, 'xai/grok-2-latest': 131072, diff --git a/pr_agent/algo/ai_handlers/litellm_ai_handler.py b/pr_agent/algo/ai_handlers/litellm_ai_handler.py index de9993284d..6ee3b24f62 100644 --- a/pr_agent/algo/ai_handlers/litellm_ai_handler.py +++ b/pr_agent/algo/ai_handlers/litellm_ai_handler.py @@ -71,6 +71,8 @@ def __init__(self): litellm.cohere_key = get_settings().cohere.key if get_settings().get("GROQ.KEY", None): litellm.api_key = get_settings().groq.key + if get_settings().get("SAMBANOVA.KEY", None): + litellm.api_key = get_settings().sambanova.key if get_settings().get("REPLICATE.KEY", None): litellm.replicate_key = get_settings().replicate.key if get_settings().get("XAI.KEY", None): diff --git a/pr_agent/settings/.secrets_template.toml b/pr_agent/settings/.secrets_template.toml index b8a4875976..13ba165dbe 100644 --- a/pr_agent/settings/.secrets_template.toml +++ b/pr_agent/settings/.secrets_template.toml @@ -42,6 +42,9 @@ key = "" # Optional, uncomment if you want to use Replicate. Acquire through htt [groq] key = "" # Acquire through https://console.groq.com/keys +[sambanova] +key = "" # Acquire through https://cloud.sambanova.ai/apis + [xai] key = "" # Optional, uncomment if you want to use xAI. Acquire through https://console.x.ai/