diff --git a/README.md b/README.md index 5b08fac..7db3882 100755 --- a/README.md +++ b/README.md @@ -98,6 +98,27 @@ uv sync +### 🆕 Using Ollama for Embeddings (Privacy-Focused) + +LEANN now supports Ollama for generating embeddings locally, perfect for privacy-sensitive applications: + +```bash +# First, pull an embedding model from Ollama +ollama pull nomic-embed-text # or mxbai-embed-large, bge-m3, etc. + +# Build an index using Ollama embeddings +leann build my-project --docs ./documents --embedding-model nomic-embed-text --embedding-mode ollama + +# Use with example apps +python -m apps.document_rag --embedding-model nomic-embed-text --embedding-mode ollama --query "Your question" +``` + +**Available Ollama Embedding Models:** +- `nomic-embed-text`: High-performing 768-dim embeddings +- `mxbai-embed-large`: Large 1024-dim embeddings +- `bge-m3`: Multilingual embeddings +- See [Ollama library](https://ollama.com/library) for more embedding models + ## Quick Start Our declarative API makes RAG as easy as writing a config file. @@ -189,8 +210,8 @@ All RAG examples share these common parameters. **Interactive mode** is availabl --force-rebuild # Force rebuild index even if it exists # Embedding Parameters ---embedding-model MODEL # e.g., facebook/contriever, text-embedding-3-small or mlx-community/multilingual-e5-base-mlx ---embedding-mode MODE # sentence-transformers, openai, or mlx +--embedding-model MODEL # e.g., facebook/contriever, text-embedding-3-small, nomic-embed-text, or mlx-community/multilingual-e5-base-mlx +--embedding-mode MODE # sentence-transformers, openai, mlx, or ollama # LLM Parameters (Text generation models) --llm TYPE # LLM backend: openai, ollama, or hf (default: openai) diff --git a/docs/configuration-guide.md b/docs/configuration-guide.md index 8d910f6..95cb3f0 100644 --- a/docs/configuration-guide.md +++ b/docs/configuration-guide.md @@ -49,14 +49,25 @@ Based on our experience developing LEANN, embedding models fall into three categ - **Cons**: Slower inference, longer index build times - **Use when**: Quality is paramount and you have sufficient compute resources. **Highly recommended** for production use -### Quick Start: OpenAI Embeddings (Fastest Setup) +### Quick Start: Cloud and Local Embedding Options +**OpenAI Embeddings (Fastest Setup)** For immediate testing without local model downloads: ```bash # Set OpenAI embeddings (requires OPENAI_API_KEY) --embedding-mode openai --embedding-model text-embedding-3-small ``` +**Ollama Embeddings (Privacy-Focused)** +For local embeddings with complete privacy: +```bash +# First, pull an embedding model +ollama pull nomic-embed-text + +# Use Ollama embeddings +--embedding-mode ollama --embedding-model nomic-embed-text +``` +
Cloud vs Local Trade-offs