Install Ollama’s Local LLM on Windows and Power It with ShellGPT

This guide walks you through installing the Ollama local large‑language‑model runtime on Windows, deploying a Gemma2 model, then setting up ShellGPT on Linux to interact with the local LLM, covering configuration, basic commands, and advanced usage examples.

Raymond Ops
Raymond Ops
Raymond Ops
Install Ollama’s Local LLM on Windows and Power It with ShellGPT

Install Local Large Model (Windows)

Step 1: Install Ollama

Download the installer from https://ollama.com/download.

Step 2: Search on the Ollama website

Open the Ollama website and locate the desired model.

Ollama model selection
Ollama model selection

Step 3: Deploy in terminal

ollama run gemma2:2b
Ollama deployment output
Ollama deployment output

Linux Installation of ShellGPT

Step 1: Install ShellGPT

Run pip install shell-gpt --break-system-packages to install.

Step 2: Edit .sgptrc configuration file

Edit ~/.config/shell_gpt/.sgptrc and add the following options:

DEFAULT_MODEL=ollama/gemma2:9b
OPENAI_USE_FUNCTIONS=false
SHOW_FUNCTIONS_OUTPUT=false
API_BASE_URL=http://192.168.79.249:11434  # local server IP

Initialize ShellGPT

Provide any string as the initial API key.

sgpt

ShellGPT Feature Test

General function

Example: sgpt "你是谁" returns an introduction of the AI assistant.

Shell command generation

Example: sgpt -s "查看当前目录" suggests using pwd to display the current directory.

Code generation

Example:

sgpt -c "写一个shell脚本,要求获取cpu核数线程,内存大小,磁盘大小,网络带宽"

List chats

Use sgpt --list-chats to list all conversations.

Show chat info

Use sgpt --show-chat <path> to view a specific chat.

Start interactive REPL

Run sgpt --repl temp to enter REPL mode.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxWindowsAI AssistantOllamaLocal-LLMShellGPT
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.