Install and configure Ollama for local embeddings with GrepAI. Use this skill when setting up private, local embedding generation.
This skill covers installing and configuring Ollama as the local embedding provider for GrepAI. Ollama enables 100% private code search where your code never leaves your machine.
| Benefit | Description |
|---|---|
| ๐ Privacy | Code never leaves your machine |
| ๐ฐ Free | No API costs |
| โก Fast | Local processing, no network latency |
| ๐ Offline | Works without internet |
# Install Ollama
brew install ollama
# Start the Ollama service
ollama serve
.dmg and drag to Applications# One-line installer
curl -fsSL https://ollama.com/install.sh | sh
# Start the service
ollama serve
GrepAI requires an embedding model to convert code into vectors.
# Download the recommended model (768 dimensions)
ollama pull nomic-embed-text
Specifications:
# Multilingual support (better for non-English code/comments)
ollama pull nomic-embed-text-v2-moe
# Larger, more accurate
ollama pull bge-m3
# Maximum quality
ollama pull mxbai-embed-large
| Model | Dimensions | Size | Best For |
|---|---|---|---|
nomic-embed-text |
768 | 274 MB | General code search |
nomic-embed-text-v2-moe |
768 | 500 MB | Multilingual codebases |
bge-m3 |
1024 | 1.2 GB | Large codebases |
mxbai-embed-large |
1024 | 670 MB | Maximum accuracy |
# Check if Ollama server is responding
curl http://localhost:11434/api/tags
# Expected output: JSON with available models
ollama list
# Output:
# NAME ID SIZE MODIFIED
# nomic-embed-text:latest abc123... 274 MB 2 hours ago
# Quick test (should return embedding vector)
curl http://localhost:11434/api/embeddings -d '{
"model": "nomic-embed-text",
"prompt": "function hello() { return world; }"
}'
After installing Ollama, configure GrepAI to use it:
# .grepai/config.yaml
embedder:
provider: ollama
model: nomic-embed-text
endpoint: http://localhost:11434
This is the default configuration when you run grepai init, so no changes are needed if using nomic-embed-text.
# Run in current terminal (see logs)
ollama serve
# Using nohup
nohup ollama serve &
# Or as a systemd service (Linux)
sudo systemctl enable ollama
sudo systemctl start ollama
# Check if running
pgrep -f ollama
# Or test the API
curl -s http://localhost:11434/api/tags | head -1
Embedding models load into RAM:
nomic-embed-text: ~500 MB RAMbge-m3: ~1.5 GB RAMmxbai-embed-large: ~1 GB RAMOllama uses CPU by default. For faster embeddings:
โ Problem: connection refused to localhost:11434
โ
Solution: Start Ollama:
ollama serve
โ Problem: Model not found โ Solution: Pull the model first:
ollama pull nomic-embed-text
โ Problem: Slow embedding generation โ Solution:
ollama ps)โ Problem: Out of memory โ Solution: Use a smaller model or increase system RAM
ollama serve is runningnomic-embed-text offers best balanceollama pull nomic-embed-text for updatesAfter successful setup:
โ
Ollama Setup Complete
Ollama Version: 0.1.x
Endpoint: http://localhost:11434
Model: nomic-embed-text (768 dimensions)
Status: Running
GrepAI is ready to use with local embeddings.
Your code will never leave your machine.