[MLsys2026 Best Paper]: https://arxiv.org/abs/2506.08276. RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.
Python aifaissgpt-osslangchainllama-indexllmlocalstorageoffline-firstollamaprivacypythonragretrieval-augmented-generationvector-databasevector-searchvectors
fix: add missing scripts directory to git
Andy Lee3d4c75a56c26
diff --git a/.gitignore b/.gitignoreindex 9d37f9a..0acf5ce 100755--- a/.gitignore+++ b/.gitignore@@ -12,7 +12,6 @@ outputs/*.idx*.map.history/-scripts/lm_eval.egg-info/demo/experiment_results/**/*.json*.jsonldiff --git a/scripts/build_and_test.sh b/scripts/build_and_test.shnew file mode 100755index 0000000..b1c67c0--- /dev/null+++ b/scripts/build_and_test.sh@@ -0,0 +1,87 @@+#!/bin/bash++# Manual build and test script for local testing++PACKAGE=${1:-"all"} # Default to all packages++echo "Building package: $PACKAGE"++# Ensure we're in a virtual environment+if [ -z "$VIRTUAL_ENV" ]; then+ echo "Error: Please activate a virtual environment first"+ echo "Run: source .venv/bin/activate (or .venv/bin/activate.fish for fish shell)"+ exit 1+fi++# Install build tools+uv pip install build twine delocate auditwheel scikit-build-core cmake pybind11 numpy++build_package() {+ local package_dir=$1+ local package_name=$(basename $package_dir)++ echo "Building $package_name..."+ cd $package_dir++ # Clean previous builds+ rm -rf dist/ build/ _skbuild/++ # Build directly with pip wheel (avoids sdist issues)+ pip wheel . --no-deps -w dist++ # Repair wheel for binary packages+ if [[ "$package_name" != "leann-core" ]] && [[ "$package_name" != "leann" ]]; then+ if [[ "$OSTYPE" == "darwin"* ]]; then+ # For macOS+ for wheel in dist/*.whl; do+ if [[ -f "$wheel" ]]; then+ delocate-wheel -w dist_repaired -v "$wheel"+ fi+ done+ if [[ -d dist_repaired ]]; then+ rm -rf dist/*.whl+ mv dist_repaired/*.whl dist/+ rmdir dist_repaired+ fi+ else+ # For Linux+ for wheel in dist/*.whl; do+ if [[ -f "$wheel" ]]; then+ auditwheel repair "$wheel" -w dist_repaired+ fi+ done+ if [[ -d dist_repaired ]]; then+ rm -rf dist/*.whl+ mv dist_repaired/*.whl dist/+ rmdir dist_repaired+ fi+ fi+ fi++ echo "Built wheels in $package_dir/dist/"+ ls -la dist/+ cd - > /dev/null+}++# Build specific package or all+if [ "$PACKAGE" == "diskann" ]; then+ build_package "packages/leann-backend-diskann"+elif [ "$PACKAGE" == "hnsw" ]; then+ build_package "packages/leann-backend-hnsw"+elif [ "$PACKAGE" == "core" ]; then+ build_package "packages/leann-core"+elif [ "$PACKAGE" == "meta" ]; then+ build_package "packages/leann"+elif [ "$PACKAGE" == "all" ]; then+ build_package "packages/leann-core"+ build_package "packages/leann-backend-hnsw"+ build_package "packages/leann-backend-diskann"+ build_package "packages/leann"+else+ echo "Unknown package: $PACKAGE"+ echo "Usage: $0 [diskann|hnsw|core|meta|all]"+ exit 1+fi++echo -e "\nBuild complete! Test with:"+echo "uv pip install packages/*/dist/*.whl"\ No newline at end of filediff --git a/scripts/bump_version.sh b/scripts/bump_version.shnew file mode 100755index 0000000..0e831e9--- /dev/null+++ b/scripts/bump_version.sh@@ -0,0 +1,13 @@+#!/bin/bash++if [ $# -eq 0 ]; then+ echo "Usage: $0 <new_version>"+ exit 1+fi++NEW_VERSION=$1++# Update all pyproject.toml files+sed -i '' "s/version = \".*\"/version = \"$NEW_VERSION\"/" packages/*/pyproject.toml++echo "Version updated to $NEW_VERSION"\ No newline at end of filediff --git a/scripts/release.sh b/scripts/release.shnew file mode 100755index 0000000..9fa2b1e--- /dev/null+++ b/scripts/release.sh@@ -0,0 +1,18 @@+#!/bin/bash++if [ $# -eq 0 ]; then+ echo "Usage: $0 <version>"+ echo "Example: $0 0.1.1"+ exit 1+fi++VERSION=$1++# Update version+./scripts/bump_version.sh $VERSION++# Commit and push+git add . && git commit -m "chore: bump version to $VERSION" && git push++# Create release (triggers CI)+gh release create v$VERSION --generate-notes\ No newline at end of filediff --git a/scripts/upload_to_pypi.sh b/scripts/upload_to_pypi.shnew file mode 100755index 0000000..745cc61--- /dev/null+++ b/scripts/upload_to_pypi.sh@@ -0,0 +1,30 @@+#!/bin/bash++# Manual upload script for testing++TARGET=${1:-"test"} # Default to test pypi++if [ "$TARGET" != "test" ] && [ "$TARGET" != "prod" ]; then+ echo "Usage: $0 [test|prod]"+ exit 1+fi++# Check for built packages+if ! ls packages/*/dist/*.whl >/dev/null 2>&1; then+ echo "No built packages found. Run ./scripts/build_and_test.sh first"+ exit 1+fi++if [ "$TARGET" == "test" ]; then+ echo "Uploading to Test PyPI..."+ twine upload --repository testpypi packages/*/dist/*+else+ echo "Uploading to PyPI..."+ echo "Are you sure? (y/N)"+ read -r response+ if [ "$response" == "y" ]; then+ twine upload packages/*/dist/*+ else+ echo "Cancelled"+ fi+fi\ No newline at end of file