分類彙整: AI

Hermes 安裝

第一步:安裝 Hermes Agent

在 Linux、macOS、WSL2 或 Android (Termux) 上執行以下指令:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

第二步:驗證安裝
hermes doctor

設定 MiniMax 為模型提供商
hermes model

開始使用
hermes
或使用現代 TUI 介面:
hermes –tui

補充:切換模型

在對話過程中,可以使用 /model 指令即時切換模型,無需重啟 session

Linux系統安裝ComfyUI,架設Stable Diffusion AI生圖服務

https://ivonblog.com/posts/stable-diffusion-comfyui/

https://ivonblog.com/posts/comfyui-linux-installation

python3 main.py –listen 0.0.0.0 –port 8188
sudo ufw allow 8188/tcp
若要從瀏覽器跨網域呼叫 ComfyUI API,加上:
--enable-cors-header "*" (或指定你的網域)
直接讓 ComfyUI 自帶 TLS(較簡單,仍建議加防護)
python3 main.py –listen 0.0.0.0 –port 8188 \
–tls-keyfile /path/privkey.pem \
–tls-certfile /path/fullchain.pem

設為開機自動啟動(systemd)
建立 /etc/systemd/system/comfyui.service
[Unit]
Description=ComfyUI
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/ubuntu/ComfyUI
ExecStart=/home/jeng/anaconda3/envs/comfyui/bin/python3 main.py –listen 0.0.0.0 –port 8188
Restart=on-failure

[Install]
WantedBy=multi-user.target
啟用:
sudo systemctl daemon-reload
sudo systemctl enable –now comfyui
sudo systemctl status comfyui




https://ivonblog.com/posts/comfyui-docker-installation/



https://www.youtube.com/watch?v=MFqbWAUsd5U

OLlama 安裝 Google MedGemma 模型(失敗)

以下步驟示範如何把 MedGemma(Google 針對醫療領域釋出的 Gemma 3 變體)裝進 Ollama,並分別說明「文字版 27 B」和「多模態 4 B(看圖)」兩種情境。

建議放在專用資料夾

mkdir -p ~/ollama-models/medgemma && cd ~/ollama-models/medgemma

27 B(文字版,Q4_K_M 量化)

wget -c https://huggingface.co/unsloth/medgemma-27b-text-it-GGUF/resolve/main/medgemma-27b-text-it-Q4_K_M.gguf

4 B(多模態版,Q4_K_M 量化 + mmproj 投影層)

wget -c https://huggingface.co/unsloth/medgemma-4b-it-GGUF/resolve/main/medgemma-4b-it-Q4_K_M.gguf
wget -c https://huggingface.co/unsloth/medgemma-4b-it-GGUF/resolve/main/mmproj-F16.gguf

若想用 原生 pre-train (-pt) 版,檔名一樣要注意大小寫:
wget -c https://huggingface.co/mradermacher/medgemma-4b-pt-GGUF/resolve/main/medgemma-4b-pt-F16.gguf

2. 撰寫 Modelfile

2.1 文字版 27 B

Modelfile 內容(放在同一目錄):
Modelfile27B

FROM ./medgemma-27b-text-it-Q4_K_M.gguf

TEMPLATE """
{{- if .System }}<|im_start|>system
{{.System}}<|im_end|>{{ end -}}
{{- if .Prompt }}<|im_start|>user
{{.Prompt}}<|im_end|>{{ end -}}
<|im_start|>assistant
{{.Response}}<|im_end|>
"""

PARAMETER num_ctx 8192

2.2 多模態 4 B

多模態必須同時載入 主 GGUFmmproj 投影層檔案;Ollama 允許用兩行 FROMOllama
Modelfile4B

FROM ./mmproj-F16.gguf              # 第 1 行:視覺投影層
FROM ./medgemma-4b-it-Q4_K_M.gguf # 第 2 行:4B 主模型

TEMPLATE """
{{- if .System }}<|im_start|>system
{{.System}}<|im_end|>{{ end -}}
{{- if .Prompt }}<|im_start|>user
{{.Prompt}}<|im_end|>{{ end -}}
<|im_start|>assistant
{{.Response}}<|im_end|>
"""

PARAMETER num_ctx 4096

3. 建立並測試模型

# 建立 27B
ollama create medgemma-27b -f ./Modelfile27B
# 建立 4B
ollama create medgemma-4b-vision -f ./Modelfile4B

文字測試
ollama run medgemma-27b

你是誰?

圖像/多模態測試(Ollama CLI)

ollama run medgemma-4b-vision \
--image chest_xray.png \
-p "請描述這張影像的主要異常位置"

或透過 HTTP API:

curl http://localhost:11434/api/generate \
-d '{
"model": "medgemma-4b-vision",
"prompt": "Read this fundus photo and report findings in Chinese",
"images": ["data:image/png;base64,...."]
}'