Skip to main content
Version: 1.11.x

xAI

tip

This provider is an extra of the lfx-bundles metapackage. It is opt-in for both Langflow and standalone LFX installs:

uv pip install "lfx-bundles[<bundle>]"

Replace <bundle> with this page's provider name, for example qdrant. For a torch-free full Langflow install, run uv pip install "langflow[bundles]". For standalone LFX with every provider in lfx-bundles, including PyTorch-based providers, run uv pip install "lfx[bundles]". See Additional bundles for the exact extra name.

Bundles contain custom components that support specific third-party integrations with Langflow.

This page describes the components that are available in the xAI bundle.

For more information about xAI features and functionality used by xAI components, see the xAI documentation.

xAI text generation

The xAI component generates text using xAI models like Grok.

It can output either a Model Response (Message) or a Language Model (LanguageModel).

Use the Language Model output when you want to use an xAI model as the LLM for another LLM-driven component, such as an Agent or Smart Transform component.

For more information, see Language model components.

xAI text generation parameters

Some parameters are hidden by default in the visual editor. You can modify all component parameters through the component inspection panel that appears when you select a component.

NameTypeDescription
max_tokensIntegerInput parameter. Maximum number of tokens to generate. Set to 0 for unlimited. Range: 0-128000.
model_kwargsDictionaryInput parameter. Additional keyword arguments for the model.
json_modeBooleanInput parameter. If true, outputs JSON regardless of passing a schema.
model_nameStringInput parameter. The xAI model to use. Default: grok-2-latest.
base_urlStringInput parameter. Base URL for API requests. Default: https://api.x.ai/v1.
api_keySecretStringInput parameter. Your xAI API key for authentication.
temperatureFloatInput parameter. Controls randomness in the output. Range: [0.0, 2.0]. Default: 0.1.
seedIntegerInput parameter. Controls reproducibility of the job.

Was this page helpful?

Support
Search