Files
sentinel-home-ai/fam-edge/config/config.yaml
ericwyuan 853cb21542 fix: NVIDIA single-frame JSON parsing + Gemini timeout/circuit breaker tuning
NVIDIA fix:
- Replace parse_vlm_json (requires full schema: global_summary/entities_json/
  frame_details/compute_provider) with lightweight _parse_single_frame_json
  that only extracts per-frame fields (person/action/clothing/etc)
- Root cause: NVIDIA adapter does per-frame analysis returning single-frame
  JSON, but parse_vlm_json rejected it for missing full-schema fields
- Verified: task 297 → 6/6 frames parsed successfully, first SUCCESS

Gemini + circuit breaker tuning:
- Gemini timeout: 30s → 90s (multi-image vision analysis needs more time)
- NVIDIA timeout: 20s → 30s (per-frame API call)
- Circuit breaker threshold: 3 → 5 (less aggressive tripping)
- Circuit breaker cooldown: 600s → 300s (faster recovery)
2026-08-20 11:02:26 +08:00

86 lines
2.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# FAM-Edge 配置文件 (Oracle 端) - 多模型池配置
# Tailscale: Oracle=100.74.137.126, NAS=100.70.234.39
# NAS 端回调地址
nas:
webhook_url: "http://100.70.234.39:8000/api/core/callback/event"
media_base_url: "http://100.70.234.39:8000/media"
media_token: "sentinel-media-2026"
# Oracle 端服务
server:
host: "0.0.0.0"
port: 5000
max_concurrent_tasks: 1
# 编排调度模式: fallback(顺序降级, 默认) | ensemble(并行交叉验证)
orchestrator:
mode: "fallback"
overall_timeout: 600
# 关键帧筛选参数(自适应:帧数随视频时长动态计算)
video:
candidate_per_minute: 2 # 每分钟粗抽候选帧数
candidate_min: 30 # 候选帧下限(短视频保底)
candidate_max: 120 # 候选帧上限(超长视频截断)
key_frame_interval_sec: 150 # 关键帧间隔每2.5分钟1张
min_key_frames: 5 # 关键帧下限(帧差不足时补足到此数)
max_key_frames_floor: 8 # 关键帧上限的下限(短视频保底)
max_key_frames_cap: 30 # 关键帧上限(超长视频截断)
mse_threshold: 500
jpeg_quality: 80
max_long_edge: 1024
# 超时(秒)
timeout:
download: 60
vlm_visual: 600
vlm_fusion: 300
callback: 30
overall: 1800
# 多模型池配置(新框架:本地大模型不参与视频分析,仅智能问答兜底)
#
# 视频分析链路(推送模式):
# 云端 VLM 直接产出结构化 JSON (global_summary / entities_json / frame_details)
# -> Edge 仅做格式化/校验 (format_cloud_result) -> 直接回写 NAS无本地融合步骤
# 视觉角色: Gemini(主) -> NVIDIA NIM(备) 顺序降级; 两云端全失败 -> 任务 FAILED 走重试
#
# 智能问答链路:
# Gemini -> NVIDIA -> 本地 Ollama (仅当两云端都失败才启用本地兜底)
models:
- provider: "gemini"
role: "vision"
enabled: true
model_name: "gemini-flash-latest" # v1beta 下 gemini-1.5-flash 会 404
api_key: "${GEMINI_API_KEY}"
timeout: 90
circuit_breaker:
enabled: true
threshold: 5
cooldown: 300
- provider: "nvidia"
role: "vision"
enabled: true
model_name: "meta/llama-3.2-11b-vision-instruct"
base_url: "https://integrate.api.nvidia.com/v1"
api_key: "${NVIDIA_API_KEY}"
timeout: 30
circuit_breaker:
enabled: true
threshold: 5
cooldown: 300
# 本地模型:纯文本 qwen2.5:7b仅参与智能问答作为 Gemini/NVIDIA 都失败时的兜底
- provider: "ollama"
role: "text"
usage: "qa_fallback"
enabled: true
model_name: "qwen2.5:7b"
base_url: "http://localhost:11434"
timeout: 120
num_predict: 512
circuit_breaker:
enabled: false