AI on Windows

How to Run a Local LLM on Windows with Ollama or LM Studio

By NileVPS Team · Published · 5 min read

اقرأ المقال بالعربي

Running a large language model on your own Windows machine means your prompts never leave the computer, there are no message limits and it works offline. Tools like Ollama and LM Studio have made this a ten-minute job. What they cannot change is physics: model size, RAM and GPU memory decide how fast and how capable your local assistant will be. This guide covers setup, model choice and realistic expectations.

What you need

Model sizeTypical memory needed (4-bit quantized)Realistic hardware
1-4B parametersAbout 2-4 GBAny modern PC with 8 GB RAM
7-9B parametersAbout 5-7 GB16 GB RAM, or a GPU with 8 GB VRAM
12-14B parametersAbout 8-10 GB32 GB RAM, or a GPU with 12 GB VRAM or more
30B+ parameters20 GB and upHigh-end GPU or multiple GPUs

These are approximate figures for common 4-bit versions. Longer context windows use extra memory on top.

The key point: a model that fits entirely in GPU VRAM is much faster than one running on the CPU from system RAM. On CPU only, small models are usable, while larger ones become slow enough to be frustrating. We look at this in detail in do you need a GPU for AI.

Quantization in one paragraph

Models are published in reduced-precision versions, called quantizations. A 4-bit version (often labelled Q4_K_M in the GGUF format) needs roughly a quarter of the memory of the full 16-bit model and loses a little quality. For local use, Q4 or Q5 is the usual sweet spot. Q8 is closer to the original but needs about twice the memory of Q4.

Option 1: Ollama (command line and API)

Install

winget install --id Ollama.Ollama -e

Or download the installer from ollama.com. Ollama runs in the background and appears in the system tray.

Run your first model

ollama run llama3.2

The model downloads on first use, then you get a chat prompt. Type /bye to exit. Other useful commands:

ollama pull mistral        # download without starting a chat
ollama list                # show installed models
ollama ps                  # show loaded models and CPU/GPU split
ollama rm mistral          # delete a model to free disk space

Browse the Ollama model library for names and sizes. Common families include Llama (Meta), Mistral, Gemma (Google), Qwen (Alibaba), Phi (Microsoft) and DeepSeek. Tags select the size, for example qwen2.5:7b.

Move models to another drive

Models can take many gigabytes. To store them on drive D:, set a user environment variable and restart Ollama:

setx OLLAMA_MODELS "D:\ollama\models"

Use the local API

Ollama listens on http://localhost:11434. Test it from PowerShell:

$body = @{ model = "llama3.2"; prompt = "Explain DNS in two sentences."; stream = $false } | ConvertTo-Json
Invoke-RestMethod -Uri http://localhost:11434/api/generate -Method Post -Body $body -ContentType "application/json"

Ollama also offers an OpenAI-compatible endpoint under /v1, so many existing tools and libraries can point at it with minimal changes.

Option 2: LM Studio (graphical)

  1. Download LM Studio from lmstudio.ai and install it.
  2. Use the search tab to find a model. LM Studio shows which versions are likely to fit your hardware.
  3. Download a Q4 version of a 7B-9B model to start.
  4. Open the chat tab, load the model and begin.

LM Studio can also run a local server that speaks the OpenAI API format, which is handy for testing apps. In the model settings you can control how many layers are offloaded to the GPU; if the model does not fully fit in VRAM, partial offload still helps.

Choosing a model

  • General chat and writing: a 7-9B instruct model from the Llama, Qwen, Gemma or Mistral families.
  • Reasoning tasks: distilled DeepSeek-R1 versions are popular, but they "think" at length before answering, which is slow on CPU.
  • Coding: code-tuned models such as Qwen2.5-Coder.
  • Arabic: quality varies a lot between models. Test a few with your own real prompts before committing.

Small local models are not equal to the largest cloud assistants. Expect good help with drafting, summarising and simple code, and weaker results on complex reasoning and facts.

Running a local LLM on a VPS

You can install Ollama on a Windows or Linux VPS and use it as a private API for a bot or an internal tool. Be honest about the hardware: a standard VPS has no GPU, so generation runs on the CPU. That works for small models (1-4B, sometimes 7-8B with enough RAM) where a few seconds per answer is acceptable, such as classification, short replies or overnight batch summarising. It is not suitable for many simultaneous users or large models with fast responses.

If you expose Ollama beyond localhost on a server, protect it: keep it bound to 127.0.0.1 and put an authenticated reverse proxy in front, or allow access only from your own IP with a firewall rule. Choose a plan with enough RAM from the pricing page.

Troubleshooting

  • Very slow output: run ollama ps. If it shows 100% CPU, the model did not fit on your GPU; try a smaller model or lower quantization.
  • Out of memory errors: close other heavy apps or pick a smaller model.
  • GPU not used: update your GPU driver. NVIDIA cards are the best supported; AMD support depends on the card and tool.

FAQ

Can I run a local LLM on a laptop without a dedicated GPU?

Yes, small models of 1-4 billion parameters run on the CPU with 8-16 GB RAM. Responses are slower than cloud assistants but usable for short tasks.

Is a local LLM completely private?

The model runs on your machine and prompts are not sent anywhere by Ollama or LM Studio during chat. Downloads and updates still use the internet, and any plugin you add may have its own behaviour.

Ollama or LM Studio, which should I choose?

Choose LM Studio if you want a graphical app for chatting and testing models. Choose Ollama if you want a background service with a simple command line and API for scripts and other apps. Both are free to use.

Related guides