Skip to content

feat(provider): add Mistral support#1598

Merged
zerob13 merged 1 commit intodevfrom
codex/issue-1593
May 9, 2026
Merged

feat(provider): add Mistral support#1598
zerob13 merged 1 commit intodevfrom
codex/issue-1593

Conversation

@zerob13
Copy link
Copy Markdown
Collaborator

@zerob13 zerob13 commented May 9, 2026

Summary

  • Add built-in Mistral provider with the official v1 base URL and Mistral links
  • Register Mistral through the existing OpenAI-compatible AI SDK runtime and provider DB metadata
  • Wire Mistral deeplink/custom type support, provider DB UI hints, and official rainbow icon asset
  • Add SDD docs and targeted main/renderer coverage

Tests

  • pnpm run format
  • pnpm run i18n
  • pnpm run lint
  • pnpm run typecheck
  • pnpm exec vitest --config vitest.config.ts --project main test/main/presenter/configPresenter/defaultProviders.test.ts test/main/presenter/llmProviderPresenter/mistralProvider.test.ts test/main/shared/providerDbCatalog.test.ts test/main/providerDeeplink.test.ts --run
  • pnpm exec vitest --config vitest.config.ts --project renderer test/renderer/components/ModelIcon.test.ts --run

Closes #1593

Summary by CodeRabbit

  • New Features

    • Added Mistral as a built-in AI provider with default API configuration
    • Mistral is now selectable in custom provider settings
    • Deeplink support enabled for Mistral provider installation
    • Added Mistral model icon display
  • Documentation

    • Added Mistral provider feature documentation including plan, specification, and task checklist

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62cb5dd1-1909-48a5-af50-4031252277b5

📥 Commits

Reviewing files that changed from the base of the PR and between b483bf2 and 70b9a81.

⛔ Files ignored due to path filters (1)
  • src/renderer/src/assets/llm-icons/mistral-color.svg is excluded by !**/*.svg
📒 Files selected for processing (16)
  • docs/features/mistral-provider-support/plan.md
  • docs/features/mistral-provider-support/spec.md
  • docs/features/mistral-provider-support/tasks.md
  • src/main/presenter/configPresenter/providers.ts
  • src/main/presenter/llmProviderPresenter/providerRegistry.ts
  • src/main/presenter/llmProviderPresenter/providers/aiSdkProvider.ts
  • src/renderer/settings/components/AddCustomProviderDialog.vue
  • src/renderer/src/components/icons/ModelIcon.vue
  • src/shared/providerDbCatalog.ts
  • src/shared/providerDeeplink.ts
  • test/main/presenter/configPresenter/defaultProviders.test.ts
  • test/main/presenter/llmProviderPresenter/mistralProvider.test.ts
  • test/main/providerDeeplink.test.ts
  • test/main/shared/providerDbCatalog.test.ts
  • test/manual/deeplink-playground.html
  • test/renderer/components/ModelIcon.test.ts

📝 Walkthrough

Walkthrough

This PR adds Mistral AI as a built-in provider to DeepChat. The implementation registers Mistral with OpenAI-compatible API configuration, provider-DB model sourcing, text-generation verification, and UI integration for both built-in and custom provider installation modes.

Changes

Mistral Provider Implementation

Layer / File(s) Summary
Feature Documentation
docs/features/mistral-provider-support/*
Specification, plan, and task checklist documenting Mistral provider support scope, acceptance criteria, and completed work items.
Provider Configuration
src/main/presenter/configPresenter/providers.ts
DEFAULT_PROVIDERS adds active Mistral entry with apiType: 'mistral', base URL https://api.mistral.ai/v1, and official/docs/API-key URLs; removes previously commented-out Mistral block.
AI SDK Provider Registry
src/main/presenter/llmProviderPresenter/providerRegistry.ts
PROVIDER_ID_REGISTRY defines Mistral with provider-DB model source (mistral/default), generate-text verification, and api-key credentials; PROVIDER_API_TYPE_REGISTRY maps apiType: mistral to registry entry.
Provider DB & Deeplink Support
src/shared/providerDbCatalog.ts, src/shared/providerDeeplink.ts
Provider-DB allowlist recognizes mistral; SUPPORTED_PROVIDER_INSTALL_CUSTOM_TYPES includes mistral for deeplink-based custom provider installation.
Model Resolution
src/main/presenter/llmProviderPresenter/providers/aiSdkProvider.ts
mapProviderDbModels() uses definition.providerDbSourceId (falling back to provider.id) for model metadata lookup, supporting both built-in and custom Mistral providers.
UI Integration
src/renderer/src/components/icons/ModelIcon.vue, src/renderer/settings/components/AddCustomProviderDialog.vue
ModelIcon imports and registers mistralColorIcon asset; AddCustomProviderDialog enables Mistral as selectable API type option.
Configuration Tests
test/main/presenter/configPresenter/defaultProviders.test.ts
Validates DEFAULT_PROVIDERS contains Mistral entry with correct id, apiType, baseUrl, disabled state, and nested website URLs.
AI SDK Provider Tests
test/main/presenter/llmProviderPresenter/mistralProvider.test.ts
Comprehensive test suite: verifies resolveAiSdkProviderDefinition maps by id and apiType; fetchModels() transforms provider-DB metadata (vision, function-calling, reasoning, token limits); custom providers preserve custom id; check() validates API key presence and triggers generate-text with expected parameters.
Deeplink & Catalog Tests
test/main/providerDeeplink.test.ts, test/main/shared/providerDbCatalog.test.ts
isProviderInstallCustomType('mistral') returns true; isProviderDbBackedProvider('mistral') returns true (case-insensitive).
Component & Manual Tests
test/renderer/components/ModelIcon.test.ts, test/manual/deeplink-playground.html
ModelIcon test verifies Mistral model ID resolves to correct icon; deeplink playground includes Mistral in built-in and custom provider example grids.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1481: Implements support for a new AI provider using the same code paths (DEFAULT_PROVIDERS, providerRegistry, aiSdkProvider, ModelIcon).
  • ThinkInAIXYZ/deepchat#1485: Modifies DEFAULT_PROVIDERS and SUPPORTED_PROVIDER_INSTALL_CUSTOM_TYPES for built-in/custom provider list changes.
  • ThinkInAIXYZ/deepchat#1432: Implements provider-DB catalog and DB-backed model sync/refresh machinery used by this PR's provider-DB integration.

Suggested labels

codex

🐰 A new Mistral lights the path so bright,
OpenAI-compatible, verified by sight,
Models from metadata, icons in place,
Custom or built-in, at any base.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Mistral provider support to the application.
Linked Issues check ✅ Passed All objectives from issue #1593 are met: Mistral is added as a built-in provider, uses OpenAI-compatible API with correct base URL and auth, appears in provider dropdown, supports standard Mistral models, and resolves verification issues.
Out of Scope Changes check ✅ Passed All changes directly support Mistral provider implementation: configuration, runtime registration, UI wiring, deeplink support, icon assets, and targeted test coverage. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-1593

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zerob13 zerob13 merged commit f723237 into dev May 9, 2026
3 checks passed
@sabitvw-code
Copy link
Copy Markdown

Thank you @zerob13 for implementing this so quickly! We submitted the feature request just yesterday and you already have it merged. Amazing turnaround time.

Mistral AI is becoming a key part of our AI stack and having native support in DeepChat means a lot to our workflow. Looking forward to the next release!

Greetings from Bosnia 🇧🇦

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Mistral AI provider Support

2 participants