From c3e48f6cf3c9f5153ab8641ec740019ad37b899d Mon Sep 17 00:00:00 2001 From: snova-luiss Date: Mon, 13 Apr 2026 12:45:19 -0500 Subject: [PATCH 1/3] add sambanova provider --- docs/docs/usage-guide/changing_a_model.md | 27 ++++++++++++++----- pr_agent/algo/__init__.py | 4 +++ .../algo/ai_handlers/litellm_ai_handler.py | 2 ++ pr_agent/settings/.secrets_template.toml | 3 +++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/docs/docs/usage-guide/changing_a_model.md b/docs/docs/usage-guide/changing_a_model.md index 140a16c612..a478061140 100644 --- a/docs/docs/usage-guide/changing_a_model.md +++ b/docs/docs/usage-guide/changing_a_model.md @@ -14,10 +14,11 @@ For models and environments not from OpenAI, you might need to provide additiona You can give parameters via a configuration file, or from environment variables. !!! note "Model-specific environment variables" - See [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms) for the environment variables needed per model, as they may vary and change over time. Our documentation per-model may not always be up-to-date with the latest changes. - 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. +See [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms) for the environment variables needed per model, as they may vary and change over time. Our documentation per-model may not always be up-to-date with the latest changes. +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 @@ -106,12 +107,12 @@ By default, Ollama uses a context window size of 2048 tokens. In most cases this Please note that the `custom_model_max_tokens` setting should be configured in accordance with the `OLLAMA_CONTEXT_LENGTH`. Failure to do so may result in unexpected model output. !!! note "Local models vs commercial models" - PR-Agent is compatible with almost any AI model, but analyzing complex code repositories and pull requests requires a model specifically optimized for code analysis. +PR-Agent is compatible with almost any AI model, but analyzing complex code repositories and pull requests requires a model specifically optimized for code analysis. 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/ From 21901fc8d4ddc059b6edebceac002302e7d91894 Mon Sep 17 00:00:00 2001 From: Luis Felipe Salazar Ucros <40307832+luisfucros@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:42:14 +0000 Subject: [PATCH 2/3] update file --- docs/docs/usage-guide/changing_a_model.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/usage-guide/changing_a_model.md b/docs/docs/usage-guide/changing_a_model.md index a478061140..e59c16497b 100644 --- a/docs/docs/usage-guide/changing_a_model.md +++ b/docs/docs/usage-guide/changing_a_model.md @@ -14,8 +14,8 @@ For models and environments not from OpenAI, you might need to provide additiona You can give parameters via a configuration file, or from environment variables. !!! note "Model-specific environment variables" -See [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms) for the environment variables needed per model, as they may vary and change over time. Our documentation per-model may not always be up-to-date with the latest changes. -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. + See [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms) for the environment variables needed per model, as they may vary and change over time. Our documentation per-model may not always be up-to-date with the latest changes. + 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 @@ -107,7 +107,7 @@ By default, Ollama uses a context window size of 2048 tokens. In most cases this Please note that the `custom_model_max_tokens` setting should be configured in accordance with the `OLLAMA_CONTEXT_LENGTH`. Failure to do so may result in unexpected model output. !!! note "Local models vs commercial models" -PR-Agent is compatible with almost any AI model, but analyzing complex code repositories and pull requests requires a model specifically optimized for code analysis. + PR-Agent is compatible with almost any AI model, but analyzing complex code repositories and pull requests requires a model specifically optimized for code analysis. 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. From ba4048f5a798e0ebd227ad0d622d0f4132ec891e Mon Sep 17 00:00:00 2001 From: Luis Felipe Salazar Ucros <40307832+luisfucros@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:45:23 +0000 Subject: [PATCH 3/3] update file --- docs/docs/usage-guide/changing_a_model.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/usage-guide/changing_a_model.md b/docs/docs/usage-guide/changing_a_model.md index e59c16497b..736147d43f 100644 --- a/docs/docs/usage-guide/changing_a_model.md +++ b/docs/docs/usage-guide/changing_a_model.md @@ -14,8 +14,8 @@ For models and environments not from OpenAI, you might need to provide additiona You can give parameters via a configuration file, or from environment variables. !!! note "Model-specific environment variables" - See [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms) for the environment variables needed per model, as they may vary and change over time. Our documentation per-model may not always be up-to-date with the latest changes. - 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. + See [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms) for the environment variables needed per model, as they may vary and change over time. Our documentation per-model may not always be up-to-date with the latest changes. + 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