Local Models: Ollama, LM Studio & llama.cpp

July 8, 2026 · View on GitHub

VT Code can run models entirely on your machine through three local inference backends. This guide explains when local makes sense, how it compares to remote APIs, what hardware you need, and how to get reliable results.

Status: experimental. Local inference is less reliable than remote APIs. Tool use, reasoning, and streaming fidelity depend on the model and the backend you choose. Remote providers (OpenAI, Anthropic, Gemini, etc.) are recommended for production work; use local models for privacy, offline use, or cost-free experimentation.

Local vs Remote

DimensionLocal (Ollama / LM Studio / llama.cpp)Remote API
PrivacyData never leaves your machineSent to a third-party API
CostFree after hardwarePer-token billing
LatencyLimited by your CPU/GPUTypically faster, datacenter GPUs
Model qualitySmaller open-weight modelsFrontier models (GPT-5.x, etc.)
Tool use / reasoningWorks, but less consistentMost reliable
SetupYou manage server + modelZero setup
ReliabilityServer/load state must be correctGenerally "just works"

Recommendation: use remote APIs as the default. Switch to a local model when you need offline access, maximum privacy, or want to avoid API costs for lightweight tasks.

Hardware & model sizing

Local performance is dominated by memory bandwidth and VRAM. Rough guidance:

TierVRAM / RAMExample modelsUse case
Tiny8–16 GBgemma-4-e4b (llama.cpp), llama-3.1-8b (LM Studio)Quick edits, autocomplete-style help
Mid16–32 GBgpt-oss:20b, gemma-3-12bGeneral coding assistance
High32–64 GBgemma-4-26b-a4b, step-3.5-flashHeavier agentic workflows
Max64 GB+Multiple / larger MoEsLong-horizon tasks

Quantized GGUF models (llama.cpp) run with far less VRAM than full-precision weights. Prefer Q4/Q5 quantizations for the best speed/quality trade-off.

Getting reliable results

Local generation fails most often for two reasons: the server is stopped or the model isn't loaded. VT Code now detects both before generating and returns an exact recovery command (e.g. ollama pull gpt-oss:20b or /local start ollama) instead of a cryptic error.

Checklist:

  1. Start the server. Use /local status to check, or /local start <provider>.
    • Ollama: ollama serve
    • LM Studio: lms server start (or the app's "Run LLM server on login")
    • llama.cpp: llama-server -m /path/to/model.gguf --port 8080, or set LLAMACPP_MODEL_PATH and let VT Code manage it.
  2. Make sure the model is available.
    • Ollama: ollama pull <model> (then it auto-loads on request).
    • LM Studio: load the model in the app or lms load <model>.
    • llama.cpp: the model passed to llama-server is the only loaded model.
  3. Pick a model that actually exists. The model picker shows models that are currently loaded when the server is running. If you select a preset whose model isn't loaded, VT Code tells you the exact pull/load command.
  4. Use /local troubleshoot for guided diagnostics.

Known limitations

  • Ollama — best-supported local backend. Parallel tool calls and some tool_choice modes are not supported; requests fall back gracefully. Reasoning models use the native think parameter.
  • LM Studio — uses the OpenAI-compatible /v1 endpoint. Only one model is active at a time; select the loaded model in the picker. Some models reject parameters that the OpenAI API accepts (e.g. parallel_tool_calls) — if you see a 400, switch to a model that supports tools or disable parallel tools.
  • llama.cpp — most "managed" backend (auto-starts via LLAMACPP_MODEL_PATH). Feature support (reasoning, tools, structured output) varies by build and model; verify your server was built with the needed extensions.

See also