LlamaDB
High-performance vector database optimized for AI workloads with MLX acceleration for Apple Silicon.
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 checkGET /system- System informationGET /index- Index informationPOST /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
Metadata
Release files for llamadb-llamasearch 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llamadb_llamasearch-0.1.0.tar.gz | 32.3 kB | Without provenance | Details for llamadb_llamasearch-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llamadb_llamasearch-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llamadb_llamasearch-0.1.0-py3-none-any.whl |
Total release size: 64.0 kB
Release files / llamadb_llamasearch-0.1.0.tar.gz
| Download URL | llamadb_llamasearch-0.1.0.tar.gz |
|---|---|
| Size | 32.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c384ace13e91ac3f99a50021c577fe1318a6370da0eed5695069d159cc14d901
|
|
BLAKE2b-256 checksum How to use checksums |
4ad567e4fcc7bdd2590adbae530e5aa8c036565e0d6a8f71e98dfddab35f2304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / llamadb_llamasearch-0.1.0-py3-none-any.whl
| Download URL | llamadb_llamasearch-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8befeedd2b0eca71db070f4002f6a1c6c4e277e92e186719c1c7843f8be2b836
|
|
BLAKE2b-256 checksum How to use checksums |
54ffe85bc8e5d79940847b7e1bc06ef26b9d8e8a7076b6dcab6fcd9a34d396ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for llamadb-llamasearch 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.