Quick Start

Install

curl -fsSL https://raw.githubusercontent.com/duanfuxiang0/lanbuffer-release/main/install.sh | bash

Install a specific version:

curl -fsSL https://raw.githubusercontent.com/duanfuxiang0/lanbuffer-release/main/install.sh | bash -s -- --version vX.Y.Z

Uninstall:

curl -fsSL https://raw.githubusercontent.com/duanfuxiang0/lanbuffer-release/main/install.sh | bash -s -- --uninstall

Configure

The installer automatically generates a default config and .env template in ~/.config/lanbuffer/.

You can also generate them manually:

lanbuffer init

Edit ~/.config/lanbuffer/.env with your credentials:

# Required
LANBUFFER_PASSWORD=your_encryption_password
STORAGE_URL=s3://your-bucket/lanbuffer-data

# AWS / S3-compatible credentials
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key

Optionally review ~/.config/lanbuffer/lanbuffer.toml — the defaults work for most setups.

Example lanbuffer.toml:

[cache]
dir = "${HOME}/.cache/lanbuffer"
disk_size_gb = 10.0
memory_size_gb = 1.0

[storage]
url = "${STORAGE_URL}"
encryption_password = "${LANBUFFER_PASSWORD}"

[filesystem]
compression = "lz4"

[servers.nfs]
addresses = ["127.0.0.1:2049"]

[servers.table]
addresses = ["127.0.0.1:7001"]

[servers.kv]
addresses = ["127.0.0.1:7002"]

[aws]
access_key_id = "${AWS_ACCESS_KEY_ID}"
secret_access_key = "${AWS_SECRET_ACCESS_KEY}"

Run

lanbuffer run

The config file is auto-detected from ./lanbuffer.toml or ~/.config/lanbuffer/lanbuffer.toml. The .env file in the same directory is loaded automatically.

You can also specify paths explicitly:

lanbuffer run -c /path/to/lanbuffer.toml --env-file /path/to/.env

Usage Examples

Table API (LanceDB-like)

LanBuffer provides a LanceDB-compatible Table API for structured data and vector search.

Note: The upstream LanceDB SDK is not compatible with LanBuffer. You must use the modified @lancedb/lancedb SDK from this repository, which adds the lanbuff:// protocol. Build it from source in the nodejs/ directory.

cd nodejs && npm install && npm run build
import * as lancedb from "@lancedb/lancedb";

// Connect to LanBuffer Table API via lanbuff:// protocol
const db = await lancedb.connect("lanbuff://127.0.0.1:7001");

// Create a table
const tbl = await db.createTable(
  "items",
  [
    { vector: [3.1, 4.1], item: "foo", price: 10.0 },
    { vector: [5.9, 26.5], item: "bar", price: 20.0 },
  ],
  { mode: "overwrite" },
);

// Vector search
const results = await tbl.search([3.0, 4.0]).limit(5).toArray();
console.log(results);

// Add data
await tbl.add([
  { vector: [1.3, 1.4], item: "fizz", price: 100.0 },
]);

// SQL filter
const filtered = await tbl
  .search([3.0, 4.0])
  .where("price < 50")
  .limit(10)
  .toArray();

// List tables
const tables = await db.tableNames();
console.log(tables);

// Drop table
await db.dropTable("items");

You can also verify the Table API directly via HTTP:

# Health check
curl http://127.0.0.1:7001/health

# List tables
curl http://127.0.0.1:7001/v1/table

KV API

# Put a value
curl -X PUT http://127.0.0.1:7002/kv/v1/keys/hello -d 'world'

# Get a value
curl http://127.0.0.1:7002/kv/v1/keys/hello

# Prefix scan
curl "http://127.0.0.1:7002/kv/v1/keys?prefix=user:&limit=10"

FileSystem Mount

sudo mount -t nfs -o port=2049,mountport=2049,nfsvers=3,tcp 127.0.0.1:/ /mnt/lanbuffer

Build from Source

cargo build --release -p lanbuffer

Supported Backends

BackendURL Format
AWS S3s3://bucket-name
Cloudflare R2https://account.r2.cloudflarestorage.com/bucket
Google GCSgs://bucket-name
Azure Blobaz://container-name