feat(mistal): added mistral as a provider, updated model prices#1607
Merged
waleedlatif1 merged 3 commits intostagingfrom Oct 12, 2025
Merged
feat(mistal): added mistral as a provider, updated model prices#1607waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
Added comprehensive Mistral AI provider integration and updated model pricing across multiple providers.
Key Changes
- Integrated Mistral AI with 10 models (mistral-large, magistral-medium, mistral-medium/small, open-mistral-nemo, codestral, ministral variants)
- Added tool usage control support matching xAI implementation pattern
- Updated pricing for Anthropic (added claude-sonnet-4-5, claude-opus-4-1), xAI (added grok-4-fast variants, grok-code-fast), Cerebras (added llama-4-scout), and Groq providers
- Integrated provider across configuration, tokenization, and type system
Implementation Quality
The Mistral provider follows established patterns from xAI and OpenAI providers using OpenAI SDK with custom baseURL. Implementation includes:
- Comprehensive tool calling with forced tool support
- Streaming responses with usage tracking
- Detailed timing metrics and iteration tracking
- Proper error handling with timing metadata
Issues Found
- Commit title has typo: "mistal" should be "mistral"
- Uses
@ts-ignoreat line 552 (style issue per custom rules)
Confidence Score: 4/5
- This PR is safe to merge with only minor style improvements needed
- Score reflects solid implementation following established patterns with comprehensive testing coverage. The only issues are a typo in the commit title and one style violation using @ts-ignore. All core functionality is properly implemented with tool usage control, streaming, error handling, and proper integration across the codebase.
- No files require special attention - all changes follow established patterns
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/providers/mistral/index.ts | 4/5 | New Mistral AI provider implementation with comprehensive tool handling, streaming support, and OpenAI-compatible API integration |
| apps/sim/providers/models.ts | 4/5 | Added Mistral provider definition with 10 models and updated pricing for Anthropic, xAI, Cerebras, and Groq providers |
| apps/sim/providers/types.ts | 5/5 | Added 'mistral' to ProviderId union type for type safety |
Sequence Diagram
sequenceDiagram
participant Client
participant MistralProvider
participant OpenAI_SDK
participant Mistral_API
participant ToolExecutor
Client->>MistralProvider: executeRequest(request)
MistralProvider->>MistralProvider: Prepare messages & tools
MistralProvider->>MistralProvider: prepareToolsWithUsageControl()
alt Streaming without tools
MistralProvider->>OpenAI_SDK: chat.completions.create(stream=true)
OpenAI_SDK->>Mistral_API: POST /v1/chat/completions
Mistral_API-->>OpenAI_SDK: Stream chunks
OpenAI_SDK-->>MistralProvider: Stream response
MistralProvider-->>Client: ReadableStream
else Non-streaming or with tools
MistralProvider->>OpenAI_SDK: chat.completions.create()
OpenAI_SDK->>Mistral_API: POST /v1/chat/completions
Mistral_API-->>OpenAI_SDK: Response with tool_calls
loop Tool calling iterations (max 10)
MistralProvider->>MistralProvider: Process tool_calls
loop For each tool_call
MistralProvider->>ToolExecutor: executeTool(toolName, params)
ToolExecutor-->>MistralProvider: Tool result
MistralProvider->>MistralProvider: Track timing & results
end
MistralProvider->>OpenAI_SDK: chat.completions.create(with results)
OpenAI_SDK->>Mistral_API: POST /v1/chat/completions
Mistral_API-->>OpenAI_SDK: Next response
alt Has more tool_calls
MistralProvider->>MistralProvider: Continue loop
else No more tool_calls
MistralProvider->>MistralProvider: Exit loop
end
end
alt Streaming final response
MistralProvider->>OpenAI_SDK: chat.completions.create(stream=true)
OpenAI_SDK->>Mistral_API: POST /v1/chat/completions
Mistral_API-->>OpenAI_SDK: Stream final response
OpenAI_SDK-->>MistralProvider: Stream
MistralProvider-->>Client: StreamingExecution
else Non-streaming final response
MistralProvider-->>Client: ProviderResponse
end
end
7 files reviewed, 1 comment
waleedlatif1
added a commit
that referenced
this pull request
Oct 12, 2025
* feat(mistal): added mistral as a provider, updated model prices * remove the ability for a block to reference its own outluts * fixed order of responses for guardrails block
waleedlatif1
added a commit
that referenced
this pull request
Oct 12, 2025
* feat(mistal): added mistral as a provider, updated model prices * remove the ability for a block to reference its own outluts * fixed order of responses for guardrails block
10 tasks
waleedlatif1
added a commit
that referenced
this pull request
Oct 12, 2025
* improvement(performance): remove unused source/target indices, add index on snapshot id (#1603) * fix(blog): rename building to blogs with redirect (#1604) * improvement(privacy-policy): updated privacy policy for google (#1602) * updated privacy policy for google * update terms, privacy, and emails to incl address and update verbiage * feat(guardrails): added guardrails block/tools and docs (#1605) * Adding guardrails block * ack PR comments * cleanup checkbox in dark mode * cleanup * fix supabase tools * fix(inference-billing): fix inference billing when stream is true via API, add drag-and-drop functionality to deployed chat (#1606) * fix(inference): fix inference billing when stream is true via API * add drag-and-drop to deployed chat * feat(mistal): added mistral as a provider, updated model prices (#1607) * feat(mistal): added mistral as a provider, updated model prices * remove the ability for a block to reference its own outluts * fixed order of responses for guardrails block * feat(versions): added the ability to rename deployment versions (#1610) * fix(vulns): fix various vulnerabilities and enhanced code security (#1611) * fix(vulns): fix SSRF vulnerabilities * cleanup * cleanup * regen docs * remove unused deps * fix failing tests * cleanup * update deps * regen bun lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
added mistral as a provider, updated model prices to the latest
Fixes #1587
Type of Change
Testing
Tested manually.
Checklist