Skip to main content

Next-Gen Hybrid Python/Rust Data Platform with MLX

Project description

LlamaDB

High-performance vector database optimized for AI workloads with MLX acceleration for Apple Silicon.

LlamaDB Logo

Overview

LlamaDB is a next-generation vector database designed for AI applications with a focus on performance, ease of use, and platform-specific optimizations. It provides:

  • 🚀 High-performance vector search - Fast similarity search for embeddings
  • 🍎 MLX acceleration - Up to 10x speedup on Apple Silicon devices
  • 🦀 Rust extensions - Critical paths implemented in Rust for maximum performance
  • 🐍 Python-first API - Simple, intuitive API with Python at its core
  • 🔌 REST API - Easy integration with any language or framework

Quick Start

Installation

# Clone the repository
git clone https://github.com/yourusername/llamadb.git
cd llamadb

# Set up development environment
./setup_dev_environment.sh

# Activate the virtual environment
source .venv/bin/activate

Run the Quickstart Demo

python quickstart.py

This will demonstrate basic vector operations, similarity search, and performance benchmarks.

Start the API Server

# Start the server
python api_launcher.py --start

# Check status
python api_launcher.py --status

# Stop the server
python api_launcher.py --stop

Core Features

Vector Index

The VectorIndex class provides efficient similarity search:

from llamadb.core import VectorIndex

# Create a new index with 128-dimensional vectors
index = VectorIndex(dimension=128)

# Add vectors with metadata
index.add_item(embedding, {"id": 1, "text": "Document content", "category": "Technology"})

# Search for similar vectors
results = index.search(query_vector, k=10)

Accelerated Operations

LlamaDB provides optimized vector operations:

from llamadb.core import cosine_similarity, l2_distance, dot_product

# Calculate similarity between vectors
similarity = cosine_similarity(vector_a, vector_b)
distance = l2_distance(vector_a, vector_b)
dot = dot_product(vector_a, vector_b)

MLX Acceleration

On Apple Silicon devices, LlamaDB automatically uses MLX for acceleration:

from llamadb.core import is_mlx_available, is_apple_silicon

if is_apple_silicon():
    print("Running on Apple Silicon")
    
if is_mlx_available():
    print("MLX acceleration is available")

Development

For development instructions, see DEVELOPER.md.

Utility Scripts

LlamaDB includes several utility scripts:

# Setup development environment
./setup_dev_environment.sh

# Run comprehensive tests
python test_llamadb.py --benchmark --plot

# Manage API server
python api_launcher.py --start

Command Line Utilities

The commands.sh script provides common operations:

# Show help information
./commands.sh help

# Set up development environment
./commands.sh setup

# Run tests
./commands.sh test

# Run benchmarks
./commands.sh benchmark

# Run quickstart demo
./commands.sh quickstart

API Server

LlamaDB includes a REST API server for language-agnostic access:

Start the server

python api_launcher.py --start

API Endpoints

  • GET /health - Health check
  • GET /system - System information
  • GET /index - Index information
  • POST /search - Search for similar vectors

Example search request:

{
  "vector": [0.1, 0.2, 0.3, ...],
  "k": 10
}

Performance

LlamaDB is designed for performance:

Operation NumPy MLX (Apple Silicon) Speedup
Cosine Similarity 5µs 0.5µs 10x
Matrix Multiply (1000x1000) 50ms 5ms 10x
Search (10k vectors) 10ms 1ms 10x

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • MLX - For the Apple Silicon acceleration
  • NumPy - For fundamental array operations
  • FastAPI - For the REST API server

Project details


Download files

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

Source Distribution

llamadb_llamasearch-0.1.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

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

llamadb_llamasearch-0.1.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file llamadb_llamasearch-0.1.0.tar.gz.

File metadata

  • Download URL: llamadb_llamasearch-0.1.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for llamadb_llamasearch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c384ace13e91ac3f99a50021c577fe1318a6370da0eed5695069d159cc14d901
MD5 c31565356e7c223a4db9e2f15585bd65
BLAKE2b-256 4ad567e4fcc7bdd2590adbae530e5aa8c036565e0d6a8f71e98dfddab35f2304

See more details on using hashes here.

File details

Details for the file llamadb_llamasearch-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llamadb_llamasearch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8befeedd2b0eca71db070f4002f6a1c6c4e277e92e186719c1c7843f8be2b836
MD5 c637855b68d2f9f8bf22d4c7dcf0ff5c
BLAKE2b-256 54ffe85bc8e5d79940847b7e1bc06ef26b9d8e8a7076b6dcab6fcd9a34d396ba

See more details on using hashes here.

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