Skip to content

Configuration

CortexPrism edited this page Jun 17, 2026 · 1 revision

Configuration

CortexPrism stores its configuration in ~/.cortex/config.json (created by cortex setup).

Config File Reference

{
  "version": 1,
  "defaultProvider": "anthropic",
  "providers": {
    "anthropic": { "kind": "anthropic", "model": "claude-sonnet-4-5", "apiKey": "sk-..." },
    "openai": { "kind": "openai", "model": "gpt-4o", "apiKey": "sk-..." },
    "google": { "kind": "google", "model": "gemini-2.0-flash", "apiKey": "..." },
    "ollama": { "kind": "ollama", "model": "llama3.2", "baseUrl": "http://localhost:11434" }
  },
  "agent": {
    "name": "Cortex",
    "maxTurns": 8,
    "streamOutput": true
  },
  "router": {
    "enabled": false,
    "strategy": "cascade",
    "confidenceThreshold": 0.7,
    "cascade": [
      { "provider": "ollama", "model": "llama3.2:3b" },
      { "provider": "anthropic", "model": "claude-haiku-4-5" }
    ]
  },
  "modelSelection": {
    "enabled": true,
    "mode": "balanced",
    "observeThreshold": 50,
    "enforceConfidence": 0.85,
    "suggestConfidence": 0.65
  },
  "update": {
    "channel": "stable",
    "checkOnStartup": true,
    "autoUpdate": false,
    "checkIntervalHours": 24
  },
  "pluginUpdate": {
    "checkOnStartup": true,
    "autoUpdate": false,
    "checkIntervalHours": 24
  },
  "voice": {
    "enabled": false,
    "provider": "openai",
    "defaultVoice": "alloy",
    "autoTTS": false
  },
  "logging": {
    "level": "info",
    "fileEnabled": true,
    "fileMaxBytes": 10485760,
    "fileMaxFiles": 5
  },
  "webAuth": {
    "requireAuth": false
  }
}

Provider Configurations

Anthropic

{ "kind": "anthropic", "model": "claude-sonnet-4-5", "apiKey": "sk-ant-...", "reasoningEffort": "medium" }

OpenAI

{ "kind": "openai", "model": "gpt-4o", "apiKey": "sk-...", "baseUrl": "https://api.openai.com/v1" }

Google Gemini

{ "kind": "google", "model": "gemini-2.0-flash", "apiKey": "..." }

Ollama (Local)

{ "kind": "ollama", "model": "llama3.2", "baseUrl": "http://localhost:11434" }

AWS Bedrock

{ "kind": "bedrock", "model": "us.amazon.nova-pro-v1:0", "region": "us-east-1" }

OpenRouter

{ "kind": "openrouter", "model": "openai/gpt-4o", "apiKey": "...", "httpReferer": "https://myapp.com" }

Perplexity

{ "kind": "perplexity", "model": "sonar-pro", "apiKey": "...", "searchRecencyFilter": "week" }

Ollama / LM Studio

{ "kind": "ollama", "model": "llama3.2", "numCtx": 8192, "keepAlive": "5m" }

Environment Variables

Variable Purpose
CORTEX_DATA_DIR Override data directory (default: ~/.cortex/data/)
CORTEX_CONFIG_DIR Override config directory (default: ~/.cortex/)
CORTEX_VAULT_KEY Vault decryption passphrase
CORTEX_LOG_LEVEL Override log level (trace, debug, info, warn, error, silent)
GITHUB_TOKEN GitHub personal access token
GH_TOKEN Alternative GitHub token
OPENAI_API_KEY OpenAI API key (alternative to config)

Model Router Config

The router supports two strategies:

Cascade Router

Tries cheapest provider first, escalates on low confidence.

{
  "router": {
    "enabled": true,
    "strategy": "cascade",
    "confidenceThreshold": 0.7,
    "cascade": [
      { "provider": "ollama", "model": "llama3.2:3b" },
      { "provider": "anthropic", "model": "claude-sonnet-4-5" }
    ]
  }
}

Threshold Router

Routes based on prompt complexity scoring.

{
  "router": {
    "enabled": true,
    "strategy": "threshold",
    "confidenceThreshold": 0.5,
    "threshold": {
      "strongProvider": "anthropic",
      "strongModel": "claude-sonnet-4-5",
      "weakProvider": "ollama",
      "weakModel": "llama3.2:3b",
      "scorer": "heuristic"
    }
  }
}

Logging Config

{
  "logging": {
    "level": "info",
    "fileEnabled": true,
    "filePath": "~/.cortex/data/logs/cortex.log",
    "fileMaxBytes": 10485760,
    "fileMaxFiles": 5,
    "otlp": {
      "endpoint": "http://localhost:4318"
    },
    "langfuse": {
      "publicKey": "pk-lf-...",
      "secretKey": "sk-lf-..."
    }
  }
}

See Also

Clone this wiki locally