snigdho48/llm-cli

C#

0

17 commits

updated Jul 21, 2026

See the code

README

LLM CLI

Run a local AI coding assistant on your Windows PC — no cloud API key required.

LLM CLI sets up llama.cpp, downloads models, picks your GPU (Intel / NVIDIA / AMD), and starts an OpenAI-compatible server you can use with Cursor and other tools.


What you get

  • One command to start a local chat/API server (llm serve)
  • Works with Intel Iris Xe (Vulkan), NVIDIA (CUDA), AMD (ROCm), or CPU
  • Download models from Hugging Face
  • Connect Cursor to http://127.0.0.1:11434/v1 (or your chosen port)
  • Simple settings: context length, GPU layers, threads, port

Requirements

  • Windows 10/11
  • Self-contained Release exe / zip (no separate .NET install)
  • Optional: up-to-date GPU driver (Vulkan for Intel, NVIDIA Game Ready / Studio, AMD Adrenalin)

Pick the download that matches your CPU:

Your PCDownload
Normal 64-bit Windows (most laptops)llm-*-win-x64.exe or …-win-x64.zip
32-bit Windowsllm-*-win-x86.exe / zip
Windows on ARM (Snapdragon / Copilot+ PC)llm-*-win-arm64.exe / zip

Use these as a starting point. Prefer Q4_K_M GGUF files (good quality / size balance).
After changing settings: llm serve --restart.

Quick table

System RAMPreferred modelContextGPU layersCPU threadsNotes
4 GBTiny / avoid if possible20480 (CPU)2–4Barely usable; close other apps
8 GBqwen2.5-coder-3b40960–154Light coding only
16 GBqwen2.5-coder-3b or small 7B8192see GPU below4–6Comfortable for 3B; 7B is tight
32 GBqwen2.5-coder-7b ⭐16384see GPU below6–8Best everyday coding setup
64 GB7B–14B / DeepSeek Lite16384–32768see GPU below8–12Room for larger context & models

4 GB RAM

SettingValue
ModelSmallest you can find (≤ ~2 GB GGUF). Not recommended for Cursor coding.
Context2048
GPU layers0
Threads2–4
Profilecpu-only
llm config set Runtime:Context 2048
llm config set Runtime:GpuLayers 0
llm config set Runtime:Threads 4
llm profile use cpu-only

8 GB RAM

SettingValue
Modelqwen2.5-coder-3b (~2 GB)
Context4096
GPU layersIntegrated GPU: 10–15 · No GPU: 0
Threads4
Profilecpu-only or balanced
llm model pull qwen2.5-coder-3b --use
llm config set Runtime:Context 4096
llm config set Runtime:GpuLayers 0
llm config set Runtime:Threads 4

16 GB RAM

SettingValue
ModelPrefer qwen2.5-coder-3b for speed, or qwen2.5-coder-7b if you close heavy apps
Context8192 (use 4096 if the PC starts swapping)
GPU layersIntel iGPU: 20 · Discrete NVIDIA/AMD: 35–99 · CPU only: 0
Threads4–6
Profilebalanced
llm model pull qwen2.5-coder-3b --use
llm config set Runtime:Context 8192
llm config set Runtime:GpuLayers 20
llm config set Runtime:Threads 6
llm profile use balanced
SettingValue
Modelqwen2.5-coder-7b (Q4_K_M) — primary pick
Alternativesqwen3-coder-8b, codellama-7b, mistral-7b
Context16384
GPU layersIntel Iris Xe: 29 · Discrete GPU: 99 · CPU only: 0
Threads8
Profileiris-xe-coding / nvidia-cuda / amd-rocm / cpu-only
llm model pull qwen2.5-coder-7b --use
llm config set Runtime:Context 16384
llm config set Runtime:GpuLayers 29
llm config set Runtime:Threads 8
llm profile use iris-xe-coding
llm serve --restart

64 GB RAM

SettingValue
Modelqwen2.5-coder-7b (fast) or larger (e.g. DeepSeek-Coder Lite / 14B Q4)
Context16384–32768
GPU layersDiscrete: 99 · Intel iGPU: 29–35 · CPU: 0
Threads8–12
ProfileVendor profile, then raise context
llm model pull qwen2.5-coder-7b --use
llm config set Runtime:Context 32768
llm config set Runtime:Threads 12
llm serve --restart

Runtime:Threads should usually be about half to ¾ of your logical cores, not all of them (leave headroom for Windows + Cursor).

Logical cores (Task Manager)Suggested Runtime:Threads
2–42–4
6–84–6
8–126–8
12–168–12
16+12–16
llm config set Runtime:Threads 8

On llm init, press Enter to keep the suggested thread count.


GPUBackendGpuLayersProfileNotes
Intel Iris Xe / UHD (laptop)vulkan20–29iris-xe-codingShared memory with RAM; don’t set layers too high
Intel Arcvulkan35–99iris-xe-coding or customStronger than Iris Xe
NVIDIA (GTX/RTX)cuda (or vulkan)99nvidia-cudaBest speed when CUDA build is present
AMD (Radeon)rocm or vulkan99amd-rocmPrefer ROCm if available, else Vulkan
No usable GPU / unstablecpu0cpu-onlySlowest but most reliable
llm gpu list
llm gpu use 0 --backend vulkan --apply-profile   # Intel example
llm gpu use 0 --backend cuda --apply-profile     # NVIDIA example
llm gpu auto
llm gpu doctor                                   # Intel Vulkan / oneAPI check

Rule of thumb: more VRAM / discrete GPU → higher GpuLayers (often 99). Integrated Intel → stay around 20–29.


Install

Option A — Single EXE (easiest)

  1. Download the matching EXE from Releases
  2. Run install (copies itself to %LOCALAPPDATA%\LLM\bin and adds PATH):
.\llm-1.0.4-win-x64.exe install

Open a new terminal, then:

llm version

Option B — Zip + installer

.\install.ps1

Same result: llm.exe on PATH under %LOCALAPPDATA%\LLM\bin. Open a new terminal, then llm help.

Option C — From this repo

.\scripts\install.ps1

Uninstall: .\scripts\uninstall.ps1 (add -RemoveBinaries to delete installed files).


First-time setup (5 minutes)

Pick a workspace folder (example: D:\AI).

Guided

llm setup --workspace "D:\AI" --install-runtime

Step by step

llm init "D:\AI"                  # GPU/CPU + context / layers / threads / port
llm runtime install               # or: llm runtime import "C:\path\to\build"
llm model pull qwen2.5-coder-7b --use   # pick model for your RAM (table above)
llm serve
llm chat "Say hello in one sentence"
llm doctor

On init, press Enter to keep each recommended default.


Everyday use

Server

GoalCommand
Start + show API URLllm serve
Restart after config changellm serve --restart
Auto-start at logonllm serve --daemon
Status / stop / logsllm runtime status · llm runtime stop · llm logs

Example output:

OpenAI API : http://127.0.0.1:11434/v1
API Key    : local-ai

Chat & models

llm chat "Explain recursion simply"
llm model search coder
llm model pull qwen2.5-coder-7b --use
llm model list

Change settings later

llm config show
llm config set Runtime:Context 16384
llm config set Runtime:GpuLayers 29
llm config set Runtime:Threads 8
llm config set Runtime:Port 11434
llm serve --restart
KeyMeaning
Runtime:ContextHow much text the model can “see”
Runtime:GpuLayersHow much runs on GPU (0 = CPU only)
Runtime:ThreadsCPU threads
Runtime:PortLocal API port
Runtime:GpuBackendvulkan / cuda / rocm / cpu

Presets: llm profile list → llm profile use iris-xe-coding


Use with Cursor

  1. llm serve
  2. llm cursor or llm cursor --write
  3. In Cursor, set OpenAI-compatible base URL to:
http://127.0.0.1:11434/v1

API key (default): local-ai


Quick troubleshooting

ProblemTry this
llm not foundNew terminal after install; check PATH
Won’t startllm doctor · llm logs
Port in usellm config set Runtime:Port 11434 → llm serve --restart
Slow / no GPUllm gpu list → llm gpu use 0 --backend vulkan --apply-profile
Out of memory / thrashingSmaller model, lower context, GpuLayers 0
Intel Vulkan issuesllm gpu doctor → llm gpu fix --vulkan

More help

llm help
GuideFor
ModelsExtra model notes
CommandsFull command list
ConfigurationConfig file location
ContributingBuilding from source

License

MIT License — free and open source.

Copyright (c) 2026 MD. Atiquzzaman Snigdho

You may use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of this software, subject to including the copyright and permission notice. Full text: LICENSE.

Repo: https://github.com/snigdho48/llm-cli
Releases: https://github.com/snigdho48/llm-cli/releases

snigdho48/llm-cli

C#

0

17 commits

updated Jul 21, 2026

See the code

README

LLM CLI

Run a local AI coding assistant on your Windows PC — no cloud API key required.

LLM CLI sets up llama.cpp, downloads models, picks your GPU (Intel / NVIDIA / AMD), and starts an OpenAI-compatible server you can use with Cursor and other tools.


What you get

  • One command to start a local chat/API server (llm serve)
  • Works with Intel Iris Xe (Vulkan), NVIDIA (CUDA), AMD (ROCm), or CPU
  • Download models from Hugging Face
  • Connect Cursor to http://127.0.0.1:11434/v1 (or your chosen port)
  • Simple settings: context length, GPU layers, threads, port

Requirements

  • Windows 10/11
  • Self-contained Release exe / zip (no separate .NET install)
  • Optional: up-to-date GPU driver (Vulkan for Intel, NVIDIA Game Ready / Studio, AMD Adrenalin)

Pick the download that matches your CPU:

Your PCDownload
Normal 64-bit Windows (most laptops)llm-*-win-x64.exe or …-win-x64.zip
32-bit Windowsllm-*-win-x86.exe / zip
Windows on ARM (Snapdragon / Copilot+ PC)llm-*-win-arm64.exe / zip

Use these as a starting point. Prefer Q4_K_M GGUF files (good quality / size balance).
After changing settings: llm serve --restart.

Quick table

System RAMPreferred modelContextGPU layersCPU threadsNotes
4 GBTiny / avoid if possible20480 (CPU)2–4Barely usable; close other apps
8 GBqwen2.5-coder-3b40960–154Light coding only
16 GBqwen2.5-coder-3b or small 7B8192see GPU below4–6Comfortable for 3B; 7B is tight
32 GBqwen2.5-coder-7b ⭐16384see GPU below6–8Best everyday coding setup
64 GB7B–14B / DeepSeek Lite16384–32768see GPU below8–12Room for larger context & models

4 GB RAM

SettingValue
ModelSmallest you can find (≤ ~2 GB GGUF). Not recommended for Cursor coding.
Context2048
GPU layers0
Threads2–4
Profilecpu-only
llm config set Runtime:Context 2048
llm config set Runtime:GpuLayers 0
llm config set Runtime:Threads 4
llm profile use cpu-only

8 GB RAM

SettingValue
Modelqwen2.5-coder-3b (~2 GB)
Context4096
GPU layersIntegrated GPU: 10–15 · No GPU: 0
Threads4
Profilecpu-only or balanced
llm model pull qwen2.5-coder-3b --use
llm config set Runtime:Context 4096
llm config set Runtime:GpuLayers 0
llm config set Runtime:Threads 4

16 GB RAM

SettingValue
ModelPrefer qwen2.5-coder-3b for speed, or qwen2.5-coder-7b if you close heavy apps
Context8192 (use 4096 if the PC starts swapping)
GPU layersIntel iGPU: 20 · Discrete NVIDIA/AMD: 35–99 · CPU only: 0
Threads4–6
Profilebalanced
llm model pull qwen2.5-coder-3b --use
llm config set Runtime:Context 8192
llm config set Runtime:GpuLayers 20
llm config set Runtime:Threads 6
llm profile use balanced
SettingValue
Modelqwen2.5-coder-7b (Q4_K_M) — primary pick
Alternativesqwen3-coder-8b, codellama-7b, mistral-7b
Context16384
GPU layersIntel Iris Xe: 29 · Discrete GPU: 99 · CPU only: 0
Threads8
Profileiris-xe-coding / nvidia-cuda / amd-rocm / cpu-only
llm model pull qwen2.5-coder-7b --use
llm config set Runtime:Context 16384
llm config set Runtime:GpuLayers 29
llm config set Runtime:Threads 8
llm profile use iris-xe-coding
llm serve --restart

64 GB RAM

SettingValue
Modelqwen2.5-coder-7b (fast) or larger (e.g. DeepSeek-Coder Lite / 14B Q4)
Context16384–32768
GPU layersDiscrete: 99 · Intel iGPU: 29–35 · CPU: 0
Threads8–12
ProfileVendor profile, then raise context
llm model pull qwen2.5-coder-7b --use
llm config set Runtime:Context 32768
llm config set Runtime:Threads 12
llm serve --restart

Runtime:Threads should usually be about half to ¾ of your logical cores, not all of them (leave headroom for Windows + Cursor).

Logical cores (Task Manager)Suggested Runtime:Threads
2–42–4
6–84–6
8–126–8
12–168–12
16+12–16
llm config set Runtime:Threads 8

On llm init, press Enter to keep the suggested thread count.


GPUBackendGpuLayersProfileNotes
Intel Iris Xe / UHD (laptop)vulkan20–29iris-xe-codingShared memory with RAM; don’t set layers too high
Intel Arcvulkan35–99iris-xe-coding or customStronger than Iris Xe
NVIDIA (GTX/RTX)cuda (or vulkan)99nvidia-cudaBest speed when CUDA build is present
AMD (Radeon)rocm or vulkan99amd-rocmPrefer ROCm if available, else Vulkan
No usable GPU / unstablecpu0cpu-onlySlowest but most reliable
llm gpu list
llm gpu use 0 --backend vulkan --apply-profile   # Intel example
llm gpu use 0 --backend cuda --apply-profile     # NVIDIA example
llm gpu auto
llm gpu doctor                                   # Intel Vulkan / oneAPI check

Rule of thumb: more VRAM / discrete GPU → higher GpuLayers (often 99). Integrated Intel → stay around 20–29.


Install

Option A — Single EXE (easiest)

  1. Download the matching EXE from Releases
  2. Run install (copies itself to %LOCALAPPDATA%\LLM\bin and adds PATH):
.\llm-1.0.4-win-x64.exe install

Open a new terminal, then:

llm version

Option B — Zip + installer

.\install.ps1

Same result: llm.exe on PATH under %LOCALAPPDATA%\LLM\bin. Open a new terminal, then llm help.

Option C — From this repo

.\scripts\install.ps1

Uninstall: .\scripts\uninstall.ps1 (add -RemoveBinaries to delete installed files).


First-time setup (5 minutes)

Pick a workspace folder (example: D:\AI).

Guided

llm setup --workspace "D:\AI" --install-runtime

Step by step

llm init "D:\AI"                  # GPU/CPU + context / layers / threads / port
llm runtime install               # or: llm runtime import "C:\path\to\build"
llm model pull qwen2.5-coder-7b --use   # pick model for your RAM (table above)
llm serve
llm chat "Say hello in one sentence"
llm doctor

On init, press Enter to keep each recommended default.


Everyday use

Server

GoalCommand
Start + show API URLllm serve
Restart after config changellm serve --restart
Auto-start at logonllm serve --daemon
Status / stop / logsllm runtime status · llm runtime stop · llm logs

Example output:

OpenAI API : http://127.0.0.1:11434/v1
API Key    : local-ai

Chat & models

llm chat "Explain recursion simply"
llm model search coder
llm model pull qwen2.5-coder-7b --use
llm model list

Change settings later

llm config show
llm config set Runtime:Context 16384
llm config set Runtime:GpuLayers 29
llm config set Runtime:Threads 8
llm config set Runtime:Port 11434
llm serve --restart
KeyMeaning
Runtime:ContextHow much text the model can “see”
Runtime:GpuLayersHow much runs on GPU (0 = CPU only)
Runtime:ThreadsCPU threads
Runtime:PortLocal API port
Runtime:GpuBackendvulkan / cuda / rocm / cpu

Presets: llm profile list → llm profile use iris-xe-coding


Use with Cursor

  1. llm serve
  2. llm cursor or llm cursor --write
  3. In Cursor, set OpenAI-compatible base URL to:
http://127.0.0.1:11434/v1

API key (default): local-ai


Quick troubleshooting

ProblemTry this
llm not foundNew terminal after install; check PATH
Won’t startllm doctor · llm logs
Port in usellm config set Runtime:Port 11434 → llm serve --restart
Slow / no GPUllm gpu list → llm gpu use 0 --backend vulkan --apply-profile
Out of memory / thrashingSmaller model, lower context, GpuLayers 0
Intel Vulkan issuesllm gpu doctor → llm gpu fix --vulkan

More help

llm help
GuideFor
ModelsExtra model notes
CommandsFull command list
ConfigurationConfig file location
ContributingBuilding from source

License

MIT License — free and open source.

Copyright (c) 2026 MD. Atiquzzaman Snigdho

You may use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of this software, subject to including the copyright and permission notice. Full text: LICENSE.

Repo: https://github.com/snigdho48/llm-cli
Releases: https://github.com/snigdho48/llm-cli/releases