← Back to Leaderboard
Cmistralai

mistralai/client-python

Typed Python SDK for Mistral inference APIs on Mistral, Azure AI, and Vertex AI

View on GitHub ↗
AI FrameworkQuickstart ↓
Engineering Health (Methodology)
A+ · 94/100
Maintenance Activity
● Updated 2d ago
Latest Release
v3.9.0
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption19/25
Release Cadence20/20
License Clarity20/20
API
Total Stars
★ 784
24h Growth
+0
7d Growth
+3
Forks
210

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

mistralai/client-python Star History (2023-12-10 - 2026-12-04) ALL-TIME STAR HISTORY (2023-12 – 2026-12) +783 in 1090d · avg +1/day 828 414 0 2023-12-10: ★ 12024-02-17: ★ 2662024-04-27: ★ 3692024-07-06: ★ 3992024-09-14: ★ 4422024-11-23: ★ 4692025-02-01: ★ 4902025-04-12: ★ 5622025-06-21: ★ 5912025-08-30: ★ 6182025-11-08: ★ 6432026-01-17: ★ 6692026-03-28: ★ 7012026-06-06: ★ 7302026-08-15: ★ 7522026-10-24: ★ 7682026-12-04: ★ 784 ★ 784 2023-12 2025-06 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

mistralai/client-python is a Python SDK for calling Mistral APIs, not a model-serving engine. Its Speakeasy-generated surface groups operations into resource namespaces such as chat, embeddings, files, and audio. The base package depends on Pydantic 2 for data modeling and httpx2 for HTTP, and also includes OpenTelemetry API and semantic-convention dependencies. The Mistral entry point supports both synchronous and asynchronous context managers, so either style can scope the client lifecycle explicitly.

The cloud adapters handle provider-specific connection details. MistralAzure takes an endpoint and key and injects api-version; MistralGCP resolves Google Application Default Credentials, refreshes tokens, and constructs the Vertex AI URL from project and region. Extras keep additional dependencies out of the base install: realtime adds websockets, mcp adds the MCP package, and agents adds MCP, Griffe, and Authlib.

Key Capabilities & Differentiators

For application inference, the SDK covers chat completions, embeddings, agent completions, and file upload. The chat example uses mistral-large-latest, the embedding example uses mistral-embed, and the Vertex AI example uses mistral-small-2503. These are example model IDs, not a cross-provider availability list. The audio surface includes speech generation, SSE transcription streaming, custom voice operations, and lifecycle APIs for live audio-agent sessions. Live voice conversations require the voice-agents extra.

The beta API surface extends beyond inference calls. Its RAG namespace exposes operations to list and register ingestion pipeline configurations and update run information. Evaluation operations cover pipelines and scorers, run search, record lookup, and statistics; optimization trials can be listed with paginated results. These are client interfaces for remote operations, not local ingestion or evaluation engines.

Trade-offs & Limitations

Compared with direct HTTP calls, the SDK is most useful when an application needs typed request and response models, both sync and async paths, streaming, or provider-specific credentials. For a service that calls one or two fixed operations, a thin HTTP wrapper can mean fewer dependencies and tighter control over compatibility. The cost of adopting a broad generated surface is that SDK upgrades can affect imports and types even when the application is not deliberately adopting new endpoints.

Compared with a local inference server, the SDK avoids model loading and GPU provisioning, but request latency, quotas, data handling, and usage costs still depend on the remote service. The Azure and Vertex AI adapters simplify connection and authentication; they do not establish feature parity across providers. Apache-2.0 covers the client code, not model-weight rights or the terms of the hosted service.

Hardware & Deployment Guide

Install mistralai into a Python 3.10+ application with pip, uv, or Poetry. For the Mistral API, credential precedence is a per-request Authorization header, an explicit api_key (which may be a callable), the mounted file at MISTRAL_SA_TOKEN_PATH, then MISTRAL_API_KEY. The file is reread on every request for rotation; an unreadable or empty file raises ServiceAccountTokenError instead of falling back to the environment key. Azure requires a deployed endpoint and key; Vertex AI requires a configured Google Cloud project, application credentials, and the gcp extra.

Hosted calls do not require local model weights, CUDA, or GPU VRAM. Size the client for concurrent requests, open streams, and file handling. For version selection, distinguish the source manifest (3.10.0) from the latest listed release (v3.9.0). The v3.8.0 notes list seven stable-surface removals, and v3.9.0 lists 122 beta-surface removals alongside a generated-baseline discrepancy. Pin the release you test and check the specific methods and types your application imports before upgrading.

Client design: Speakeasy-generated API surface with Pydantic 2 and httpx2 dependencies.
Request lifecycle: One Mistral entry point supports sync and async context managers and paired methods such as chat.complete and chat.complete_async.
Credential rotation: MISTRAL_SA_TOKEN_PATH is reread on every request; an unreadable or empty file raises ServiceAccountTokenError.
Cloud adapters: MistralAzure injects the api-version query parameter; MistralGCP uses Application Default Credentials, refreshes tokens, and builds the Vertex AI URL.
Audio interfaces: SSE transcription and voice-agent session APIs are separate from the optional LiveKit, NumPy, and PyAudio stack for live conversations.
Upgrade risk: The v3.8.0 release lists seven stable-surface removals; v3.9.0 lists 122 beta-surface removals.
Best For

Python backends that need typed access to Mistral chat, embeddings, or audio, with sync and async calls or dedicated Azure AI and Vertex AI adapters.

Skip If

You need offline inference, control over the serving stack, or a provider-neutral API. For a single stable endpoint, direct HTTP may be easier to maintain.

Reviewed on 2026-12-01 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

API
uv add mistralai

Comparison vs. Top LLMs & Inference Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
client-python ★784+3PythonApache-2.0Typed Python SDK for Mistral inference APIs on Mistral, Azure AI, and Vertex AI
transformers169.6k+337PythonApache-2.0A PyTorch model-definition SDK for unified inference and training across modalit
pytorch105.9k+299Python—Python-first tensor SDK for GPU-accelerated training and inference
qlib50.8k+197PythonMITModular Python framework for quant research, from market data to backtests

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/mistralai/client-python.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

mistralai/client-python Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about client-python

How do I integrate the client into a synchronous service or an asyncio application?

Import Mistral from mistralai.client and use it as a context manager. Call chat.complete in synchronous code or await chat.complete_async in an async with block. If using a mounted token, remember that a per-request Authorization header or an explicit api_key takes precedence over MISTRAL_SA_TOKEN_PATH.

Does the client need a GPU, and what determines its resource footprint?

No local GPU or model VRAM is needed for hosted API calls. Size the client process for concurrent requests, active streams, and payload handling. For example, the live voice extra adds LiveKit, NumPy, and PyAudio; test that runtime separately from a text-only client.

Can I use it commercially or self-host inference under Apache-2.0?

Apache-2.0 permits commercial use of the SDK subject to its license conditions. It does not grant rights to hosted services or model weights, or determine where requests are processed. You can run the client in your own infrastructure, but serving weights yourself requires a separate inference runtime and a review of the model's license.

When should I use this SDK instead of calling the API directly?

Choose the SDK when typed models, sync and async calls, streaming helpers, or cloud-specific authentication save integration work. Direct HTTP can be simpler for a small, fixed endpoint set when you want to own the dependency and compatibility boundaries. If you need offline inference, neither option replaces a local serving runtime.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining mistralai/client-python? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature mistralai/client-python on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare