grepai-embeddings-ollama
Configure Ollama as embedding provider for GrepAI. Use this skill for local, private embedding generation.
What this skill does
# GrepAI Embeddings with Ollama
This skill covers using Ollama as the embedding provider for GrepAI, enabling 100% private, local code search.
## When to Use This Skill
- Setting up private, local embeddings
- Choosing the right Ollama model
- Optimizing Ollama performance
- Troubleshooting Ollama connection issues
## Why Ollama?
| Advantage | Description |
|-----------|-------------|
| š **Privacy** | Code never leaves your machine |
| š° **Free** | No API costs or usage limits |
| ā” **Speed** | No network latency |
| š **Offline** | Works without internet |
| š§ **Control** | Choose your model |
## Prerequisites
1. Ollama installed and running
2. An embedding model downloaded
```bash
# Install Ollama
brew install ollama # macOS
# or
curl -fsSL https://ollama.com/install.sh | sh # Linux
# Start Ollama
ollama serve
# Download model
ollama pull nomic-embed-text
```
## Configuration
### Basic Configuration
```yaml
# .grepai/config.yaml
embedder:
provider: ollama
model: nomic-embed-text
endpoint: http://localhost:11434
```
### With Custom Endpoint
```yaml
embedder:
provider: ollama
model: nomic-embed-text
endpoint: http://192.168.1.100:11434 # Remote Ollama server
```
### With Explicit Dimensions
```yaml
embedder:
provider: ollama
model: nomic-embed-text
endpoint: http://localhost:11434
dimensions: 768 # Usually auto-detected
```
## Available Models
### Recommended: nomic-embed-text
```bash
ollama pull nomic-embed-text
```
| Property | Value |
|----------|-------|
| Dimensions | 768 |
| Size | ~274 MB |
| Speed | Fast |
| Quality | Excellent for code |
| Language | English-optimized |
**Configuration:**
```yaml
embedder:
provider: ollama
model: nomic-embed-text
```
### Multilingual: nomic-embed-text-v2-moe
```bash
ollama pull nomic-embed-text-v2-moe
```
| Property | Value |
|----------|-------|
| Dimensions | 768 |
| Size | ~500 MB |
| Speed | Medium |
| Quality | Excellent |
| Language | Multilingual |
Best for codebases with non-English comments/documentation.
**Configuration:**
```yaml
embedder:
provider: ollama
model: nomic-embed-text-v2-moe
```
### High Quality: bge-m3
```bash
ollama pull bge-m3
```
| Property | Value |
|----------|-------|
| Dimensions | 1024 |
| Size | ~1.2 GB |
| Speed | Slower |
| Quality | Very high |
| Language | Multilingual |
Best for large, complex codebases where accuracy is critical.
**Configuration:**
```yaml
embedder:
provider: ollama
model: bge-m3
dimensions: 1024
```
### Maximum Quality: mxbai-embed-large
```bash
ollama pull mxbai-embed-large
```
| Property | Value |
|----------|-------|
| Dimensions | 1024 |
| Size | ~670 MB |
| Speed | Medium |
| Quality | Highest |
| Language | English |
**Configuration:**
```yaml
embedder:
provider: ollama
model: mxbai-embed-large
dimensions: 1024
```
## Model Comparison
| Model | Dims | Size | Speed | Quality | Use Case |
|-------|------|------|-------|---------|----------|
| `nomic-embed-text` | 768 | 274MB | ā”ā”ā” | āāā | General use |
| `nomic-embed-text-v2-moe` | 768 | 500MB | ā”ā” | āāāā | Multilingual |
| `bge-m3` | 1024 | 1.2GB | ā” | āāāāā | Large codebases |
| `mxbai-embed-large` | 1024 | 670MB | ā”ā” | āāāāā | Maximum accuracy |
## Performance Optimization
### Memory Management
Models load into RAM. Ensure sufficient memory:
| Model | RAM Required |
|-------|--------------|
| `nomic-embed-text` | ~500 MB |
| `nomic-embed-text-v2-moe` | ~800 MB |
| `bge-m3` | ~1.5 GB |
| `mxbai-embed-large` | ~1 GB |
### GPU Acceleration
Ollama automatically uses:
- **macOS:** Metal (Apple Silicon)
- **Linux/Windows:** CUDA (NVIDIA GPUs)
Check GPU usage:
```bash
ollama ps
```
### Keeping Model Loaded
By default, Ollama unloads models after 5 minutes of inactivity. Keep loaded:
```bash
# Keep model loaded indefinitely
curl http://localhost:11434/api/generate -d '{
"model": "nomic-embed-text",
"keep_alive": -1
}'
```
## Verifying Connection
### Check Ollama is Running
```bash
curl http://localhost:11434/api/tags
```
### List Available Models
```bash
ollama list
```
### Test Embedding
```bash
curl http://localhost:11434/api/embeddings -d '{
"model": "nomic-embed-text",
"prompt": "function authenticate(user, password)"
}'
```
## Running Ollama as a Service
### macOS (launchd)
Ollama app runs automatically on login.
### Linux (systemd)
```bash
# Enable service
sudo systemctl enable ollama
# Start service
sudo systemctl start ollama
# Check status
sudo systemctl status ollama
```
### Manual Background
```bash
nohup ollama serve > /dev/null 2>&1 &
```
## Remote Ollama Server
Run Ollama on a powerful server and connect remotely:
### On the Server
```bash
# Allow remote connections
OLLAMA_HOST=0.0.0.0 ollama serve
```
### On the Client
```yaml
# .grepai/config.yaml
embedder:
provider: ollama
model: nomic-embed-text
endpoint: http://server-ip:11434
```
## Common Issues
ā **Problem:** Connection refused
ā
**Solution:**
```bash
# Start Ollama
ollama serve
```
ā **Problem:** Model not found
ā
**Solution:**
```bash
# Pull the model
ollama pull nomic-embed-text
```
ā **Problem:** Slow embedding generation
ā
**Solutions:**
- Use a smaller model (`nomic-embed-text`)
- Ensure GPU is being used (`ollama ps`)
- Close memory-intensive applications
- Consider a remote server with better hardware
ā **Problem:** Out of memory
ā
**Solutions:**
- Use a smaller model
- Close other applications
- Upgrade RAM
- Use remote Ollama server
ā **Problem:** Embeddings differ after model update
ā
**Solution:** Re-index after model updates:
```bash
rm .grepai/index.gob
grepai watch
```
## Best Practices
1. **Start with `nomic-embed-text`:** Best balance of speed/quality
2. **Keep Ollama running:** Background service recommended
3. **Match dimensions:** Don't mix models with different dimensions
4. **Re-index on model change:** Delete index and re-run watch
5. **Monitor memory:** Embedding models use significant RAM
## Output Format
Successful Ollama configuration:
```
ā
Ollama Embedding Provider Configured
Provider: Ollama
Model: nomic-embed-text
Endpoint: http://localhost:11434
Dimensions: 768 (auto-detected)
Status: Connected
Model Info:
- Size: 274 MB
- Loaded: Yes
- GPU: Apple Metal
```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts ā single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ā„ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.