AI LLM Creation and Usage
Overview
What follows are the essential steps to create an AI LLM in Redhat\OEL\Alma 9 Linux.
Ensure CA Set
-- Install sudo dnf install -y \ ca-certificates \ p11-kit \ p11-kit-trust \ openssl sudo update-ca-trust -- QC ls -l /etc/pki/tls/certs/ca-bundle.crt curl -I https://www.google.com openssl s_client -connect ollama.com:443 -showcerts </dev/null Verify return code: 0 (ok)
Force-refresh Mozilla trust bundle
sudo dnf reinstall -y ca-certificates sudo update-ca-trust extract
DL Ollama
https://ollama.com/download/ollama-linux-amd64.tar.zst cp /media/sf_sw/Tools/ollama-linux-amd64.tar.zst /u01/sw/
Extract
cd /u01/sw tar -xvf ollama-linux-amd64.tar.zst bin/ollama mv bin/ollama . rmdir bin ls -lh ollama
Install
mv ollama /usr/local/bin/ chmod +x /usr/local/bin/ollama
Start Server (from a diff console)
ollama serve ollama --version ex: llama version is 0.18.2 -- 101 Tests ss -lntp | grep 11434
Pull a Model
---- Largest ollama pull gemma3 ollama list ---- Adequate ollama pull llama3 ollama list
Make Model Active
--- For gemma3
curl -s http://127.0.0.1:11434/api/generate \
-H 'Content-Type: application/json' \
-d '{
"model": "gemma3",
"prompt": "Say hello in one short sentence."
}'
---- For llama3
curl http://localhost:11434/api/generate -d '{
"model": "llama3",
"prompt": "Summarize this contract clause..."
}'
-- Manual Test Example
curl -s http://127.0.0.1:11434/api/chat \
-H 'Content-Type: application/json' \
-d '{
"model": "llama3",
"messages": [
{"role":"system","content":"Be concise."},
{"role":"user","content":"What is AlmaLinux?"}
]
}'
Post Reboot Essential Commands to Use LLM
1) Verify Ollama is running
systemctl status ollama --no-pager -l
✅ Active: active (running)
2) Confirm API is up
curl -s http://127.0.0.1:11434/api/version
✅ Should return JSON
3) Check models are still there
ollama list
4) Use it (two main ways)
🟢 Interactive (fastest sanity use)
ollama run llama3
🟢 API (what you’ll actually use in apps)
curl -s http://127.0.0.1:11434/api/chat \
-H 'Content-Type: application/json' \
-d '{
"model": "llama3",
"messages": [
{"role":"system","content":"Be concise."},
{"role":"user","content":"What is AlmaLinux?"}
]
}' | jq
✅ If something doesn’t work after reboot
systemctl status ollama --no-pager -l journalctl -u ollama -n 50 --no-pager ss -lntp | grep 11434
✅ Optional (recommended for production feel)
curl -s http://127.0.0.1:11434/api/generate -d '{
"model": "llama3",
"prompt": "ping"
}' > /dev/null