CC-Switch和codex整合教學(Integrated tutorial of CCSwitch and CodeX)
CC-Switch和codex整合教學(Integrated tutorial of CCSwitch and CodeX)
資料來源: https://share.gemini.google/N38cNeJEncMs [AI教學對話PDF ~ 重要啟發]
https://www.youtube.com/watch?v=ydH_mOafdWw [最初教學影片 ~ 參考用]
GITHUB: https://github.com/jash-git/Integrated-tutorial-of-CCSwitch-and-CodeX
完整重點步驟
01.關閉所有ccswich和codex 要檢查系統工作列是否隱藏未關閉的狀況
02.開啟ccswich 如圖設定





03.開啟CodeX進行常規登入
04.開始使用CodeX
One thought on “CC-Switch和codex整合教學(Integrated tutorial of CCSwitch and CodeX)”
能支援 claude code desktop 和 codeX 的vLLM docker 設定檔
services:
# ----------------------------------------------------------------
# 1. Redis 服務:用於高速分散式流控 (Rate Limiting) 與快取
# ----------------------------------------------------------------
redis:
image: redis:7-alpine
container_name: litellm-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- ./redis_data:/data
# ----------------------------------------------------------------
# 2. PostgreSQL 資料庫:儲存 LiteLLM 的金鑰、額度、用戶與消費日誌
# ----------------------------------------------------------------
db:
image: postgres:16-alpine
container_name: litellm-db
restart: unless-stopped
environment:
POSTGRES_USER: litellm_user
POSTGRES_PASSWORD: SecurePassword123! # 💡 生產環境建議修改此密碼
POSTGRES_DB: litellm_db
volumes:
- ./postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
# ----------------------------------------------------------------
# 3. vLLM 服務(已修正位置參數與 Tool Call Parser)
# ----------------------------------------------------------------
vllm-qwen:
image: vllm/vllm-openai:latest-aarch64
container_name: vllm-qwen
restart: unless-stopped
ipc: host
ports:
- "8000:8000"
volumes:
- /data/models/Qwen/Qwen3.6-35B-A3B-NVFP4:/model
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
environment:
- FORCE_CUDA=1
- PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
- VLLM_TORCH_COMPILE_LEVEL=0
# 🎯 修正處:直接把 /model 當作位置參數置於最前,並改用 qwen3_xml 解析器
command: >
/model
--served-model-name Qwen3.6-35B-FP4
--api-key "MySecretKey_123456"
--gpu-memory-utilization 0.75
--max-model-len 131072
--quantization modelopt
--kv-cache-dtype fp8
--max-num-seqs 64
--max-num-batched-tokens 8192
--enable-auto-tool-choice
--tool-call-parser qwen3_xml
--reasoning-parser deepseek_r1
--trust-remote-code
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 10s
timeout: 5s
retries: 60
start_period: 90s
# ----------------------------------------------------------------
# 4. LiteLLM Proxy 閘道:嚴格等待 vLLM 載入完畢後才對外服務
# ----------------------------------------------------------------
litellm-proxy:
image: ghcr.io/berriai/litellm:main-v1.60.0
container_name: litellm-proxy
restart: unless-stopped
ports:
- "4000:4000"
volumes:
- ./litellm-config.yaml:/app/config.yaml
depends_on:
db:
condition: service_started
redis:
condition: service_started
vllm-qwen:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://litellm_user:SecurePassword123!@db:5432/litellm_db
- REDIS_URL=redis://litellm-redis:6379
- LITELLM_MASTER_KEY=sk-master-key-1234567890
command: [ "--config", "/app/config.yaml" ]
# ----------------------------------------------------------------
# 5. Open WebUI (已啟用帳號密碼登入與註冊)
# ----------------------------------------------------------------
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
restart: unless-stopped
ports:
- "3000:8080"
volumes:
- ./webui_data:/app/backend/data
depends_on:
litellm-proxy:
condition: service_started
searxng: # 讓 WebUI 等待搜尋引擎啟動
condition: service_started
environment:
- OPENAI_API_BASE_URL=http://litellm-proxy:4000/v1
- OPENAI_API_KEY=sk-master-key-1234567890
- ENABLE_OLLAMA_API=False
# 🎯 【修改處:啟用登入驗證與註冊功能】
- WEBUI_AUTH=True # 開啟登入驗證
- ENABLE_SIGNUP=True # 開啟註冊功能(第一個註冊的帳號會自動變成管理員)
- WEBUI_NAME=Local AI Workspace
- ENABLE_RAG_WEB_SEARCH=True
- RAG_WEB_SEARCH_ENGINE=searxng
- RAG_WEB_SEARCH_RESULT_COUNT=3
- SEARXNG_QUERY_URL=http://searxng:8080/search?q=
# ----------------------------------------------------------------
# 6. SearXNG:在地端運作的隱私搜尋引擎
# ----------------------------------------------------------------
searxng:
image: searxng/searxng:latest
container_name: searxng
restart: unless-stopped
# 🎯 新增 volumes 掛載本地設定檔
volumes:
- ./searxng:/etc/searxng
environment:
- SEARXNG_SETTINGS_URL=/etc/searxng/settings.yml