All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 12m56s
- models.json v1.3.0: providers.ollama.models 新增 9 個 purpose keys
(drift_summary/drift_intent/log_anomaly/nemoclaw/playbook_draft/
code_review/embedding/rag_generate/image_analysis)
- drift_narrator_service: NARRATOR_MODEL → get_model("ollama","drift_summary")
- drift_interpreter: MODEL → get_model("ollama","drift_intent")
- log_summary_service: SUMMARY_MODEL → get_model("ollama","log_anomaly")
- local_code_review_service: _MODEL_OLLAMA → get_model("ollama","code_review")
- image_analysis_service: _MODEL → get_model("ollama","image_analysis")
- decision_manager: nemoclaw + playbook_draft 兩處 → get_model()
- embedding_service: get_embedding_service() factory → get_model("ollama","embedding")
- knowledge_service: OllamaEmbeddingService(model=...) → get_model()
所有模型名稱現在統一由 models.json 管理,修改模型只需改一個檔案。
LOGBOOK 更新:D1 完成 + B2 已完成確認
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
251 lines
6.8 KiB
JSON
251 lines
6.8 KiB
JSON
{
|
||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
"name": "OpenClaw AI Router Configuration",
|
||
"version": "1.3.0",
|
||
"description": "AI 模型路由與備援設定 (ADR-006 + ADR-036 Nemotron + D1 ADR-067 五大應用 2026-04-11)",
|
||
"updated_at": "2026-04-11",
|
||
|
||
"default_provider": "ollama",
|
||
"fallback_order": ["ollama", "gemini", "claude"],
|
||
"tool_calling_fallback_order": ["nvidia", "gemini", "claude"],
|
||
|
||
"providers": {
|
||
"ollama": {
|
||
"name": "Ollama (Local M1 Pro)",
|
||
"enabled": true,
|
||
"priority": 1,
|
||
"endpoint": "http://192.168.0.111:11434",
|
||
"api_path": "/api/generate",
|
||
"models": {
|
||
"default": "deepseek-r1:14b",
|
||
"rca": "deepseek-r1:14b",
|
||
"summary": "gemma3:4b",
|
||
"drift_summary": "qwen2.5:7b-instruct",
|
||
"drift_intent": "qwen2.5:7b-instruct",
|
||
"log_anomaly": "deepseek-r1:14b",
|
||
"nemoclaw": "deepseek-r1:14b",
|
||
"playbook_draft": "qwen2.5:7b-instruct",
|
||
"code_review": "qwen2.5-coder:7b",
|
||
"embedding": "nomic-embed-text",
|
||
"rag_generate": "qwen2.5:7b-instruct",
|
||
"image_analysis": "llava:latest"
|
||
},
|
||
"options": {
|
||
"temperature": 0.1,
|
||
"top_p": 0.9,
|
||
"num_predict": 1024,
|
||
"format": "json"
|
||
},
|
||
"timeout_seconds": 120,
|
||
"cost": {
|
||
"per_1k_tokens": 0,
|
||
"currency": "USD"
|
||
},
|
||
"health_check": {
|
||
"endpoint": "/api/tags",
|
||
"interval_seconds": 60
|
||
}
|
||
},
|
||
|
||
"gemini": {
|
||
"name": "Google Gemini",
|
||
"enabled": true,
|
||
"priority": 2,
|
||
"endpoint": "https://generativelanguage.googleapis.com/v1beta",
|
||
"api_path": "/models/{model}:generateContent",
|
||
"models": {
|
||
"default": "gemini-2.0-flash",
|
||
"rca": "gemini-2.0-flash",
|
||
"summary": "gemini-2.0-flash"
|
||
},
|
||
"options": {
|
||
"temperature": 0.1,
|
||
"maxOutputTokens": 2048,
|
||
"responseMimeType": "application/json"
|
||
},
|
||
"timeout_seconds": 30,
|
||
"cost": {
|
||
"per_1k_tokens": 0.001,
|
||
"currency": "USD"
|
||
},
|
||
"auth": {
|
||
"type": "api_key",
|
||
"env_var": "GEMINI_API_KEY",
|
||
"query_param": "key"
|
||
},
|
||
"rate_limits": {
|
||
"daily_tokens": 70000,
|
||
"requests_per_minute": 60
|
||
}
|
||
},
|
||
|
||
"claude": {
|
||
"name": "Anthropic Claude",
|
||
"enabled": true,
|
||
"priority": 3,
|
||
"endpoint": "https://api.anthropic.com/v1",
|
||
"api_path": "/messages",
|
||
"models": {
|
||
"default": "claude-3-haiku-20240307",
|
||
"rca": "claude-3-haiku-20240307",
|
||
"summary": "claude-3-haiku-20240307"
|
||
},
|
||
"options": {
|
||
"max_tokens": 2048
|
||
},
|
||
"timeout_seconds": 30,
|
||
"cost": {
|
||
"per_1k_tokens": 0.008,
|
||
"currency": "USD"
|
||
},
|
||
"auth": {
|
||
"type": "header",
|
||
"env_var": "CLAUDE_API_KEY",
|
||
"header_name": "x-api-key"
|
||
},
|
||
"rate_limits": {
|
||
"daily_tokens": 35000,
|
||
"requests_per_minute": 50
|
||
},
|
||
"features": {
|
||
"tool_use": true,
|
||
"structured_output": true
|
||
}
|
||
},
|
||
|
||
"nvidia": {
|
||
"name": "NVIDIA Nemotron (ADR-036)",
|
||
"enabled": true,
|
||
"priority": 4,
|
||
"endpoint": "https://integrate.api.nvidia.com/v1",
|
||
"api_path": "/chat/completions",
|
||
"models": {
|
||
"default": "nvidia/nemotron-mini-4b-instruct",
|
||
"tool_calling": "nvidia/nemotron-mini-4b-instruct",
|
||
"rca": "nvidia/nemotron-mini-4b-instruct"
|
||
},
|
||
"options": {
|
||
"temperature": 0.0,
|
||
"max_tokens": 1024
|
||
},
|
||
"timeout_seconds": 30,
|
||
"cost": {
|
||
"per_1k_tokens": 0,
|
||
"currency": "USD",
|
||
"notes": "Free tier (2026-03-29) - timeout 30s,失敗後轉 Gemini"
|
||
},
|
||
"auth": {
|
||
"type": "header",
|
||
"env_var": "NVIDIA_API_KEY",
|
||
"header_name": "Authorization",
|
||
"header_prefix": "Bearer "
|
||
},
|
||
"rate_limits": {
|
||
"daily_tokens": 50000,
|
||
"requests_per_minute": 5
|
||
},
|
||
"features": {
|
||
"tool_use": true,
|
||
"structured_output": true,
|
||
"tool_calling_accuracy": 0.833
|
||
},
|
||
"use_for": ["tool_calling"]
|
||
}
|
||
},
|
||
|
||
"adr067_ollama_applications": {
|
||
"description": "ADR-067 五大 Ollama 本地 AI 應用 (Phase 30-34),endpoint: http://192.168.0.111:11434",
|
||
"endpoint": "http://192.168.0.111:11434",
|
||
"applications": {
|
||
"drift_summary": {
|
||
"phase": 30,
|
||
"model": "qwen2.5:7b-instruct",
|
||
"timeout_seconds": 90,
|
||
"purpose": "Config Drift 報告中文摘要"
|
||
},
|
||
"log_anomaly_summary": {
|
||
"phase": 31,
|
||
"model": "deepseek-r1:14b",
|
||
"timeout_seconds": 120,
|
||
"purpose": "K8s log 異常摘要,告警後觸發"
|
||
},
|
||
"pr_code_review": {
|
||
"phase": 32,
|
||
"model": "qwen2.5-coder:7b",
|
||
"timeout_seconds": 120,
|
||
"purpose": "Gitea PR 自動審查"
|
||
},
|
||
"rag_embed": {
|
||
"phase": 33,
|
||
"model": "nomic-embed-text",
|
||
"dimensions": 768,
|
||
"timeout_seconds": 30,
|
||
"purpose": "RAG 知識庫向量化,pgvector 儲存"
|
||
},
|
||
"rag_generate": {
|
||
"phase": 33,
|
||
"model": "qwen2.5:7b-instruct",
|
||
"timeout_seconds": 60,
|
||
"purpose": "RAG 查詢回答生成,top_k=5"
|
||
},
|
||
"image_analysis": {
|
||
"phase": 34,
|
||
"model": "llava:latest",
|
||
"timeout_seconds": 60,
|
||
"purpose": "Telegram 圖片分析"
|
||
}
|
||
}
|
||
},
|
||
|
||
"use_cases": {
|
||
"rca_analysis": {
|
||
"description": "Root Cause Analysis for alerts",
|
||
"preferred_provider": "ollama",
|
||
"fallback_enabled": true,
|
||
"required_features": ["json_output"]
|
||
},
|
||
"log_summary": {
|
||
"description": "Summarize K8s logs for context gathering",
|
||
"preferred_provider": "ollama",
|
||
"fallback_enabled": true,
|
||
"max_input_tokens": 4096
|
||
},
|
||
"telegram_compose": {
|
||
"description": "Compose compressed Telegram messages",
|
||
"preferred_provider": "ollama",
|
||
"fallback_enabled": false,
|
||
"max_output_tokens": 500
|
||
},
|
||
"tool_calling": {
|
||
"description": "K8s Tool Calling operations (ADR-036)",
|
||
"preferred_provider": "nvidia",
|
||
"fallback_enabled": true,
|
||
"fallback_order": ["gemini", "claude"],
|
||
"required_features": ["tool_use"],
|
||
"notes": "Nemotron 83.3% accuracy for K8s operations"
|
||
}
|
||
},
|
||
|
||
"monitoring": {
|
||
"enabled": true,
|
||
"metrics": {
|
||
"track_latency": true,
|
||
"track_tokens": true,
|
||
"track_cost": true,
|
||
"track_fallbacks": true
|
||
},
|
||
"alerts": {
|
||
"daily_cost_threshold_usd": 5,
|
||
"monthly_cost_threshold_usd": 10,
|
||
"fallback_rate_threshold_percent": 20
|
||
}
|
||
},
|
||
|
||
"circuit_breaker": {
|
||
"enabled": true,
|
||
"failure_threshold": 5,
|
||
"recovery_timeout_seconds": 60,
|
||
"half_open_requests": 3
|
||
}
|
||
}
|