Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Langchain ai Langchain MistralAI Model Profiles

From Leeroopedia
Knowledge Sources
Domains LLM, MistralAI, Model Configuration
Last Updated 2026-02-11 00:00 GMT

Overview

MistralAI Model Profiles is an auto-generated data module that defines capability profiles (token limits, modality support, tool calling) for Mistral AI models.

Description

The _profiles.py file in the langchain-mistralai partner package contains a dictionary named _PROFILES that maps Mistral AI model identifiers to their capability metadata. Each profile entry includes maximum input/output token counts, supported input/output modalities (text, image, audio, video), reasoning output capability, and tool calling support. This data is auto-generated by the langchain-profiles CLI tool from the models.dev project and should not be manually edited. The profiles are consumed by ChatMistralAI to automatically set model profile metadata for token counting and capability detection.

Usage

This module is used internally by ChatMistralAI during initialization to populate the model's profile with appropriate token limits and capabilities. It is not typically imported directly by end users.

Code Reference

Source Location

  • Repository: Langchain_ai_Langchain
  • File: libs/partners/mistralai/langchain_mistralai/data/_profiles.py
  • Lines: 1-383

Signature

_PROFILES: dict[str, dict[str, Any]] = {
    "model-name": {
        "max_input_tokens": int,
        "max_output_tokens": int,
        "text_inputs": bool,
        "image_inputs": bool,
        "audio_inputs": bool,
        "video_inputs": bool,
        "text_outputs": bool,
        "image_outputs": bool,
        "audio_outputs": bool,
        "video_outputs": bool,
        "reasoning_output": bool,
        "tool_calling": bool,
    },
    ...
}

Import

from langchain_mistralai.data._profiles import _PROFILES

I/O Contract

Inputs

Name Type Required Description
(none) -- -- This is a static data module with no runtime inputs.

Outputs

Name Type Description
_PROFILES dict[str, dict[str, Any]] A dictionary mapping model name strings to profile dictionaries containing token limits and capability flags.

Registered Models

The module includes profiles for the following Mistral AI models (among others):

Model Max Input Tokens Max Output Tokens Image Input Reasoning Tool Calling
mistral-large-latest 262,144 262,144 Yes No Yes
mistral-large-2512 262,144 262,144 Yes No Yes
mistral-small-latest 128,000 16,384 Yes No Yes
mistral-medium-latest 128,000 16,384 Yes No Yes
mistral-nemo 128,000 128,000 No No Yes
codestral-latest 256,000 4,096 No No Yes
magistral-small 128,000 128,000 No Yes Yes
magistral-medium-latest 128,000 16,384 No Yes Yes
mistral-embed 8,000 3,072 No No No
open-mixtral-8x22b 64,000 64,000 No No Yes

Usage Examples

Accessing a Model Profile

from langchain_mistralai.data._profiles import _PROFILES

profile = _PROFILES.get("mistral-large-latest")
print(profile["max_input_tokens"])   # 262144
print(profile["tool_calling"])       # True
print(profile["image_inputs"])       # True

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment