Skip to main content

langchain-sail

LangChain integration for Sail, a drop-in replacement for Apache Spark.

Installation

For the recommended lightweight Spark Connect client:

pip install "langchain-sail[spark]"

This installs pyspark-client==4.2.0 without the JVM components included in the full PySpark distribution.

If you need a different PySpark version, install the base package and your preferred PySpark distribution separately:

pip install langchain-sail

To run a local Sail server for development or testing, also install pysail:

pip install pysail

Usage

from pysail.spark import SparkConnectServer
from pyspark.sql import SparkSession
from langchain_sail import SailSQL, SailSQLToolkit, create_sail_sql_agent

# Start a local Sail server
server = SparkConnectServer()
server.start()
_, port = server.listening_address

# Connect via SailSQL
spark = SparkSession.builder.remote(f"sc://localhost:{port}").getOrCreate()
sail = SailSQL(spark_session=spark)

# Use with an LLM agent
from langchain_anthropic import ChatAnthropic

llm = ChatAnthropic(model="claude-sonnet-4-6")
toolkit = SailSQLToolkit(db=sail, llm=llm)
agent = create_sail_sql_agent(llm=llm, toolkit=toolkit, verbose=True)

result = agent.invoke({"input": "What tables are available?"})
print(result["output"])

What is Sail?

Sail is a drop-in replacement for Apache Spark, written in Rust. It uses the Spark Connect protocol, so existing PySpark code works out of the box — just point your SparkSession at a Sail server instead of a Spark cluster.

Release files for langchain-sail 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-sail 0.2.1
File Size Uploaded
langchain_sail-0.2.1.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-sail 0.2.1
File Interpreter ABI Platform
langchain_sail-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.9 kB

Release files / langchain_sail-0.2.1.tar.gz

Download URL langchain_sail-0.2.1.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
596f2b1c9c4b787708a47564d9076bba1ae96d02c9b45e4582baa1c85cc8c25b
BLAKE2b-256 checksum
How to use checksums
2fe337a36d16f6e47df73d96285c883906913138ccc84db5937bf49dbfcc8407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release files / langchain_sail-0.2.1-py3-none-any.whl

Download URL langchain_sail-0.2.1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65d14d3a7b00b09bab6548e5ff44d19df688e7bb4be1a4adb7d89e8d8c86b272
BLAKE2b-256 checksum
How to use checksums
f1a5b82c1e0cbee6e5200fc996127f6407d35ea4e33ef441f266f2a2d721041c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page