Skip to content

Configuration Guide

DevDiff supports flexible configuration using a .devdiff.config.js file (recommended), .devdiff.config.json, or other .devdiffrc configurations in the root directory of your repository.


Configuration Schema

Here is a full schema reference detailing all available options in .devdiff.config.js format:

javascript
// .devdiff.config.js
export default {
  ai: {
    providers: [
      {
        name: "ollama-local",
        url: "ollama://llama3.2:3b",
        priority: 1,
      },
      {
        name: "openai-cloud",
        url: "openai://gpt-4o-mini",
        apiKey: process.env.OPENAI_API_KEY,
        priority: 2,
      },
    ],
    routing: {
      strategy: "priority",
      complexityThreshold: 0.6,
      localOnly: false,
    },
  },
  exclude: [
    "**/node_modules/**",
    "pnpm-lock.yaml",
    "package-lock.json",
    "dist/**",
    "*.log",
  ],
  cache: {
    enabled: true,
    path: ".devdiff/cache.json",
  },
  format: "markdown",
};

Configuration Options

OptionTypeDefaultDescription
ai.providersArrayRequiredA list of model provider endpoints and credentials. Supports local (ollama://) and cloud (openai://, gemini://, anthropic://).
ai.routing.strategystring"priority"Strategy used by the Intelligent Router. Options: 'priority', 'cost', 'latency'.
ai.routing.complexityThresholdnumber0.6Complexity value above which changes trigger escalation to higher capacity models.
ai.routing.localOnlybooleantrueWhen true, prevents the router from selecting any external cloud providers regardless of complexity.
excludeArray<string>[]Glob patterns matching directories, lockfiles, or assets to ignore during git diff scans.
cache.enabledbooleantrueWhen true, caches generated changelog outputs locally to prevent redundant LLM token costs.
cache.pathstring".devdiff/cache.json"Path where the local cache file is stored.
formatstring"markdown"Default output format for changelogs. Options: 'markdown', 'json', 'html'.

Multiple Provider Failover (High Availability)

The DevDiff router supports failover chains. If a local model fails to respond or a cloud provider hits rate limits, the router automatically attempts the fallback chain:

json
"providers": [
  {
    "name": "ollama-primary",
    "url": "ollama://llama3.2:3b",
    "priority": 1
  },
  {
    "name": "openai-fallback",
    "url": "openai://gpt-4o-mini",
    "priority": 2
  }
]

Under this configuration:

  1. DevDiff initially routes requests to ollama-primary.
  2. If the local Ollama service is offline or errors out, DevDiff immediately falls back to openai-fallback to complete the request seamlessly.

Released under the MIT License. | Support