Skip to main content
View source

xAI

View as Markdown

A RocketRide LLM node that connects xAI Grok models to a pipeline.

What it does

Provides xAI's Grok models as an llm invoke connection for agents and other nodes that need a language model. The node can also be used directly via lanes: send text on the questions lane and receive a generated completion on the answers lane.

Uses langchain-xai (ChatXAI) under the hood. The chat client is always initialized with temperature=0, and max_tokens is set from the selected profile's output-token limit.

When the node config is saved, a minimal validation probe (a single-word prompt) is sent to the xAI API to verify the API key and model. Provider and HTTP errors are parsed into a readable Error <code>: <message> warning instead of failing silently.

Lanes

Lane inLane outDescription
questionsanswersSend a question directly, receive a generated answer

Profiles

Default: Grok 3 (grok-3).

ProfileModelContextOutput
grok-3 (default)grok-3131,072131,072
grok-4-5grok-4.5500,000450,000
grok-4-20grok-4.202,000,0001,800,000
grok-4-20-multi-agentgrok-4.20-multi-agent2,000,0001,800,000
View 17 more models
ProfileModelContextOutput
custom(user-specified)131,072editable
grok-4-1-fast-reasoninggrok-4-1-fast-reasoning2,000,0004,096
grok-4-1-fast-non-reasoninggrok-4-1-fast-non-reasoning2,000,0004,096
grok-code-fast-1grok-code-fast-1256,00010,000
grok-4-fast-reasoninggrok-4-fast-reasoning2,000,0004,096
grok-4-fast-non-reasoninggrok-4-fast-non-reasoning2,000,0004,096
grok-4grok-4-0709256,000256,000
grok-3-minigrok-3-mini131,072131,072
grok-3-beta (deprecated)grok-3-beta131,072131,072
grok-3-mini-beta (deprecated)grok-3-mini-beta131,072131,072
grok-4-1-fast (deprecated)grok-4.1-fast2,000,00030,000
grok-4-fast (deprecated)grok-4-fast2,000,00030,000
grok-4-3grok-4.31,000,000900,000
grok-build-0-1grok-build-0.1256,000230,400
grok-latestgrok-latest500,000450,000
grok-4-3-batchgrok-4.3:batch1,000,000900,000
grok-4-6grok-4.6500,000450,000

The grok-3-beta, grok-3-mini-beta, grok-4-fast, grok-4-1-fast, grok-4-20, and grok-4-20-multi-agent profiles use OpenRouter-style model IDs and expose the API key field for that source.

Configuration

Choose a profile to set the model, context limit, and output limit. Built-in profiles keep those values fixed, while custom exposes the model ID and context limit for another xAI model.

Custom models

For custom, enter an xAI model ID and a positive context limit. The initial context value is 131,072 tokens; the output limit is not preset.

Authentication

For xAI-hosted profiles, provide an xAI API key in the apikey field. The key is validated at pipeline start: it must begin with the xai- prefix, otherwise the node raises Invalid XAI API key format, please check your API key. OpenRouter-sourced profiles use the key field exposed for that source instead.

The key is also checked at save time with a minimal probe request, so invalid keys, unknown models, or network problems surface as warnings in the UI before the pipeline runs.


Upstream docs


Schema

FieldTypeDescriptionDefault
modelstringModel
xAI model
modelTotalTokensnumberTokens
Total Tokens
xai.profilestringModel
LLM model
"grok-3"

Dependencies

  • langchain-xai
  • langchain-core
  • langchain