Skip to main content

Overview

Run powerful open-source language models locally for development, testing, or air-gapped deployments. This guide covers Ollama, vLLM, LM Studio, and other local model solutions with the MCP Server.
Local models provide privacy, no API costs, and offline capabilities - perfect for development and sensitive data scenarios.

Why Local Models?

Privacy & Security

  • No data leaves your infrastructure
  • GDPR/HIPAA compliance
  • Air-gapped deployments
  • Full data control

Cost Savings

  • No API usage costs
  • No rate limits
  • Predictable infrastructure costs
  • Scale without per-token fees

Performance

  • Low latency (no network calls)
  • Customizable hardware
  • Model fine-tuning
  • Offline capability

Flexibility

  • Any open-source model
  • Custom fine-tuned models
  • Experiment freely
  • Version control models

Ollama Setup

Best for: Easy setup, development, quick testing
1

Install Ollama

2

Pull Models

3

Configure MCP Server

4

Test

Ollama Configuration

Available Models

vLLM Setup

Best for: High throughput, production deployments
1

Install vLLM

2

Start vLLM Server

3

Configure MCP Server

4

Test

vLLM Features

LM Studio

Best for: Desktop GUI, beginners, Windows users
1

Install LM Studio

  1. Download from https://lmstudio.ai
  2. Install for your platform (Windows/Mac/Linux)
  3. Launch LM Studio
2

Download Models

  1. Click “Discover” tab
  2. Search for models (e.g., “Llama 3.2”)
  3. Click download
  4. Wait for download to complete
3

Start Local Server

  1. Click “Local Server” tab
  2. Select model from dropdown
  3. Click “Start Server”
  4. Note the server URL (default: http://localhost:1234)
4

Configure MCP Server

Production Deployment

Kubernetes with Ollama

Load Models via Init Container

MCP Server with Local LLM

Model Selection

By Task Type

By Hardware

Performance Optimization

GPU Acceleration

Quantization

Concurrent Requests

Context Caching

Fine-Tuning

Create Modelfile

Build Custom Model

Fine-Tune with LoRA

Monitoring

Resource Usage

Performance Metrics

Troubleshooting

Error: CUDA out of memory or system freezeSolutions:
Causes: CPU-only, large model, no optimizationSolutions:
Error: Error: model 'llama3.2:3b' not foundSolutions:
Error: Connection refused to localhost:11434Solutions:

Best Practices

Minimum:
  • CPU: 4 cores
  • RAM: 8GB
  • Storage: 50GB
Recommended:
  • CPU: 8+ cores
  • RAM: 16GB+
  • GPU: NVIDIA with 8GB+ VRAM
  • Storage: 100GB+ SSD
Production:
  • CPU: 16+ cores
  • RAM: 32GB+
  • GPU: NVIDIA A100/H100
  • Storage: 500GB+ NVMe SSD
  • Development: Small models (1-3B params)
  • Testing: Medium models (7B params)
  • Production: Based on use case (7-70B)
  • Air-gapped: Pre-download all needed models
  • Run Ollama in isolated environment
  • Don’t expose Ollama port publicly
  • Use authentication if remote access needed
  • Validate all inputs
  • Monitor resource usage
  • Horizontal: Multiple Ollama instances
  • Vertical: Larger GPU, more RAM
  • Load balancing across instances
  • Model caching on shared storage

Next Steps

Multi-LLM Setup

Combine local and cloud models

Observability

Monitor local LLM performance

Kubernetes Deployment

Deploy Ollama to K8s

Production Checklist

Production deployment requirements

Local LLMs Ready: Run powerful open-source models with complete privacy and control!