Skip to content

Commit fde9a52

Browse files
feat: add top-level mistral provider (#2932)
* feat: add top-level mistral provider Mistral is a big provider so it makes sense to have a default for it. Even more so since it wont work out of the box and need a bit of tweaking see #1570 * [pre-commit.ci lite] apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent e1e70be commit fde9a52

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lua/avante/config.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ M._defaults = {
3131
---@alias avante.Mode "agentic" | "legacy"
3232
---@type avante.Mode
3333
mode = "agentic",
34-
---@alias avante.ProviderName "claude" | "openai" | "azure" | "gemini" | "vertex" | "cohere" | "copilot" | "bedrock" | "ollama" | "watsonx_code_assistant" | string
34+
---@alias avante.ProviderName "claude" | "openai" | "azure" | "gemini" | "vertex" | "cohere" | "copilot" | "bedrock" | "ollama" | "watsonx_code_assistant" | "mistral" | string
3535
---@type avante.ProviderName
3636
provider = "claude",
3737
-- WARNING: Since auto-suggestions are a high-frequency operation and therefore expensive,
@@ -503,6 +503,15 @@ M._defaults = {
503503
model = "qwen3-coder-plus",
504504
api_key_name = "DASHSCOPE_API_KEY",
505505
},
506+
mistral = {
507+
__inherited_from = "openai",
508+
endpoint = "https://api.mistral.ai/v1",
509+
model = "mistral-large-latest",
510+
api_key_name = "MISTRAL_API_KEY",
511+
extra_request_body = {
512+
max_tokens = 4096, -- to avoid using the unsupported max_completion_tokens
513+
},
514+
},
506515
},
507516
---Specify the special dual_boost mode
508517
---1. enabled: Whether to enable dual_boost mode. Default to false.

lua/avante/providers/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ local Utils = require("avante.utils")
1010
---@field cohere AvanteProviderFunctor
1111
---@field copilot AvanteProviderFunctor
1212
---@field gemini AvanteProviderFunctor
13+
---@field mistral AvanteProviderFunctor
1314
---@field ollama AvanteProviderFunctor
1415
---@field openai AvanteProviderFunctor
1516
---@field vertex_claude AvanteProviderFunctor

0 commit comments

Comments
 (0)