Skip to main content

Configuration

Configuration Mechanism

Evatar uses pydantic-settings for configuration management. All environment variables use the EVATAR_ prefix. Configuration priority:

  1. Environment variables EVATAR_*
  2. .env file
  3. Code defaults

Environment Variables Reference

Server

VariableDefaultDescription
EVATAR_HOST0.0.0.0Listen address
EVATAR_PORT8421Listen port
EVATAR_DEV_MODEfalseDevelopment mode (skip auth, allow HTTP)
EVATAR_CORS_ORIGINS""CORS allowed origins (comma-separated)

Authentication

VariableDefaultDescription
EVATAR_API_KEY""API authentication key

Storage

VariableDefaultDescription
EVATAR_DATA_DIR./dataData directory
EVATAR_PHOTOS_DIR./data/photosPhoto storage directory
EVATAR_DB_PATH./data/evatar.dbSQLite database path
EVATAR_MAX_UPLOAD_BYTES52428800 (50MB)Single file upload size limit

LLM

VariableDefaultDescription
EVATAR_LLM_BASE_URL""LLM API address
EVATAR_LLM_API_KEY""LLM API Key (required for AI features)
EVATAR_LLM_MODELmimo-v2.5Model name
EVATAR_LLM_MAX_TOKENS4096Max generation tokens
EVATAR_LLM_TEMPERATURE0.1Generation temperature

Agent

VariableDefaultDescription
EVATAR_AGENT_MAX_ROUNDS3Agent max tool call rounds
EVATAR_AGENT_HISTORY_LIMIT20Loaded history message count
VariableDefaultDescription
EVATAR_TAVILY_API_KEY""Tavily search API Key (preferred)
EVATAR_BRAVE_API_KEY""Brave Search API Key (fallback)

Encryption

VariableDefaultDescription
EVATAR_ENCRYPTION_KEY""Fernet encryption key. Auto-generated and stored in data/.encryption_key when empty

Data Retention

VariableDefaultDescription
EVATAR_RETENTION_DAYS30Data retention days, expired data auto-cleaned

Push Notifications

VariableDefaultDescription
EVATAR_FCM_PROJECT_ID""Firebase project ID
EVATAR_FCM_CREDENTIALS_JSON""FCM service account JSON
EVATAR_PUSH_WEBHOOK_URL""Push Webhook URL (fallback when FCM not configured)

LLM Presets

System includes 7 built-in LLM provider presets, one-click switching:

PresetProviderModelContext Window
mimoXiaomi MiMomimo-v2.51M tokens
qwenTongyi Qianwenqwen-vl-max128K tokens
openaiOpenAIgpt-4o128K tokens
claudeAnthropicclaude-sonnet-4-20250514200K tokens
glmZhipu GLMglm-4v128K tokens
kimiMoonshotmoonshot-v1-128k-vision-preview128K tokens
deepseekDeepSeekdeepseek-chat64K tokens

Minimum Startup Configuration

# Simplest startup (development mode)
EVATAR_DEV_MODE=true python main.py

# Production mode minimum
EVATAR_API_KEY=your-secret-key \
EVATAR_LLM_API_KEY=your-llm-key \
python main.py

# Full configuration
EVATAR_API_KEY=your-secret-key \
EVATAR_LLM_API_KEY=your-llm-key \
EVATAR_LLM_BASE_URL=https://api.openai.com/v1 \
EVATAR_LLM_MODEL=gpt-4o \
EVATAR_TAVILY_API_KEY=tvly-xxx \
EVATAR_ENCRYPTION_KEY=$(python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())") \
EVATAR_RETENTION_DAYS=60 \
python main.py