ruvector/scripts
Reuven 72493c7abd feat: Complete LLM system with Candle, MicroLoRA, NEON kernels
Implements a full LLM inference and fine-tuning system optimized for Mac M4 Pro:

## New Crates
- ruvllm-cli: CLI tool with download, serve, chat, benchmark commands

## Backends (crates/ruvllm/src/backends/)
- LlmBackend trait for pluggable inference backends
- CandleBackend with Metal acceleration, GGUF quantization, HF Hub

## MicroLoRA (crates/ruvllm/src/lora/)
- Rank 1-2 adapters for <1ms per-request adaptation
- EWC++ regularization to prevent catastrophic forgetting
- Hot-swap adapter registry with composition strategies
- Training pipeline with LR schedules (Constant, Cosine, OneCycle)

## NEON Kernels (crates/ruvllm/src/kernels/)
- Flash Attention 2 with online softmax
- Paged Attention for KV cache efficiency
- Multi-Query (MQA) and Grouped-Query (GQA) attention
- RoPE with precomputed tables and NTK-aware scaling
- RMSNorm and LayerNorm with batched variants
- GEMV, GEMM, batched GEMM with 4x unrolling

## Real-time Optimization (crates/ruvllm/src/optimization/)
- SONA-LLM with 3 learning loops (instant <1ms, background ~100ms, deep)
- RealtimeOptimizer with dynamic batch sizing
- KV cache pressure policies (Evict, Quantize, Reject, Spill)
- Metrics collection with moving averages and histograms

## Benchmarks
- 6 Criterion benchmark suites for M4 Pro profiling
- Runner script with baseline comparison

## Tests
- 297 total tests (171 unit + 126 integration)
- Full coverage of backends, LoRA, kernels, SONA, e2e

## Recommended Models for 48GB M4 Pro
- Primary: Qwen2.5-14B-Instruct (Q8, 15-25 t/s)
- Fast: Mistral-7B-Instruct-v0.3 (Q8, 30-45 t/s)
- Tiny: Phi-4-mini (Q4, 40-60 t/s)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:04:21 -05:00
..
build feat: Update NAPI-RS bindings with new capabilities (v0.1.15) 2025-11-26 18:47:48 +00:00
patches/hnsw_rs Add WebAssembly binary and TypeScript definitions for rvlite 2025-12-25 19:50:53 +00:00
check-and-publish-router-wasm.sh feat: Phase 3 - WASM architecture with in-memory storage 2025-11-21 13:40:34 +00:00
ci-sync-lockfile.sh feat: Add automated package-lock.json sync tooling 2025-11-25 21:24:14 +00:00
deploy.sh feat: Implement GNN forgetting mitigation (#17) 2025-11-26 23:17:07 +00:00
DEPLOYMENT-QUICKSTART.md feat: Implement GNN forgetting mitigation (#17) 2025-11-26 23:17:07 +00:00
DEPLOYMENT.md feat: Implement GNN forgetting mitigation (#17) 2025-11-26 23:17:07 +00:00
install-hooks.sh feat: Add automated package-lock.json sync tooling 2025-11-25 21:24:14 +00:00
publish-all.sh feat(math): Add ruvector-math crate with advanced algorithms (#109) 2026-01-11 12:01:40 -05:00
publish-cli.sh docs: update CLAUDE.md with RuVector hooks config, add hooks to npm README 2025-12-29 22:31:11 +00:00
publish-crates.sh feat: Phase 3 - WASM architecture with in-memory storage 2025-11-21 13:40:34 +00:00
publish-router-wasm.sh feat: Phase 3 - WASM architecture with in-memory storage 2025-11-21 13:40:34 +00:00
README.md feat: Implement GNN forgetting mitigation (#17) 2025-11-26 23:17:07 +00:00
run_benchmarks.sh docs: Add comprehensive benchmark results and CI script 2026-01-18 17:01:06 -05:00
run_llm_benchmarks.sh feat: Complete LLM system with Candle, MicroLoRA, NEON kernels 2026-01-18 21:04:21 -05:00
sync-lockfile.sh docs: update CLAUDE.md with RuVector hooks config, add hooks to npm README 2025-12-29 22:31:11 +00:00
test-all-graph-commands.sh feat: Add Neo4j-compatible hypergraph database package (ruvector-graph) 2025-11-25 23:11:54 +00:00
test-deploy.sh feat: Implement GNN forgetting mitigation (#17) 2025-11-26 23:17:07 +00:00
test-docker-package.sh fix: Export new NAPI functions in native wrapper 2025-11-26 19:05:00 +00:00
test-graph-cli.sh feat: Add Neo4j-compatible hypergraph database package (ruvector-graph) 2025-11-25 23:11:54 +00:00
test-wasm.mjs fix: Update ruvector-math-wasm to use @ruvector/math-wasm scoped package 2026-01-11 17:21:16 +00:00
validate-packages-simple.sh feat: Prepare packages for npm publishing with comprehensive validation 2025-11-23 04:44:45 +00:00
validate-packages.sh feat: Prepare packages for npm publishing with comprehensive validation 2025-11-23 04:44:45 +00:00
verify-paper-impl.sh feat(mincut): Add subpolynomial-time dynamic minimum cut system (#74) 2025-12-23 07:53:32 -05:00
verify_hnsw_build.sh feat(postgres): Add ruvector-postgres extension with SIMD optimizations (#42) 2025-12-02 09:55:07 -05:00

RuVector Automation Scripts

This directory contains automation scripts to streamline development, deployment, and prevent common issues.

📜 Available Scripts

🚀 deploy.sh

Comprehensive deployment script for publishing to crates.io and npm.

Handles:

  • Version management and synchronization
  • Pre-deployment checks (tests, linting, formatting)
  • WASM package builds
  • Crate publishing to crates.io
  • NPM package publishing
  • GitHub Actions trigger for cross-platform builds

Usage:

# Full deployment
./scripts/deploy.sh

# Dry run (test without publishing)
./scripts/deploy.sh --dry-run

# See all options
./scripts/deploy.sh --help

See: DEPLOYMENT.md for complete documentation

🧪 test-deploy.sh

Tests the deployment script without publishing.

Usage: ./scripts/test-deploy.sh

🔄 sync-lockfile.sh

Automatically syncs package-lock.json with package.json changes.

Usage: ./scripts/sync-lockfile.sh

🪝 install-hooks.sh

Installs git hooks for automatic lock file management.

Usage: ./scripts/install-hooks.sh

🤖 ci-sync-lockfile.sh

CI/CD script for automatic lock file fixing.

Usage: ./scripts/ci-sync-lockfile.sh

📦 publish-crates.sh

Legacy script for publishing individual crates. Use deploy.sh instead.

🧭 validate-packages.sh

Validates package configurations and dependencies.

🚀 Quick Start

For Development

  1. Install git hooks (recommended):

    ./scripts/install-hooks.sh
    
  2. Test the hook:

    cd npm/packages/ruvector
    npm install chalk
    git add package.json
    git commit -m "test: Add chalk dependency"
    # Hook automatically updates lock file
    

For Deployment

  1. Test deployment script:

    ./scripts/test-deploy.sh
    
  2. Set credentials (required):

    export CRATES_API_KEY="your-crates-io-token"
    export NPM_TOKEN="your-npm-token"
    
  3. Run dry run (recommended first):

    ./scripts/deploy.sh --dry-run
    
  4. Deploy:

    ./scripts/deploy.sh
    

📖 Documentation

🔐 Security

Never commit credentials! Always use environment variables or secure credential storage.

See DEPLOYMENT.md#security-best-practices for details.