🚀 Wave 3 install 教學 · 2026-05-17

Hermes / free-claude-code Install 教學

M1 MacBook 24GB / 1TB · 一邊看一邊裝

總時間估 ~ 60-90 min · 含等待 + 填表
📋 9 個 step 每完成 1 step, 自己 ☐ → ☑ (printable 友善) 或心裡 check

目錄

  1. A0 · M1 MacBook 評估 + 紀律 (先讀, 1 min)
  2. A1 · 環境確認 (5 min)
  3. A2 · 申請 NVIDIA NIM 免費 API key (15 min)
  4. A3 · 裝前置工具 Homebrew / Claude Code / uv / Python (10 min)
  5. A4 · Clone + 設定 free-claude-code (10 min)
  6. A5 · 啟動 gateway 跑通 (5 min)
  7. A6 · 設成 24/7 launchd (含 nice/caffeinate) (10 min)
  8. A7 · 驗證 Claude Code 走 gateway (5 min)
  9. A8 · 完成, 截圖回我看 (1 min)

A0M1 MacBook 評估 + 紀律 (先讀)1 min

你的 M1 MacBook 24GB / 1TB 完全可以裝。不必另買 Mac mini。

影響評估

資源影響你的占比
Disk~800 MB0.08% / 1TB
RAM idle~150 MB0.6% / 24GB
RAM peak300-500 MB1-2%
CPU idle~0%-
CPU processing10-30% 1 core / 2-5 秒/req有 nice -n 10 不擾你開發
電力 idle~3-5W跟開幾個 Chrome tab 一樣

4 條 M1 MacBook 特有紀律

Scale 警告 1-5 客戶 OK / 10-30 客戶 邊緣 (重啟頻率) / 30+ 客戶 升 Hetzner VM (€5/mo) 或買 Mac mini M4 (NT$20K)

A1環境確認5 min

確認 MacBook 系統版本 + 磁碟空間 + 連網

$ Terminal
sw_vers
df -h /
ping -c 3 google.com
預期 sw_vers: macOS 14+ (Sonoma 或 Sequoia)
df: Available ≥ 5GB
ping: 0% packet loss

A2申請 NVIDIA NIM 免費 API key15 min

免費跑 DeepSeek V4 / GLM 4.7 / Llama 3.3 70B 的關鍵 — 慷慨額度, side hustle 完全夠

  1. https://build.nvidia.com (不要用 VPN, 美/台 IP 可)
  2. 右上 Sign In → 用 gmail 註冊
  3. 填表:
    • Username: ezonelaironsunai
    • Password: 你的標準密碼 (我已記在 user memory)
    • Company: RSun Ltd. (沒登記也填這個)
    • Country: Taiwan
    • Role: Software Engineer
  4. 驗證 email (gmail 收信點連結)
  5. 登入後左側選 API Keys → 點 Generate API Key
  6. Key name: rsun-free-claude-code-gateway
  7. 點 Generate → 複製 nvapi-xxxxxxxxxxxxxx... (只顯示 1 次)
  8. 暫存到 macOS Notes / 1Password (待會 A4 用)
截圖 free tier 額度 (Usage 頁) 寄給我看, 我們才知能跑多少。

A3裝前置工具10 min

Homebrew + Claude Code + uv (Python package manager) + Python 3.14

3.1 Homebrew (如果沒有)

$ Terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
預期 出現 `Installation successful!` + 提示加 PATH 到 .zshrc

3.2 Claude Code CLI 官方正版

brew install --cask claude-code
claude --version
預期 顯示 v2.1.x

3.3 uv (取代 pip 的快速 Python manager)

curl -LsSf https://astral.sh/uv/install.sh | sh
uv self update
uv python install 3.14
預期 Python 3.14 安裝成功

A4Clone + 設定 free-claude-code10 min

clone repo, 填 NVIDIA NIM key 到 .env

4.1 Clone repo

cd ~
git clone https://github.com/Alishahryar1/free-claude-code.git
cd free-claude-code
cp .env.example .env

4.2 編輯 .env (填 A2 拿到的 key)

nano .env

只改這 2 行 (其他先留空):

NVIDIA_NIM_API_KEY="nvapi-xxxxxxxxxxxxxx..."
MODEL="nvidia_nim/deepseek-ai/deepseek-v4-pro"

存檔: Ctrl+OEnterCtrl+X

A5啟動 gateway 跑通5 min

先手動跑 1 次驗證, 再下一步才設 launchd 永久跑

5.1 啟動 (Terminal tab 1)

cd ~/free-claude-code
uv run uvicorn server:app --host 0.0.0.0 --port 8082
預期 Terminal 顯示 Uvicorn running on http://0.0.0.0:8082
保持 terminal 開著, 不要按 Ctrl+C

5.2 測 gateway 通不通 (Terminal tab 2 — 新開一個)

curl http://localhost:8082/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: freecc" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 50,
    "messages": [{"role": "user", "content": "Hi, who are you?"}]
  }'
預期 JSON 含 DeepSeek V4 生的回覆, key 在 content[0].text
例: {"id":"msg_01","content":[{"type":"text","text":"Hi! I'm Claude..."}],...}
如果 curl 失敗 1. tab 1 是否還在跑? (沒 Ctrl+C)
2. tab 1 有沒有錯誤 log? (`.env` 寫對了?)
3. lsof -i :8082 確認 port 開了

A6設成 24/7 launchd (M1 紀律: nice + caffeinate)10 min

A5 是手動跑, 每次重啟就要重啟。launchd 解決這個 — MacBook 開機就跑, 蓋筆電仍跑 (caffeinate), 不搶 CPU (nice)

6.1 停掉 A5 的 uvicorn

tab 1 按 Ctrl+C

6.2 建 launchd plist

cat > ~/Library/LaunchAgents/com.rsun.free-claude-code.plist <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key><string>com.rsun.free-claude-code</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/bin/caffeinate</string>
    <string>-s</string>
    <string>/usr/bin/nice</string>
    <string>-n</string>
    <string>10</string>
    <string>/Users/ezonelai/.local/bin/uv</string>
    <string>run</string>
    <string>uvicorn</string>
    <string>server:app</string>
    <string>--host</string>
    <string>0.0.0.0</string>
    <string>--port</string>
    <string>8082</string>
  </array>
  <key>WorkingDirectory</key><string>/Users/ezonelai/free-claude-code</string>
  <key>RunAtLoad</key><true/>
  <key>KeepAlive</key><true/>
  <key>StandardOutPath</key><string>/tmp/free-claude-code.log</string>
  <key>StandardErrorPath</key><string>/tmp/free-claude-code.err</string>
  <key>ProcessType</key><string>Background</string>
</dict>
</plist>
EOF
plist 內含 M1 紀律 caffeinate -s = MacBook 蓋上不睡眠
nice -n 10 = 低優先級, 不搶你開發 CPU
ProcessType Background = macOS 自動降頻

6.3 啟用

launchctl load ~/Library/LaunchAgents/com.rsun.free-claude-code.plist
ps aux | grep uvicorn | grep -v grep
預期 ps 應看到 uvicorn process
curl http://localhost:8082 仍 200

6.4 重啟測試 (重要!)

  1. 關機重開 MacBook
  2. 登入桌面後等 30 秒
  3. curl http://localhost:8082/v1/messages -X POST ... (跟 A5.2 一樣)
  4. 仍 200 = launchd 自動啟動 OK ✅
未來重啟筆電前的紀律 建議先 launchctl unload ~/Library/LaunchAgents/com.rsun.free-claude-code.plist
再 reboot, 避免 launchd 卡。(reboot 後再 launchctl load)
但如果你直接重啟也 OK, KeepAlive 會處理。

A7驗證 Claude Code 走 gateway5 min

啟動 Claude Code CLI 透過 gateway, 確認真的跑免費 LLM

$ Terminal
cd ~/free-claude-code
ANTHROPIC_AUTH_TOKEN="freecc" \
  ANTHROPIC_BASE_URL="http://localhost:8082" \
  claude

進入 Claude Code prompt, 試一個小 task:

> 寫一個 Python hello world function
預期 Claude Code 顯示「Sonnet 4.6」但實際是 DeepSeek V4 跑 (慢一點 ~5 秒)
回應內含正確的 Python code
速度比較慢是正常 DeepSeek V4 ~5-30 秒/response (Sonnet 直接 ~ 2-5 秒). 但 0 cost.
簡單 task 改用 haiku: claude -p "task" --model haiku

A8完成, 截圖回我看1 min

告訴 Zenya 你 install 完了, 我立刻動 Wave 4A

  1. 截圖:
    • (a) NVIDIA Usage 頁的 free tier 額度
    • (b) A7 Claude Code 跑 hello world 的 Terminal 畫面
  2. Telegram / 對話傳給 Zenya: 「Hermes install 完成」+ 2 張截圖
  3. Zenya 立刻動 Wave 4A (D1 FTS5 chat history)
  4. Zenya 改 sched-* 的 ANTHROPIC_BASE_URL 走 gateway (RSun 18 cron 自動切免費 LLM)
Trouble? 任一 step 卡住, ping 我 + 貼 Terminal 錯誤 log, 我幫你 debug。