Skip to content

Configuration

Tandem Engine uses a layered configuration system that prioritizes settings from different sources. This allows for global defaults, per-project overrides, and environment-based secrets.

Configuration Layers

Settings are resolved in the following order (highest priority first):

  1. Environment Variables: Secrets and explicit overrides.
  2. Managed Config: managed_config.json (for automated/managed environments).
  3. Project Config: .tandem/config.json in your workspace.
  4. Global Config: ~/.config/tandem/config.json (Linux/Mac) or %APPDATA%\tandem\config.json (Windows).

Environment Variables

Provider Keys

Tandem automatically maps standard API key variables to their respective providers:

  • OPENAI_API_KEYopenai
  • ANTHROPIC_API_KEYanthropic
  • OPENROUTER_API_KEYopenrouter
  • GROQ_API_KEYgroq
  • MISTRAL_API_KEYmistral
  • TOGETHER_API_KEYtogether
  • COHERE_API_KEYcohere
  • GITHUB_TOKENcopilot
  • AZURE_OPENAI_API_KEYazure
  • VERTEX_API_KEYvertex
  • BEDROCK_API_KEYbedrock

Ollama

  • OLLAMA_URL: Overrides the default Ollama URL (default: http://127.0.0.1:11434/v1).

System paths

  • TANDEM_GLOBAL_CONFIG: Override the path to the global configuration file.
  • TANDEM_STATE_DIR: Override the directory where the engine stores its state (logs, database, etc.).

Config File Format

The configuration file is a simple JSON object.

{
"default_provider": "anthropic",
"providers": {
"anthropic": {
"default_model": "claude-3-5-sonnet-latest"
},
"openai": {
"default_model": "gpt-4o"
},
"ollama": {
"url": "http://localhost:11434/v1",
"default_model": "llama3"
}
}
}

Setup Wizard

When you first run the Tandem TUI, if no providers are configured, it will launch a Setup Wizard to help you configure your default_provider and model. This configuration is saved to your global config file.