Skip to content

feat(mistal): added mistral as a provider, updated model prices - #1607

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/mistral
Oct 12, 2025
Merged

feat(mistal): added mistral as a provider, updated model prices#1607
waleedlatif1 merged 3 commits into
stagingfrom
feat/mistral

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

added mistral as a provider, updated model prices to the latest

Fixes#1587

Type of Change

  • New feature

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Oct 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedOct 12, 2025 3:34am

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-ignore at 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

FilenameScoreOverview
apps/sim/providers/mistral/index.ts4/5New Mistral AI provider implementation with comprehensive tool handling, streaming support, and OpenAI-compatible API integration
apps/sim/providers/models.ts4/5Added Mistral provider definition with 10 models and updated pricing for Anthropic, xAI, Cerebras, and Groq providers
apps/sim/providers/types.ts5/5Added '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
Loading

7 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment threadapps/sim/providers/mistral/index.ts
@waleedlatif1
waleedlatif1 merged commit 3d34132 into stagingOct 12, 2025
4 checks passed
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
@waleedlatif1waleedlatif1 mentioned this pull request Oct 12, 2025
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
@waleedlatif1
waleedlatif1 deleted the feat/mistral branch October 13, 2025 17:37
Sign up for freeto 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.

1 participant

@waleedlatif1