Menu

Cosmo Wiki

Configuration

YAML configuration reference and environment variables.

Configuration Reference

All runtime configuration is YAML-driven and loaded from cosmo/core/config/settings.yaml.

system:
  name: Zenith Cosmo 42
  codename: ZC-42
  language: pt-BR
  debug: true

personality:
  enabled: true
  active_profile: "cosmo"
  profiles_path: "cosmo/cognition/personality/profiles"

llm:
  provider: "openrouter"
  model: "nex-agi/nex-n2-pro:free"
  temperature: 0.4
  max_tokens: 512
  timeout: 30

audio:
  sample_rate: 16000
  channels: 1
  chunk_size: 2048
  silence_threshold: 500
  silence_timeout: 1.5
  max_record_seconds: 30

wakeword:
  enabled: true
  words:
    - cosmo
    - cosmos
    - cosme
    - zenith
    - zênite
  energy_threshold: 350
  idle_sleep: 0.03
  silence_grace_chunks: 6
  detection_cooldown: 2.0
  require_final_result: false

tts:
  engine: piper
  language: pt
  locale: pt_BR
  model: faber/medium/pt_BR-faber-medium
  voice: pt-br
  speed: 145
  pitch: 35
  volume: 120
  post_tts_cooldown: 2.0

vision:
  enabled: true
  auto_capture: true
  capture_interval: 10
  camera_index: 0
  width: 640
  height: 480
  grayscale: true
  snapshot_path: cosmo/data/cache/vision/latest.jpg
  warmup_frames: 8
  camera_open_retries: 5
  camera_open_retry_delay: 1.0
  frame_flush_reads: 6
  frame_flush_delay: 0.03
  camera_buffer_size: 1
  face_detection_enabled: true
  face_required_quality: true
  face_scale_factor: 1.05
  face_min_neighbors: 5
  face_min_size: 55
  face_min_area_ratio: 0.012
  face_max_center_y_ratio: 0.88
  face_min_aspect_ratio: 0.70
  face_max_aspect_ratio: 1.45
  face_max_results: 3
  face_eye_validation_enabled: true
  face_required_eyes: 1
  face_eye_scale_factor: 1.08
  face_eye_min_neighbors: 3
  face_eye_min_size: 10
  face_eye_required_min_area_ratio: 0.035
  face_preprocess_enabled: true
  face_clahe_clip_limit: 2.0
  face_clahe_tile_grid_size: 8

face_recognition:
  confidence_threshold: 70

memory:
  max_conversation_history: 20

database:
  path: data/database/cosmo.db

logs:
  level: DEBUG
  path: cosmo/data/logs/cosmo.log
  sqlite_enabled: true

webui:
  enabled: true
  host: 0.0.0.0
  port: 8765

Vision Settings

  • auto_capture controls periodic analysis and snapshot capture.
  • The camera may remain open persistently while auto-capture is active; a camera LED staying on can be expected in that mode.
  • capture_interval is not a video stream FPS; it is the delay between periodic capture/analysis cycles.
  • frame_flush_reads discards buffered camera frames to reduce stale snapshots.
  • frame_flush_delay spaces those flush reads.
  • camera_buffer_size requests a small camera buffer where the backend supports it.
  • CLAHE improves contrast for the detection frame, but it does not necessarily modify the displayed snapshot.
  • Eye validation reduces false positives but may be strict in low light, at distance, or with partial face visibility.
  • Face enrollment, recognition embeddings, identity matching, and tracking are not enabled by these settings yet.

Environment Variables

  • OPENROUTER_API_KEY: required for the OpenRouter LLM provider; no default.
  • .env file support: load_dotenv() is called at bootstrap import time.

Configuration Access in Code

from cosmo.core.config.settings_manager import config

sample_rate = config.get("audio", "sample_rate", default=16000)
wakeword_words = config.get("wakeword", "words", default=[])
face_min_size = config.get("vision", "face_min_size", default=55)