Skip to content

Configuration Guide

Annolid separates desktop annotation settings, reproducible CLI model run configs, and local agent/LLM settings so each surface stays inspectable, atomic on write, and safe to version without leaking credentials.

Configuration Files at a Glance

Path Format Scope Persistence & Permissions
~/.labelmerc YAML GUI defaults, canvas, shortcuts, SAM/SAM3, tracker, realtime Copied atomically from annolid/configs/default_config.yaml on first run
Qt QSettings (Annolid/Annolid) Native OS store Window geometry, recent files/projects, dock/overlay toggles, panel profiles Managed by SettingsManager; JSON export/import preserves QPoint/QSize
annolid/configs/runs/*.yaml YAML Reproducible annolid-run train / predict job templates Version-controlled templates passed via --run-config
~/.annolid/config.json JSON Agent runtime, sandboxed shell, channels, MCP servers, integrations, secrets.refs Atomic write, 0o600 file in 0o700 directory; ref-backed secrets scrubbed on save
~/.annolid/agent_secrets.json JSON Private local secret store referenced by secrets.refs Atomic write, 0o600 file
~/.annolid/llm_settings.json JSON LLM providers, preferred models, agent profiles, loop timeouts Atomic write, 0o600 file; API keys and tokens scrubbed on save
~/.annolid/.env dotenv User-level environment fallback for API keys and hosts Atomic write, 0o600 file; never overrides existing shell env vars
~/.annolid/tts_settings.json JSON Active TTS engine, voice, speed, and prompt path Atomic write via atomic_write_json
~/.annolid/voice_profiles.json JSON Named TTS voice profiles Atomic write via atomic_write_json

Never commit ~/.annolid/config.json, ~/.annolid/agent_secrets.json, ~/.annolid/.env, or OAuth tokens into Git repositories.

GUI and Annotation Config (~/.labelmerc and --config)

On launch, annolid loads configuration in the following precedence order (later entries override earlier ones):

  1. Built-in defaults in annolid/configs/default_config.yaml.
  2. A YAML file path or inline YAML mapping passed via --config (defaults to ~/.labelmerc).
  3. Explicit CLI flags (--autosave, --nodata, --labels, --flags, --keep-prev, --epsilon).

Examples:

# Use a project-specific GUI configuration file
annolid --config ./lab_project_config.yaml

# Pass inline YAML overrides
annolid --config "auto_save: true"

# Provide comma-separated or file-backed labels and flags
annolid --labels "mouse_1, mouse_2" --flags ./behavior_flags.txt --autosave

Key sections in default_config.yaml:

  • canvas and shape: polygon/keypoint rendering colors, crosshair toggles, num_backups, allow_points_outside_image, show_label_names, show_behavior_overlay.
  • ai: default interactive model (Cutie by default).
  • sam and sam3: SAM checkpoint defaults and SAM3 video propagation, sliding window, and agent seeding options.
  • shortcuts: keyboard bindings (with automatic migration of legacy Ctrl+Shift+A collisions on toggle_auto_save to Ctrl+Alt+S).
  • tracker and realtime: Cutie+DINO motion/mask defaults and realtime streaming defaults.

Annolid automatically migrates older top-level keys (keep_prev_brightness_contrast, top-level reject_implausible_masks, legacy AI model defaults, and conflicting toggle_auto_save shortcuts) in memory without breaking existing ~/.labelmerc files.

CLI Run Configs (--run-config)

For reproducible training and inference runs, pass a YAML run config to annolid-run train or annolid-run predict:

annolid-run train yolo --run-config annolid/configs/runs/yolo_train.yaml --epochs 100
annolid-run train dino_kpseg --run-config annolid/configs/runs/dino_kpseg_train.yaml

Bundled templates live under annolid/configs/runs/:

  • yolo_train.yaml
  • dino_kpseg_train.yaml
  • detectron2_maskrcnn_train.yaml
  • detectron2_maskrcnn_finetune.yaml
  • detectron2_mvitv2_train.yaml
  • detectron2_vitdet_train.yaml
  • cutie_vos_train.yaml (Hydra overrides template)

Resolution rules in annolid/engine/run_config.py:

  • Section lookup order: models.<model>.<mode> → <model>.<mode> → <mode> → top-level YAML mapping.
  • CLI precedence: explicit CLI flags are appended after expanded YAML arguments so command-line overrides always win.
  • Key formatting: YAML snake_case keys map automatically to --kebab-case CLI flags (for example batch_size → --batch-size).
  • Typo visibility: unrecognized YAML keys log a warning rather than disappearing silently.

Agent, LLM, and Voice Configuration (~/.annolid/)

Agent Runtime (~/.annolid/config.json)

The agent configuration stores workspace rules (tools.restrictToWorkspace, tools.allowedReadRoots), sandboxed shell limits (tools.exec), tool allow/deny policies, MCP servers (tools.mcpServers), optional channels (Zulip, WhatsApp, email), Box/Google integrations, and secret references (secrets.refs).

  • Keys are persisted as camelCase on disk and normalized on load (while preserving literal keys inside env, extraHeaders, byProvider, refs, mcpServers, and providers).
  • Secret commands (agent-secrets-set, agent-secrets-remove, agent-secrets-migrate) handle both snake_case and camelCase dot paths consistently, scrub ref-backed secrets on save, and write atomically with 0o600 permissions.

See Agent Secrets, Agent Security, MCP, and Sandboxed Shell for detailed configuration guides.

LLM Settings (~/.annolid/llm_settings.json and ~/.annolid/.env)

  • Provider credentials are never persisted inside llm_settings.json; save_llm_settings() recursively scrubs keys matching secret/token patterns and writes with 0o600 permissions.
  • Environment variable precedence is: process environment → workspace ./.env → ~/.annolid/.env → inline env entries.
  • Values written to ~/.annolid/.env with spaces, #, quotes, or backslashes are JSON-escaped and decoded losslessly on reload.

Voice and TTS (~/.annolid/tts_settings.json)

TTS settings and named voice profiles (~/.annolid/voice_profiles.json) are shared across PDF read-aloud, Annolid Bot chat, and Tutorial Video Studio. See Voice, TTS & Narration Studio.

Key Environment Variables

Variable Default Purpose
QT_QPA_PLATFORM OS default Set to offscreen for headless GUI tests and CI
ANNOLID_DISABLE_BOT_AUTOSTART unset Set to 1 to prevent Annolid Bot background autostart
ANNOLID_MEMORY_ENABLED true Enable or disable the LanceDB memory backend (true/false/1/0)
ANNOLID_MEMORY_LANCEDB_PATH ~/.annolid/memory/lancedb Local directory for LanceDB memory tables
ANNOLID_MEMORY_EMBEDDING_PROVIDER jina Embedding provider for memory indexing
ANNOLID_MEMORY_EMBEDDING_MODEL jina-embeddings-v3 Embedding model identifier
ANNOLID_MEMORY_VECTOR_DIM 1024 Embedding vector dimensionality
ANNOLID_MEMORY_VECTOR_WEIGHT 0.65 Hybrid search weight for vector similarity
ANNOLID_MEMORY_BM25_WEIGHT 0.35 Hybrid search weight for lexical BM25 matching
ANNOLID_MEMORY_RERANK_PROVIDER none Optional reranker backend
OLLAMA_HOST http://localhost:11434 Local or remote Ollama server URL
OPENAI_API_KEY / OPENAI_BASE_URL unset / https://api.openai.com/v1 OpenAI or OpenAI-compatible provider credentials
ANTHROPIC_API_KEY / ANTHROPIC_BASE_URL unset / https://api.anthropic.com Anthropic Claude credentials
GEMINI_API_KEY / GOOGLE_API_KEY unset Google Gemini credentials
OPENROUTER_API_KEY unset OpenRouter credentials

See Memory Subsystem for memory indexing and search details.

Auditing and Validating Configuration

Use the built-in CLI diagnostics to inspect local config health and permissions:

# Check active Python environment, CLI entry points, and optional tools
annolid-run runtime check

# Check LLM and agent config permissions and plaintext secret posture
annolid-run agent-security-check
annolid-run agent-security-audit
annolid-run agent-security-audit --fix

# Inspect or migrate plaintext secrets and legacy Google integrations
annolid-run agent-secrets-audit
annolid-run agent-secrets-migrate
annolid-run agent-config-migrate

Contributors working in a repository checkout can also run static checks across pyproject.toml, requirements.txt, Conda manifests, bundled annolid/configs/ templates, and Docker manifests:

python scripts/check_environment.py --mode repo