$npx skillfedfor your agent

langchain-xai

An integration package connecting xAI and LangChain

With conditionsPyPI Artificial IntelligenceReleased Jul 20261.1M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — langchain_xai-1.3.0-py3-none-any.whl
v1.3.0 · released 2026-07-21 · Python <4.0.0,>=3.10.0 · 4 runtime deps: aiohttp, langchain-core, langchain-openai, requests

Yes, if you are building a LangChain application and want to use xAI models. The package is actively maintained, has no known vulnerabilities, low install friction, and permissive licensing. Install it when you have an xAI API key and need xAI model access within LangChain; skip it if you do not plan to use xAI models or are not using LangChain.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a valid xAI API key from https://console.x.ai and Python >= 3.10.0, < 4.0.0.
  • Low install friction with a pure Python wheel.
  • Actively maintained as of 24 days ago with a recent release on 2026-07-21.

License · maintenance · safety

MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

last release 2026-07-21 (24 days) · last repo commit 2026-08-14 · 144,267 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,109,895 downloads/mo, #4,356 on PyPI

Verify before relying

pip install langchain-xai

from langchain_xai import ChatXAI

chat = ChatXAI(api_key="your-xai-api-key")
response = chat.invoke("Hello")
  • Whether xAI model names and capabilities are documented in the package or require external reference.
  • Whether the package supports streaming, tool use, or other advanced LangChain features.
  • Cost and rate-limit behavior of xAI API calls through this integration.
Same gist for agents: .md · .json

What it is and what it does

langchain-xai is a LangChain integration package that bridges xAI's language models to the LangChain ecosystem. It provides a ChatXAI class and related components that allow developers to use xAI models within LangChain applications, enabling access to xAI's APIs through the standard LangChain interface.

The package depends on langchain-core for base abstractions, langchain-openai for compatible model patterns, and standard HTTP libraries (aiohttp, requests) for API communication. It targets modern Python versions (3.10 through 3.14) and is actively maintained by the LangChain team. Use it when you want to incorporate xAI models into a LangChain application without writing custom API integration code.

Use it for

  • Build a chatbot or conversational agent using xAI models within a LangChain application.
  • Chain xAI model calls with other LangChain tools, retrievers, or agents in a multi-step workflow.
  • Migrate or extend an existing LangChain application to include xAI as an alternative model provider.
  • Prototype or experiment with xAI models alongside other LLM providers in a unified LangChain interface.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are building a LangChain application and want to use xAI models.

The package is actively maintained, has no known vulnerabilities, low install friction, and permissive licensing. Install it when you have an xAI API key and need xAI model access within LangChain; skip it if you do not plan to use xAI models or are not using LangChain.

Install

langchain-xai on PyPI

Before you install

Low install friction with a pure Python wheel. Actively maintained as of 24 days ago with a recent release on 2026-07-21. Depends on langchain-core, langchain-openai, aiohttp, and requests—all stable, widely-used libraries.

Requires a valid xAI API key from https://console.x.ai and Python >= 3.10.0, < 4.0.0.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install langchain-xai

from langchain_xai import ChatXAI

chat = ChatXAI(api_key="your-xai-api-key")
response = chat.invoke("Hello")

Verify before relying

  • Whether xAI model names and capabilities are documented in the package or require external reference.
  • Whether the package supports streaming, tool use, or other advanced LangChain features.
  • Cost and rate-limit behavior of xAI API calls through this integration.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0.0,>=3.10.0
Install frictionLow. Pure-Python wheel
Runtime dependencies
4 packages
aiohttplangchain-corelangchain-openairequests
MaintenanceActively maintained 24 days since the last release
Last repo commit
First released
Downloads1,109,895 / month, #4,356 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial Intelligence

Evidence: langchain_xai-1.3.0-py3-none-any.whl

Tags

Capabilities
xai langchain integrationxai language model apilangchain xai connectorxai grok integrationlangchain provider xaixai llm integrationlangchain xai models
Topics
llm-integrationlangchain-provider

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “xai langchain integration”

  • langchain-xaiConnects xAI's language models to LangChain applications through…
  • livekit-plugins-xaiIntegrates xAI's Grok LLM with LiveKit's Agent Framework to enable…
  • xai-sdkOfficial Python SDK for xAI's APIs, providing synchronous and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also langchain-aws · langchain-openai · langchain-ollama · langchain-mistralai · langchain-openrouter · langchain-anthropic · langchain-fireworks · langchain-perplexity · langchain-deepseek · langchain-groq