Implementation:Langchain ai Langchain XAI Model Profiles
| Knowledge Sources | |
|---|---|
| Domains | LLM Integration, Model Configuration, xAI |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Auto-generated model profile data for xAI's Grok family of models, defining capabilities and token limits used by ChatXAI.
Description
_PROFILES is a module-level dictionary in the langchain-xai partner package that contains auto-generated model profile metadata for all supported xAI Grok models. Each profile maps a model name to a dictionary of capability flags and token limits (max input/output tokens, supported input/output modalities, reasoning output, and tool calling support). This data is derived from the models.dev project and is consumed by ChatXAI to populate ModelProfile objects for LangChain's model profile registry.
This file is auto-generated by the langchain-profiles CLI tool and should not be edited manually.
Usage
This module is imported internally by ChatXAI during model initialization. It is not intended for direct external use, but can be referenced to understand the capabilities of supported xAI models.
Code Reference
Source Location
- Repository: Langchain_ai_Langchain
- File: libs/partners/xai/langchain_xai/data/_profiles.py
- Lines: 1-327
Signature
_PROFILES: dict[str, dict[str, Any]] = {
"grok-4-fast-non-reasoning": { ... },
"grok-3-fast": { ... },
"grok-4": { ... },
...
}
Import
from langchain_xai.data._profiles import _PROFILES
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | - | - | This is a static data module with no inputs. |
Outputs
| Name | Type | Description |
|---|---|---|
| _PROFILES | dict[str, dict[str, Any]] | Dictionary mapping model names to their capability profiles. |
Supported Models
| Model Name | Max Input Tokens | Max Output Tokens | Image Inputs | Reasoning Output | Tool Calling |
|---|---|---|---|---|---|
| grok-4 | 256,000 | 64,000 | No | Yes | Yes |
| grok-4-fast | 2,000,000 | 30,000 | Yes | Yes | Yes |
| grok-4-fast-non-reasoning | 2,000,000 | 30,000 | Yes | No | Yes |
| grok-4-1-fast | 2,000,000 | 30,000 | Yes | Yes | Yes |
| grok-4-1-fast-non-reasoning | 2,000,000 | 30,000 | Yes | No | Yes |
| grok-3 | 131,072 | 8,192 | No | No | Yes |
| grok-3-fast | 131,072 | 8,192 | No | No | Yes |
| grok-3-mini | 131,072 | 8,192 | No | Yes | Yes |
| grok-3-mini-fast | 131,072 | 8,192 | No | Yes | Yes |
| grok-2 | 131,072 | 8,192 | No | No | Yes |
| grok-2-vision | 8,192 | 4,096 | Yes | No | Yes |
| grok-code-fast-1 | 256,000 | 10,000 | No | Yes | Yes |
| grok-beta | 131,072 | 4,096 | No | No | Yes |
| grok-vision-beta | 8,192 | 4,096 | Yes | No | Yes |
Profile Schema
Each profile dictionary contains the following keys:
| Key | Type | Description |
|---|---|---|
| max_input_tokens | int | Maximum number of input tokens the model can accept. |
| max_output_tokens | int | Maximum number of output tokens the model can generate. |
| text_inputs | bool | Whether the model supports text inputs. |
| image_inputs | bool | Whether the model supports image inputs. |
| audio_inputs | bool | Whether the model supports audio inputs. |
| video_inputs | bool | Whether the model supports video inputs. |
| text_outputs | bool | Whether the model supports text outputs. |
| image_outputs | bool | Whether the model supports image outputs. |
| audio_outputs | bool | Whether the model supports audio outputs. |
| video_outputs | bool | Whether the model supports video outputs. |
| reasoning_output | bool | Whether the model supports reasoning output. |
| tool_calling | bool | Whether the model supports tool/function calling. |
Usage Examples
Inspecting Model Capabilities
from langchain_xai.data._profiles import _PROFILES
# Check grok-4 capabilities
grok4_profile = _PROFILES["grok-4"]
print(f"Max input tokens: {grok4_profile['max_input_tokens']}")
print(f"Max output tokens: {grok4_profile['max_output_tokens']}")
print(f"Supports reasoning: {grok4_profile['reasoning_output']}")
print(f"Supports tool calling: {grok4_profile['tool_calling']}")