Skip to content

feat: Add Mistral AI as first-class provider with GDPR-compliant EU data residency - #7856

Closed
DevAgarwal2 wants to merge 3 commits into
NousResearch:mainfrom
DevAgarwal2:feat/add-mistral-provider
Closed

feat: Add Mistral AI as first-class provider with GDPR-compliant EU data residency#7856
DevAgarwal2 wants to merge 3 commits into
NousResearch:mainfrom
DevAgarwal2:feat/add-mistral-provider

Conversation

@DevAgarwal2

Copy link
Copy Markdown
Contributor

Description

This PR adds Mistral AI as a fully-supported, first-class provider for Hermes Agent. Mistral models are now available directly in hermes model without requiring custom endpoint configuration.

Motivation

Community members have been asking for native Mistral support, particularly for:

  • Mistral Small 4 - Efficient reasoning model for cost-conscious deployments
  • Mistral Large 3 - Flagship multimodal model with superior performance
  • GDPR Compliance - Mistral offers EU data residency, critical for European enterprise users

Previously, users had to configure Mistral as a "custom endpoint", which lacked the seamless integration experience of other providers.

Changes

1. Provider Registration (hermes_cli/auth.py)

  • Added Mistral to PROVIDER_REGISTRY with proper authentication configuration
  • Supports MISTRAL_API_KEY environment variable
  • Supports optional MISTRAL_BASE_URL for enterprise deployments
  • Uses OpenAI-compatible transport (Mistral's API is OpenAI-compatible)

2. Curated Model List (hermes_cli/models.py)

Added 8 carefully selected models:

Model Context Vision Best For
mistral-large-latest 262K General-purpose, complex reasoning
mistral-small-latest 256K Cost-efficient, fast responses
mistral-large-2512 262K Stable version of Large 3
mistral-small-2603 256K Stable version of Small 4
mistral-medium-latest 128K Balanced performance/cost
codestral-latest 256K Code generation and completion
pixtral-large-latest 128K Vision specialist
ministral-8b-latest 128K Edge deployment, low latency

3. Provider Overlay (hermes_cli/providers.py)

  • Added HERMES_OVERLAYS entry for Mistral
  • Configured openai_chat transport
  • Added aliases: mistral-ai, mistralai
  • Base URL: https://api.mistral.ai/v1

4. Vision Backend Support (agent/auxiliary_client.py)

  • Added Mistral to _VISION_AUTO_PROVIDER_ORDER
  • Implemented _try_mistral() for vision task routing
  • Default vision model: pixtral-large-latest
  • Enables image analysis via vision_analyze_tool

GDPR & Compliance Benefits

This is particularly valuable for European enterprise customers:

  • EU Data Residency: Mistral processes data in European data centers
  • GDPR Compliant: Full compliance with European data protection regulations
  • No Data Retention: API calls are not used for model training by default
  • Enterprise Ready: SOC 2 Type II certified

Testing

Verified working:

  • hermes model displays Mistral when MISTRAL_API_KEY is set
  • ✅ Chat completion API responds correctly
  • ✅ All 8 curated models available via API
  • ✅ Vision models (Pixtral) support image analysis
  • ✅ Tool calling works for agent workflows
  • ✅ Context windows up to 262K tokens functional

Usage

# 1. Set your API key
hermes config set MISTRAL_API_KEY your-api-key

# 2. Select Mistral as provider
hermes model
# Select "Mistral AI" from the list

# 3. Start chatting
hermes chat

Or with specific model:

hermes chat --provider mistral --model mistral-large-latest

Environment Variables

  • MISTRAL_API_KEY (required): Your Mistral API key from https://console.mistral.ai/
  • MISTRAL_BASE_URL (optional): Override for enterprise deployments or proxies

Model Pricing (as of implementation)

Model Input Output
mistral-large-latest $0.50/M $1.50/M
mistral-small-latest $0.15/M $0.60/M
pixtral-large-latest $2.00/M $6.00/M

Checklist

  • Added provider to PROVIDER_REGISTRY
  • Added curated model list
  • Added HERMES_OVERLAY configuration
  • Added vision backend support
  • Added provider aliases
  • Tested API connectivity
  • Tested model resolution
  • Tested vision capabilities
  • Verified tool calling support

Related Issues

Closes community requests for:

  • Native Mistral Small 4 support
  • Native Mistral Large 3 support
  • GDPR-compliant provider option

Screenshots

N/A - CLI-only changes

Breaking Changes

None. This is a purely additive feature.

Future Enhancements

Potential follow-ups:

  • Add Mistral agent framework integration (Mistral's native agents)
  • Add batch inference support for cost optimization
  • Add fine-tuned model support when API becomes available

@DevAgarwal2

Copy link
Copy Markdown
Contributor Author

@teknium1 This adds native first-class Mistral support to Hermes so users no longer need to configure Mistral as a custom endpoint. It includes Mistral Large 3, Mistral Small 4, and Pixtral vision support, with the provider showing up properly in hermes model and working with tool calling. This is especially useful for European enterprise users who need an EU-hosted/GDPR-friendly provider option. CI is currently blocked by unrelated upstream failures on main, but the Mistral integration itself was verified against the live API. Would love to get this merged.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Overlaps with #4485 which also adds Mistral AI as a first-class provider (bundled with Nebius and Scaleway). Maintainers should decide which to merge.

@sophiamyang

Copy link
Copy Markdown

+1 this PR. Thanks @DevAgarwal2! @teknium1 could we add Mistral to be first-class provider please?

@ElPadreLulu

Copy link
Copy Markdown

+1 🙏

@adriencdw

Copy link
Copy Markdown

Yes please. It's critical for EU companies.
The custom endpoint is not good, I end up with payload issues.

When using Mistral via the custom provider, Hermes leaks internal metadata fields (e.g. timestamp, reasoning_content, _empty_recovery_synthetic) into message objects in the request payload, which OpenAI/Anthropic silently ignore but Mistral rejects with HTTP 422 extra_forbidden due to strict Pydantic schema validation.

@Brumm3n

Brumm3n commented May 22, 2026

Copy link
Copy Markdown

+1, can we please get this added

@ElPadreLulu

Copy link
Copy Markdown

Thanks for working on native Mistral support.

I opened an alternative implementation in #42357 while testing the current provider/onboarding flow. During testing, I also ran into a Mistral-specific strict validation issue: Mistral rejects replayed assistant messages containing reasoning_content with HTTP 422 when switching providers with existing Hermes history.

The alternative PR includes:

  • first-class provider registration for mistral
  • model/onboarding integration
  • .env.example and docs updates for MISTRAL_API_KEY / MISTRAL_BASE_URL
  • regression coverage for the reasoning_content replay issue

Happy to consolidate approaches if maintainers prefer one direction.

@neborion

Copy link
Copy Markdown

I would also like to see this feature added. Thanks @DevAgarwal2! @teknium1 @OutThisLife @kshitijk4poor.
+1 this PR. Could we add Mistral to be first-class provider please?

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the provider work and for documenting the Mistral-specific validation and EU-residency use cases.

This automated hermes-sweeper review is closing this under the standing policy against adding new third-party/vendor LLM integrations to the core tree (in-tree-provider-integration). The policy is about ongoing coupling and maintenance burden, not the quality or demand for the integration.

  • This PR adds Mistral through core provider/auth/model and auxiliary-client files (gh pr diff 7856).
  • Hermes already discovers user model-provider plugins from $HERMES_HOME/plugins/model-providers/<name>/ (providers/__init__.py:140-171).
  • A provider profile registered there auto-wires auth, config, model selection, runtime resolution, and transport behavior (plugins/model-providers/README.md:19-62).

Please consider publishing the Mistral integration as a standalone provider-plugin repository for installation under ~/.hermes/plugins/ (or via a pip entry point), and promote it in #plugins-skills-and-skins. The Mistral-specific strict-payload observations can be carried into that plugin or a focused core bug fix if a current-main reproduction remains.


Closed as not-planned per standing maintainer policy (in-tree-provider-integration). This is a design-direction decision, not a code-quality judgment — see the Contribution Rubric in AGENTS.md for what the project is looking for. If you believe this policy was misapplied to your change, comment here and a maintainer will take a look.

@teknium1 teknium1 closed this Jul 12, 2026
@teknium1 teknium1 added the sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) label Jul 12, 2026
@Invisi-bi

Copy link
Copy Markdown

Sorry, but why is Mistral not added to the available integration options? This feels like total disrespect for EU. In my country Netherlands there is a growing debate about digital souvereignity, so non European models have to go. And there are surely more countries like Germany where the same debate is going. Chinese models are considered even more untrustworthy than US models. How can you totally ignore such a large user base? I can't sell Hermes agent to municipalities when I can only offer a non European model connected to it. And many municipalities won't run a local model because of the initial cost. Do you want Hermes to be a succes in Europe also, or are you Trump fans?

@neborion

Copy link
Copy Markdown

I’m not going to echo every word of @Invisi-bi ’s post, but I generally agree. I didn’t find @teknium1 ’s justification convincing. In France, even though we’re experts at criticizing our own companies, and even though Mitral AI’s performance isn’t the best on the market by any means, we prefer to have the option of using LLM models whose creators are more likely to be aligned with European interests and values, especially as the world is caught up in a war of narratives.

@Invisi-bi

Copy link
Copy Markdown

I have been looking into AI models a bit more today. It's incredibly hard to find European models. What I see, Mistral is more or less the only AI company of any significance. So Leaving out Mistral basically blocks out all European AI. I have tried to add Mistral with the custom provider, but I get some 422 errors still. I see that there has been work on resolving that issue and I saw a video of a person who connected to Mistral this way, but for me somehow it's not working. So a real Mistral connector is really useful. Or make the custom provider option more robust.

@ShadowJonathan

ShadowJonathan commented Jul 21, 2026

Copy link
Copy Markdown

Well then

Does someone have that plugin repository?

Also FWIW, I think Hermes Agent should have a click-easy way to install these plugins, or at least something via the command line, before creating this policy, as now it is just adding unnecessary friction to new providers that old providers don't; start deleting old providers and put them into plugins, if this policy is about maintainability, because else this is just then pulling up the ladder for "new" LLM providers (mistral was not "new")

@Invisi-bi

Copy link
Copy Markdown

I now solved it to have Claude make a custom connector that works, so I was able to solve it for now. It lets me choose the model that the API offers like the default options.

@ChristofFritz

Copy link
Copy Markdown

Many people in Europe would really appreciate if mistral was added. It's weak to just exclude those people because of the policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.