Nirvana Plugin
by @shivaclaw
Local-first privacy-first inference. Your OpenClaw agent thinks locally and asks the cloud intelligently. Saves 85%+ tokens, protects privacy, agent learns f...
clawhub install project-nirvana-pluginπ About This Skill
name: project-nirvana-plugin description: Local-first privacy-first inference. Your OpenClaw agent thinks locally and asks the cloud intelligently. Saves 85%+ tokens, protects privacy, agent learns from cloud responsesβcloud doesn't learn from you. version: "1.0.0" author: Shiva compatibility: "OpenClaw 2026.3.24+" keywords: [local-inference, privacy, cost-reduction, ollama, qwen, local-llm, context-stripping, privacy-preserving] metadata: homepage: "https://github.com/ShivaClaw/nirvana-plugin" repositoryUrl: "https://github.com/ShivaClaw/nirvana-plugin" issueTrackerUrl: "https://github.com/ShivaClaw/nirvana-plugin/issues" emoji: π§
Project Nirvana: Local-First, Privacy-First Inference
> A new way of thinking about LLM access. Your agent thinks locally, asks the cloud intelligently, and learns from the response. The cloud never sees your private data.
The Problem
Today's approach leaks your privacy and wastes 85% of your API budget.
Every time you ask your OpenClaw agent a question:
1. Your agent builds a "system prompt" containing: - Excerpts from its SOUL.md and MEMORY.md - Your personal information from its USER.md - Your entire chat history (context window) 2. All of this gets sent to cloud APIs (OpenAI, Anthropic, Google) 3. You pay for thousands of extra tokens 4. The cloud provider trains its next model on your private data
This is the current default. It's inefficient and it's a privacy disaster.
The Solution: Nirvana
Local-first inference that protects privacy and slashes costs.
Nirvana flips the paradigm:
1. Your agent thinks locally using Ollama (free, private, on your hardware) 2. For complex questions, it asks the cloud β but only sends its own carefully-crafted queries 3. Your private data never leaves your system 4. The cloud's responses are cached locally β your agent learns from them
The Paradigm Shift
| Aspect | Today (Default) | Nirvana | |--------|-----------------|---------| | Where thinking happens | Cloud only | Local first, cloud when needed | | What gets sent to cloud | Your full context + system prompts | Agent's sanitized query only | | Who learns from your data | Cloud provider | You (local agent) | | Token cost per interaction | 2,000β5,000 tokens | 50β300 tokens | | Savings | β | 85%+ token reduction | | Privacy | Leaked | Protected |
What Nirvana Does
Local Inference
Privacy Enforcement
Intelligent Routing
@local or @cloud hints respectedLearning & Caching
How It Works
User asks your agent a question
β
βββββββββββββββββββββββββββββββββββββββββββ
β Nirvana Router β
β "Can qwen2.5:7b answer this locally?" β
βββββββββββββββββββββββββββββββββββββββββββ
β β[LOCAL PATH] [CLOUD PATH]
80%+ of queries 20%- of queries
Ollama (qwen2.5:7b) OpenAI/Anthropic/Google
Free Pay for answer
Private Cloud sees sanitized query only
~1s latency ~3s latency
Result cached locally Result cached locally
β β
βββββββββββββββ¬ββββββββββββββββββββββ
β
Agent answers your question using:
- Local inference (primary)
- Cloud intelligence (if needed)
- Cached knowledge (if available)
YOUR PRIVATE DATA NEVER LEFT YOUR SYSTEM
Installation
Prerequisites
Two Paths
#### Path A: Use Bundled Ollama + qwen2.5:7b (Out-of-box)
# Install the plugin
clawhub install shivaclaw/nirvanaStart Ollama container (pulls auto on first run)
docker run -d -p 11434:11434 ollama/ollamaVerify
openclaw nirvana status
#### Path B: Use Existing Local LLM (Any Provider)
# Install the skill (context stripping only)
clawhub install shivaclaw/nirvana-localConfigure endpoint
openclaw nirvana configure --local-endpoint http://your-llm:5000Verify
openclaw nirvana status
Cost Impact
Token Savings
| Scenario | Today | With Nirvana | Savings | |----------|-------|--------------|---------| | 10 questions/day | 20,000 tokens/day | 3,000 tokens/day | 85% | | 100 questions/day | 200,000 tokens/day | 30,000 tokens/day | 85% | | Monthly cost (OpenAI GPT-4) | $500β$1,000 | $75β$150 | 85% |
Local inference is free. Only pay for the 15%β20% of queries that truly need frontier models.
Privacy Guarantee
What Never Leaves Your System
What Optionally Goes to Cloud
Privacy Audit Trail
# View what was sent to cloud this session
openclaw nirvana audit-logOutput:
2026-04-24 14:23:45 β CLOUD API CALL
Original query: [REDACTED]
Sanitized query sent: "Explain quantum entanglement"
Response cached: Yes
User data in request: None
Platform Support
| Platform | Status | Notes | |----------|--------|-------| | Linux (Ubuntu/Debian) | β Full | Ollama container + native binaries | | macOS (Intel/ARM) | β Full | Ollama via Docker or native | | Windows (WSL2) | β Full | Ollama in WSL2 container | | VPS (Hostinger, DigitalOcean, AWS) | β Full | Docker Compose ready | | Docker container | β Full | Orchestrated via docker-compose | | Air-gapped (offline) | β Full | Local-only mode (no cloud fallback) |
Configuration
Basic Setup
{
"nirvana": {
"mode": "local-first",
"local_model": {
"provider": "ollama",
"endpoint": "http://ollama:11434",
"model": "qwen2.5:7b",
"timeout_ms": 180000
},
"routing": {
"local_threshold": 0.75,
"max_local_tokens": 8000,
"cloud_fallback": true
},
"privacy": {
"strip_soul": true,
"strip_user": true,
"strip_memory": true,
"audit_logging": true
}
}
}
Custom Local LLM (Non-Ollama)
{
"nirvana": {
"local_model": {
"provider": "custom",
"endpoint": "http://your-llm-server:5000",
"api_format": "openai-compatible",
"model": "your-model-name",
"timeout_ms": 120000
}
}
}
Use Cases
β Perfect For
β οΈ When to Use Cloud
Philosophy
Your agent should train itself. The cloud should not train on you.
Today's default paradigm:
Nirvana's paradigm:
What's Included
| Component | Purpose | |-----------|---------| | router.ts | Decides local vs cloud routing | | context-stripper.ts | Removes private data before cloud API calls | | privacy-auditor.ts | Logs all boundary crossings | | response-integrator.ts | Caches cloud responses locally | | ollama-manager.ts | Handles Ollama lifecycle + model management | | metrics-collector.ts | Tracks performance + cost + privacy | | config.schema.json | Configuration validation |
Performance
Benchmarks (qwen2.5:7b on 4-core CPU)
Optimization
Support & Community
License
MIT-0 β Free to use, modify, and redistribute. No attribution required.
*Your agent deserves privacy. Nirvana makes it real.*
β‘ When to Use
βοΈ Configuration
Basic Setup
{
"nirvana": {
"mode": "local-first",
"local_model": {
"provider": "ollama",
"endpoint": "http://ollama:11434",
"model": "qwen2.5:7b",
"timeout_ms": 180000
},
"routing": {
"local_threshold": 0.75,
"max_local_tokens": 8000,
"cloud_fallback": true
},
"privacy": {
"strip_soul": true,
"strip_user": true,
"strip_memory": true,
"audit_logging": true
}
}
}
Custom Local LLM (Non-Ollama)
{
"nirvana": {
"local_model": {
"provider": "custom",
"endpoint": "http://your-llm-server:5000",
"api_format": "openai-compatible",
"model": "your-model-name",
"timeout_ms": 120000
}
}
}