Complete guide to using local AI models (Ollama, LM Studio, GPT4All) with GhidraInsight for private, offline binary analysis.
Version: 1.0
Status: ✅ Production Ready
Last Updated: January 5, 2026
GhidraInsight now supports multiple local AI platforms alongside cloud-based APIs. This guide covers:
- Ollama - Recommended, easiest to use
- LM Studio - GUI-based local LLM platform
- GPT4All - Lightweight, user-friendly
- Hugging Face Transformers - Advanced, flexible
- LocalAI - Drop-in OpenAI replacement
| Platform | Ease | Models | Speed | Memory | Best For |
|---|---|---|---|---|---|
| Ollama | ⭐⭐⭐⭐⭐ | 20+ | ⚡⚡⚡ | 8GB+ | RECOMMENDED |
| LM Studio | ⭐⭐⭐⭐ | 50+ | ⚡⚡ | 6GB+ | GUI Users |
| GPT4All | ⭐⭐⭐⭐ | 20+ | ⚡ | 4GB+ | Beginners |
| HF Trans. | ⭐⭐⭐ | ∞ | ⚡⚡⚡ | 16GB+ | Power Users |
| LocalAI | ⭐⭐⭐ | 40+ | ⚡⚡ | 8GB+ | OpenAI Drop-in |
See OLLAMA_INTEGRATION.md for detailed setup.
# Install
curl -fsSL https://ollama.ai/install.sh | sh
# Download model
ollama pull mistral
# Start server
ollama serve
# Use with GhidraInsight
ghidrainsight analyze --file binary.elf --ai-provider ollama- ✅ Simplest installation
- ✅ Auto GPU detection
- ✅ Fastest startup
- ✅ Best community support
- ❌ Limited customization
- ❌ Model selection limited
Recommended Models:
mistral(7B) - Best balancecodellama(7B-34B) - Code analysisllama2(7B-70B) - More powerneural-chat(7B) - Lightweight
- Download: https://lmstudio.ai
- Install: Follow platform instructions
- Launch: Open LM Studio app
-
Download Models:
- Search "mistral" or "codellama"
- Click download (takes few minutes)
-
Load Model:
- Select model from list
- Click "Load"
- Wait for "Ready" status
-
Start Server:
- Go to "Local Server" tab
- Click "Start Server"
- Note the URL (usually http://localhost:1234)
# Option 1: Interactive setup
ghidrainsight config setup --guided
# Select: LM Studio
# Endpoint: http://localhost:1234
# Option 2: Config file
cat > config.yaml << 'EOF'
ai:
provider: lm_studio
endpoint: http://localhost:1234
model: mistral # Or whatever you loaded
EOF# Analyze with LM Studio
ghidrainsight analyze --file binary.elf --ai-provider lm-studio
# Or use Python SDK
from ghidrainsight.client import GhidraInsightClient
client = GhidraInsightClient(
ai_endpoint="http://localhost:1234",
ai_provider="lm_studio"
)- ✅ GUI-based (beginner friendly)
- ✅ Lots of models available
- ✅ Easy model switching
- ✅ Good performance monitoring
- ❌ Heavier resource usage
- ❌ Less automation friendly
- ❌ Slower startup
# macOS
brew install gpt4all
# Linux/Windows: Download from https://gpt4all.io# Start GPT4All server
gpt4all-cli --listen
# Default runs on http://localhost:4891ai:
provider: gpt4all
endpoint: http://localhost:4891
model: mistralghidrainsight analyze --file binary.elf --ai-provider gpt4all- ✅ Very lightweight
- ✅ Low memory requirement
- ✅ Offline capable
- ✅ Good for older machines
- ❌ Limited model support
- ❌ Slower inference
- ❌ Less community activity
pip install transformers torch
# For GPU support
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118from transformers import AutoTokenizer, AutoModelForCausalLM
# Download during first run
model_name = "mistralai/Mistral-7B-Instruct-v0.1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)# Install text-generation-webui
git clone https://github.com/oobabooga/text-generation-webui.git
cd text-generation-webui
pip install -r requirements.txt
# Start server
python server.py --listen 0.0.0.0:5000ai:
provider: huggingface
endpoint: http://localhost:5000
model: mistralai/Mistral-7B-Instruct-v0.1from ghidrainsight.client import GhidraInsightClient
client = GhidraInsightClient(
ai_endpoint="http://localhost:5000",
ai_provider="huggingface"
)
results = await client.analyze("binary.elf")- ✅ Maximum flexibility
- ✅ Best performance potential
- ✅ Access to latest models
- ✅ Full customization
- ❌ Complex setup
- ❌ High RAM requirement
- ❌ Steep learning curve
- ❌ Longer inference times
Docker (Recommended):
docker run -p 8080:8080 \
-e "MODELS_PATH=/models" \
-v /path/to/models:/models \
localai/localai:latest-aioManual:
git clone https://github.com/go-skynet/LocalAI.git
cd LocalAI
make build
./local-ai --listen=0.0.0.0:8080# Models are auto-downloaded on first use
# Or manually download from HuggingFace
docker exec <container_id> \
wget -O /models/mistral-7b-instruct-v0.1.gguf \
https://huggingface.co/.../download/mistral-...ai:
provider: openai # OpenAI-compatible API
endpoint: http://localhost:8080
model: mistral# Works exactly like OpenAI API
ghidrainsight analyze --file binary.elf --ai-provider openai
# Or Python
client = GhidraInsightClient(
ai_endpoint="http://localhost:8080",
ai_provider="openai"
)- ✅ OpenAI API compatible
- ✅ Many models available
- ✅ Good Docker support
- ✅ Production-ready
- ❌ More complex setup
- ❌ Docker required
- ❌ Resource intensive
Easiest: Ollama ⭐⭐⭐⭐⭐
LM Studio ⭐⭐⭐⭐
GPT4All ⭐⭐⭐⭐
LocalAI ⭐⭐⭐
Hardest: HF Transformers ⭐⭐
Fastest: Ollama ⚡⚡⚡⚡⚡
HF Transformers ⚡⚡⚡⚡
LocalAI ⚡⚡⚡
LM Studio ⚡⚡
Slowest: GPT4All ⚡
Most Models: HF Transformers (unlimited)
LocalAI (40+)
LM Studio (50+)
Ollama (20+)
Fewest: GPT4All (15+)
Best UX: LM Studio (GUI)
Ollama (CLI, easy)
GPT4All (CLI, simple)
LocalAI (Docker)
Hardest: HF Transformers (Python)
# 1 line installation
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull mistral
ollama serveTime: ~5 minutes
# 1. Download from website
# 2. Install
# 3. Click buttons in GUITime: ~10 minutes
# Installation and GUI
brew install gpt4all
gpt4all-cli --listenTime: ~5 minutes
# Complex setup
pip install transformers torch
# Download model (~15GB)
# Setup web UI
# Configure endpointTime: ~30 minutes + download time
# Docker required
docker run -p 8080:8080 localai/localai:latest-aioTime: ~5 minutes (if Docker installed)
Do you want:
│
├─ Easiest setup + best support?
│ └─> Use Ollama ⭐ RECOMMENDED
│
├─ GUI interface?
│ └─> Use LM Studio
│
├─ Very lightweight (old hardware)?
│ └─> Use GPT4All
│
├─ OpenAI-compatible API?
│ └─> Use LocalAI
│
└─ Maximum flexibility + control?
└─> Use HF Transformers
| Platform | Model | Time | RAM | Quality |
|---|---|---|---|---|
| Ollama | Mistral 7B | 60s | 8GB | ⭐⭐⭐⭐ |
| LM Studio | Mistral 7B | 65s | 8GB | ⭐⭐⭐⭐ |
| GPT4All | Mistral | 90s | 4GB | ⭐⭐⭐ |
| HF Trans. | Mistral | 45s | 16GB | ⭐⭐⭐⭐ |
| LocalAI | Mistral | 70s | 8GB | ⭐⭐⭐⭐ |
| Cloud | GPT-4 | 5s | ∞ | ⭐⭐⭐⭐⭐ |
Your Data: Binary File
↓
Only Processed Locally ← Ollama/LM Studio/etc
↓
Results
❌ Never sent to cloud
❌ No API keys needed (except for integration)
✅ 100% privacy
✅ Works offline
# Firewall only local connections
sudo ufw allow from 127.0.0.1 to any port 11434
# Verify no external connections
lsof -i TCP -s TCP:LISTEN | grep ollama| Size | RAM Needed | Use Case |
|---|---|---|
| 3B | 4GB | Quick analysis |
| 7B | 8GB | Balanced (Recommended) |
| 13B | 12GB | Better quality |
| 34B | 24GB | Deep analysis |
| 70B | 48GB+ | Maximum capability |
3B Model: ~2GB
7B Model: ~4GB
13B Model: ~7GB
34B Model: ~20GB
70B Model: ~40GB
| GPU | Boost | VRAM |
|---|---|---|
| NVIDIA RTX 3060 | 3-4x | 12GB |
| NVIDIA RTX 4090 | 8-10x | 24GB |
| Apple M1/M2 | 2-3x | Shared |
| Apple M3 Max | 3-4x | Shared |
| AMD Radeon | 2-3x | 8-16GB |
version: '3.8'
services:
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
environment:
- OLLAMA_NUM_THREAD=8
- OLLAMA_GPU_LAYERS=20
restart: unless-stopped
ghidrainsight:
depends_on:
- ollama
environment:
GHIDRA_AI_PROVIDER: ollama
GHIDRA_OLLAMA_ENDPOINT: http://ollama:11434
volumes:
ollama_data:apiVersion: apps/v1
kind: Deployment
metadata:
name: ghidrainsight-ollama
spec:
replicas: 1
template:
spec:
containers:
- name: ollama
image: ollama/ollama:latest
resources:
requests:
memory: "8Gi"
cpu: "4"
limits:
memory: "16Gi"
cpu: "8"
ports:
- containerPort: 11434Pros:
- ✅ Privacy - data stays local
- ✅ Cost - one-time hardware cost
- ✅ Offline - works without internet
- ✅ Speed - no API latency
- ✅ Control - customize everything
Cons:
- ❌ Hardware cost
- ❌ Slower inference
- ❌ Limited to your hardware
- ❌ Manual updates needed
Pros:
- ✅ Fast responses
- ✅ Latest models
- ✅ No hardware needed
- ✅ Expert models (GPT-4, Claude)
- ✅ Always updated
Cons:
- ❌ Privacy concerns
- ❌ Recurring costs ($)
- ❌ Internet required
- ❌ API rate limits
- ❌ Vendor lock-in
# 1. Install
curl -fsSL https://ollama.ai/install.sh | sh
# 2. Download Mistral
ollama pull mistral
# 3. Start server
ollama serve &
# 4. Verify
curl http://localhost:11434/api/tags
# 5. Use with GhidraInsight
ghidrainsight analyze --file binary.elf --ai-provider ollama# Download multiple models
ollama pull mistral
ollama pull codellama
ollama pull llama2
# Create config for all
cat > config.yaml << 'EOF'
ai:
providers:
- name: mistral
model: mistral
endpoint: http://localhost:11434
- name: codellama
model: codellama
endpoint: http://localhost:11434
- name: llama2
model: llama2
endpoint: http://localhost:11434
EOF
# Use specific model
ghidrainsight analyze --file binary.elf --ai-model codellama# Install CUDA (for NVIDIA)
# Check: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/
# Verify CUDA
nvidia-smi
# Ollama auto-detects CUDA
# Verify GPU usage
ollama list # Shows if GPU is used
# Monitor performance
watch nvidia-smiUse: Ollama + Mistral 7B
- Easiest to setup
- Good speed & quality
- Balanced resource usage
- Best community support
Use: LM Studio
- GUI interface
- Easy model switching
- Visual feedback
Use: HF Transformers + CodeLLaMA
- Maximum control
- Best accuracy
- Custom optimization
Use: LocalAI + Docker
- Production-ready
- Easy scaling
- API compatibility
Found a new local AI platform? Have a better setup?
→ Contribute to GhidraInsight
Privacy-First • Open Source • Cost-Effective • Offline-Capable
Power your binary analysis with local AI - No cloud needed!
Last Updated: January 5, 2026