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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_sail-0.2.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_sail-0.2.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_sail-0.2.1.tar.gz.

File metadata

  • Download URL: langchain_sail-0.2.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for langchain_sail-0.2.1.tar.gz
Algorithm Hash digest
SHA256 596f2b1c9c4b787708a47564d9076bba1ae96d02c9b45e4582baa1c85cc8c25b
MD5 68fef9623bfbb488cff09cd4bef08e81
BLAKE2b-256 2fe337a36d16f6e47df73d96285c883906913138ccc84db5937bf49dbfcc8407

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_sail-0.2.1.tar.gz:

Publisher: release.yml on lakehq/langchain-sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_sail-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: langchain_sail-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for langchain_sail-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65d14d3a7b00b09bab6548e5ff44d19df688e7bb4be1a4adb7d89e8d8c86b272
MD5 4302e86f26a927820b585a177484c3f7
BLAKE2b-256 f1a5b82c1e0cbee6e5200fc996127f6407d35ea4e33ef441f266f2a2d721041c

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_sail-0.2.1-py3-none-any.whl:

Publisher: release.yml on lakehq/langchain-sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page