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.
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.
Step 3: Deploy in terminal
ollama run gemma2:2b
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 IPInitialize 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
