-
Notifications
You must be signed in to change notification settings - Fork 2
AI Development Run LLMs Locally
Below is a comprehensive guide to running Machine Learning (ML) and Large Language Models (LLMs) locally as of July 2026, evaluated specifically for coding, autonomous agentic software development, and IDE integration (VS Code, OpenCode, Aider) on consumer hardware (16GB VRAM NVIDIA GPU + 64GB System RAM).
Below is a list of tools and frameworks that can be used to run LLMs locally. See the AI-Local-Development-Models page for information about specific models.
For local AI coding, a system with 16GB VRAM (e.g., RTX 4080 / 5080 / 4070 Ti Super / 3090) and 64GB System RAM is an ideal workstation tier. Memory allocation and performance vary by model architecture:
- Fully In-VRAM Models (8B – 16B Parameters at Q4/Q8): Models like Qwen 2.5/3.0 Coder 14B, DeepSeek-Coder-V2 Lite 16B MoE, Qwythos-9B, Gemma 4 12B, and LFM 2.5-8B occupy ~6–10GB VRAM. This leaves 6GB+ of VRAM dedicated strictly to the KV Cache, enabling huge context windows (32k–64k tokens) and ultra-fast generation (>60–120+ tokens/sec) for real-time autocomplete and refactoring.
- Dense 22B – 24B Parameters: Models like Devstral Small 2 (24B) (~14.5GB at Q4_K_M) or Codestral 22B (~12.5GB at Q4_K_M) utilize almost the full 16GB VRAM buffer. Keep context limits conservative (2k–8k tokens) to prevent VRAM overflow into system memory.
- MoE & Quantized Offload Models (27B – 33B Parameters): Mixture-of-Experts (MoE) architectures such as Laguna XS 2.1 (33B total / 3B active) or Qwen 3.6 27B A3B Coder only execute 2.4B–3B active parameters per token. They keep active weights in VRAM while leveraging 64GB system RAM for layer offloading and large context buffers without catastrophic speed drops.
-
Dual-Model Strategy (Recommended):
- Agent / Chat Model: Laguna XS 2.1 (33B MoE) or Devstral Small 2 (24B) for deep architectural planning and issue resolution.
- Inline Autocomplete Model (FIM): Fast 1.5B–8B model (e.g., LFM 2.5 8B or Qwen 2.5-Coder 1.5B) assigned exclusively to tab-autocompletion for sub-50ms latency.
- https://github.com/jamesob/local-llm - Minimalist local LLM scripts
-
Ollama - De facto CLI & background engine for local LLMs; native REST API & OpenAI-compatible server (
http://localhost:11434/v1). -
LM Studio - Top desktop interface & server (
http://localhost:1234/v1) for GGUF model discovery, visual context monitoring, and hardware offload configuration. -
Unsloth Studio & Engine (GitHub) - Advanced local AI environment featuring dynamic 4-bit quants, hardware acceleration, and the
unsloth start [agent]CLI to connect local LLMs directly to coding agents. -
Jan AI (GitHub) - Fully offline, open-source (Tauri-based) desktop ChatGPT alternative with local OpenAI-compatible API server (
http://localhost:1337/v1) and Model Context Protocol (MCP) support. - OpenWebUI (GitHub) - Feature-rich web interface with deep Ollama integration, multi-model chat, RAG, and web search.
-
llama.cpp Server - Raw C++ inference engine (
llama-server) providing maximum hardware control, custom layer offloading, and lowest memory overhead. - Text-Generation-WebUI - Flexible engine supporting GGUF, EXL2, HF transformers, and extensive plugin ecosystems.
- https://vllm.ai/ - High-Throughput and Memory-Efficient inference and serving engine for LLMs
- LibreChat - Multi-model chat interface supporting custom local backend endpoints and agent plugins.
Information about specific models can be found in the AI-Local-Development-Models page.
- Hugging Face Chat UI - Clean web UI with search integration
- LocalAI - Developer-focused drop-in OpenAI API replacement for text, audio, and vision
- AnythingLLM / UseAnything - All-in-one desktop application with document RAG and local model support
- GPT4All - Cross-platform local LLM app with LocalDocs RAG
- MindMac - Native desktop app supporting local endpoints (Ollama / LM Studio / Jan)
- TypingMind - Advanced web interface for local OpenAI-compatible endpoints
- NVIDIA ChatRTX - Hardware-accelerated local RAG for RTX GPUs
- LocalGPT - Document chat powered by local models
- Streamlit & Gradio - Prototyping frameworks for custom AI applications
- Secret Llama - Browser-based private local LLM chatbot
- KoboldCpp - Lightweight single-file GGUF execution server
- LobeChat - Modern chat UI with extension and MCP support
- Lollms-WebUI - Multi-modal web UI with PDF and web search capabilities
- H2O GPT - Document ingestion and query framework
- SillyTavern - Persona and character interaction interface
- ChainFury - Prompt chaining and web search framework
- PrivateGPT - Offline document RAG stack
- ExUI - VRAM-efficient GUI for EXL2 models
- AI-Messenger - Desktop interface supporting EXLv2 and LLaVA
Connect local models running in Ollama, LM Studio, Jan AI, or Unsloth to developer tools.
OpenCode connects to local models via OpenAI-compatible REST endpoints.
If using Unsloth, launch OpenCode with pre-configured endpoints in a single command:
unsloth start opencode-
Set Ollama Context Window:
cat > Modelfile <<EOF FROM laguna-xs-2.1:q4_K_M PARAMETER num_ctx 32768 EOF ollama create my-laguna-32k -f Modelfile
-
Configure OpenCode Config File (
~/.config/opencode/opencode.json):{ "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama Local", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "my-laguna-32k": { "name": "Laguna XS 2.1 (33B MoE 32k)" }, "devstral-small-2": { "name": "Devstral Small 2 (24B)" }, "mannix/qwen3.6-27b-a3b-coder:CD-IQ4_K_M": { "name": "Qwen 3.6 27B Coder" } } }, "lmstudio": { "name": "LM Studio Local", "options": { "baseURL": "http://localhost:1234/v1" }, "models": { "local-model": { "name": "LM Studio Model" } } } } } -
Launch OpenCode:
opencode # Or launch directly with Ollama: ollama launch opencode --model devstral-small-2
Local models can be connected to VS Code through native features or popular extensions:
VS Code supports native local model connections without cloud subscriptions:
- Open VS Code Settings (
Ctrl+,/Cmd+,). - Navigate to GitHub Copilot / Language Models.
- Set Custom Model Provider Base URL to
http://localhost:11434/v1(Ollama) orhttp://localhost:1234/v1(LM Studio). - Select your local model directly inside the VS Code Copilot Chat panel.
(Note: Roo Code was archived in May 2026; Cline is the active community standard).
- Install Cline from the VS Code Marketplace.
- Open Cline settings (gear icon):
-
API Provider: Select
OllamaorOpenAI Compatible. -
Base URL: Set
http://localhost:11434(Ollama),http://localhost:1234/v1(LM Studio), orhttp://localhost:1337/v1(Jan AI). -
Model ID: Enter
laguna-xs-2.1:q4_K_Mordevstral-small-2. - Enable Use Compact Prompt to preserve context budget.
-
API Provider: Select
- Install Continue from the VS Code Marketplace.
- Configure
~/.continue/config.yaml(orconfig.json):schema: v1 models: - name: Laguna XS 2.1 (Ollama) provider: ollama model: laguna-xs-2.1:q4_K_M apiBase: http://localhost:11434 roles: [chat, edit, apply] - name: Devstral Small 2 (Ollama) provider: ollama model: devstral-small-2 apiBase: http://localhost:11434 roles: [chat, edit] - name: LM Studio Local Server provider: openai model: local-model apiBase: http://localhost:1234/v1 tabAutocompleteModel: name: LFM 2.5 Fast Autocomplete provider: ollama model: lfm2.5:8b-a1b-q8_0 apiBase: http://localhost:11434
Install the official Ollama Extension from the VS Code Marketplace for direct one-click sidebar integration.
Aider is a git-native CLI pair programmer that auto-commits code edits:
-
Install Aider:
uv tool install aider-chat
-
Configure Local Endpoint:
# Linux / macOS export OLLAMA_API_BASE=http://127.0.0.1:11434 # Windows PowerShell $env:OLLAMA_API_BASE="http://127.0.0.1:11434"
-
Run Aider with Ollama Chat Prefix:
aider --model ollama_chat/devstral-small-2