Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

LatticeDB can be used in multiple environments: as a Rust library, a standalone server, or in the browser via WebAssembly.

Rust Library

Add LatticeDB to your Cargo.toml:

[dependencies]
lattice-core = "0.1"
lattice-storage = "0.1"

For server applications with HTTP endpoints:

[dependencies]
lattice-server = "0.1"

Standalone Server

Pre-built Binaries

Download pre-built binaries from the releases page:

  • lattice-db-linux-x64 - Linux (x86_64)
  • lattice-db-macos-x64 - macOS (Intel)
  • lattice-db-macos-arm64 - macOS (Apple Silicon)
  • lattice-db-windows-x64 - Windows (x86_64)

From Source

# Clone the repository
git clone https://github.com/Avarok-Cybersecurity/lattice-db.git
cd lattice-db

# Build release binary
cargo build --release -p lattice-server

# Binary is at target/release/lattice-server

Running the Server

# Start server on default port 6333
./lattice-server

# Or specify a custom port
./lattice-server --port 8080

WASM / Browser

NPM Package

npm install lattice-db

CDN

<script type="module">
  import init, { LatticeDB } from 'https://unpkg.com/lattice-db/lattice_db.js';

  await init();
  const db = new LatticeDB();
</script>

Build from Source

# Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

# Build WASM package
wasm-pack build crates/lattice-server --target web --out-dir pkg --no-default-features --features wasm

Docker

docker run -p 6333:6333 Avarok-Cybersecurity/lattice-db:latest

System Requirements

Native

  • Rust 1.75+ (for building from source)
  • 64-bit OS (Linux, macOS, or Windows)
  • 2GB RAM minimum (varies by dataset size)

WASM

  • Modern browser with WebAssembly support:
    • Chrome 89+
    • Firefox 89+
    • Safari 15+
    • Edge 89+
  • SIMD support recommended for best performance (enabled by default in modern browsers)

Feature Flags

LatticeDB uses feature flags for optional functionality:

FeatureDescriptionDefault
simdSIMD-accelerated distance calculationsEnabled
mmapMemory-mapped vector storageDisabled
openapiOpenAPI/Swagger documentationDisabled

Enable features in Cargo.toml:

[dependencies]
lattice-core = { version = "0.1", features = ["simd", "mmap"] }

Verify Installation

Native

# Run tests
cargo test --workspace

# Run benchmarks
cargo run -p lattice-bench --release --example quick_vector_bench

WASM

# Run WASM tests in headless Chrome
wasm-pack test --headless --chrome crates/lattice-core

Next Steps