Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

Vibe Analyzer uses a JSON5 configuration file. JSON5 is an extended version of JSON with support for comments, trailing commas, and other convenient features.

Location

The configuration file is located at:

~/.vibe-analyzer/config.json5

The file is created automatically with default settings the first time any CLI command is run.

Configuration Structure

The configuration consists of four sections: version, opensearch, mcp, ollama, and sources.

Full Example with Comments

{
  // Configuration version — do not modify manually
  "version": "0.0.1",

  // OpenSearch connection
  "opensearch": {
    // OpenSearch server URL
    "host": "http://192.168.1.10:9200"
  },

  // MCP server
  "mcp": {
    // Bind address:
    // 0.0.0.0 — accessible from all interfaces (for Docker, remote connections)
    // 127.0.0.1 — local only
    "host": "0.0.0.0",

    // Server port (default: 9020)
    "port": 9020,

    // MCP protocol version:
    // '2024-11-05' — stable
    // '2025-03-26' — improved streaming
    // '2025-06-18' — latest
    // 'latest' — auto-detect
    "protocol": "latest"
  },

  // Ollama LLM servers — specify multiple for load distribution
  "ollama": [
    {
      // Ollama API endpoint
      "host": "http://192.168.1.10:11434",

      // Model for enrichment
      "model": "qwen2.5-coder:3b-instruct",

      // Maximum characters per LLM request
      // Files are grouped into batches until the total size exceeds this limit
      "max_chunk_chars": 4000,

      // Maximum files per LLM request
      "max_chunk_files": 3,

      // Request timeout in seconds
      "timeout_secs": 60,

      // Generation temperature (0.0 — deterministic, 1.0 — creative)
      "temperature": 0.1,

      // Seed for reproducible results (same seed → same output)
      "seed": 42,

      // Model context window size
      "num_ctx": 4096,

      // Maximum tokens in response
      "num_predict": 2048,

      // Which AST elements to include in the prompt
      "ast_imports": false,
      "ast_variables": false,
      "ast_functions": true,
      "ast_enums": true,
      "ast_interfaces": true
    },
    {
      // Second host for load distribution
      "host": "http://localhost:11434",
      "model": "qwen2.5-coder:3b-instruct",
      "max_chunk_chars": 4000,
      "max_chunk_files": 3,
      "timeout_secs": 60,
      "temperature": 0.1,
      "seed": 42,
      "num_ctx": 4096,
      "num_predict": 2048,
      "ast_imports": false,
      "ast_variables": false,
      "ast_functions": true,
      "ast_enums": true,
      "ast_interfaces": true
    }
  ],

  // Knowledge sources for indexing — absolute project paths
  "sources": ["/Users/keygenqt/Documents/Gitcode/Projects/vibe-analyzer"]
}

Sections in Detail

version

"version": "0.0.1"

Configuration file version. Do not modify manually — updated automatically during config migration between versions.

opensearch

"opensearch": {
  "host": "http://192.168.1.10:9200"
}
ParameterTypeDefaultDescription
hoststringhttp://localhost:9200OpenSearch server URL. Can point to a local or remote server

mcp

"mcp": {
  "host": "0.0.0.0",
  "port": 9020,
  "protocol": "latest"
}
ParameterTypeDefaultDescription
hoststring127.0.0.1Server bind address. 0.0.0.0 — accessible externally (Docker, remote clients), 127.0.0.1 — local only
portinteger9020MCP server port
protocolstringlatestMCP protocol version: 2024-11-05, 2025-03-26, 2025-06-18, or latest

ollama

The ollama section is an array of Ollama server configurations. One or more hosts can be specified for load distribution.

"ollama": [
  {
    "host": "http://192.168.1.10:11434",
    "model": "qwen2.5-coder:3b-instruct",
    "max_chunk_chars": 4000,
    "max_chunk_files": 3,
    "timeout_secs": 60,
    "temperature": 0.1,
    "seed": 42,
    "num_ctx": 4096,
    "num_predict": 2048,
    "ast_imports": false,
    "ast_variables": false,
    "ast_functions": true,
    "ast_enums": true,
    "ast_interfaces": true
  }
]

Main Parameters

ParameterTypeDefaultDescription
hoststringhttp://localhost:11434Ollama API endpoint
modelstringqwen2.5-coder:3b-instructModel name for enrichment. Must be pre-loaded via ollama pull

Batch Processing Parameters

ParameterTypeDefaultDescription
max_chunk_charsinteger4000Maximum characters per LLM request. Files are grouped into batches until the total size exceeds the limit
max_chunk_filesinteger3Maximum files per request. Even if the character limit is not reached, no more than this number of files will be in a batch

Generation Parameters

ParameterTypeDefaultDescription
timeout_secsinteger60Ollama request timeout in seconds
temperaturefloat0.1Generation temperature. 0.0 — maximally deterministic, 1.0 — maximally creative. Low values are recommended for code enrichment
seedinteger42Random generator seed. Same seed guarantees reproducible results
num_ctxinteger4096Model context window size in tokens
num_predictinteger2048Maximum tokens in response

AST Element Filters

Determines which AST elements are included in the LLM prompt. Disabling unnecessary elements reduces request size and speeds up processing.

ParameterTypeDefaultDescription
ast_importsbooleanfalseInclude imports in the prompt
ast_variablesbooleanfalseInclude variables in the prompt
ast_functionsbooleantrueInclude functions in the prompt
ast_enumsbooleantrueInclude enums in the prompt
ast_interfacesbooleantrueInclude interfaces in the prompt

sources

"sources": [
  "/Users/keygenqt/Documents/Gitcode/Projects/vibe-analyzer",
  "/home/user/projects/my-backend",
  "/home/user/docs/architecture"
]
ParameterTypeDefaultDescription
sourcesarray of strings[]List of absolute paths to knowledge sources. Each source can be a code project, a documentation folder, or both

Managing sources is easier via CLI rather than editing the config manually:

# Add a source
vibe-analyzer source add /path/to/project

# Remove a source
vibe-analyzer source remove --target /path/to/project

# List all sources
vibe-analyzer source list

Ollama Clustering

When multiple hosts are specified in the ollama section, Vibe Analyzer distributes files via competing consumers:

  • All workers read from a single shared channel
  • The fastest worker takes the next file
  • This maximizes utilization of all hosts
  • If any host fails, all workers stop
  • At the end, per-host statistics are reported

This approach allows:

  • Faster enrichment through parallel processing on multiple GPUs/servers
  • Scaling by adding more hosts to the configuration

Configuration Validation

Vibe Analyzer validates the configuration at startup and applies safe defaults if parameters are missing or invalid:

  • max_chunk_chars → minimum 1000, maximum 100000
  • limit in search queries → always in the 1–10 range
  • Invalid paths → normalized to absolute form
  • Missing sections → created with default values

Configuration Migration

When updating Vibe Analyzer, the configuration may automatically migrate to a new format. The configuration version (version) tracks the current format and applies migrations when necessary.

Overriding the Configuration Directory

For testing or custom scenarios, the configuration directory can be overridden:

# Set a custom directory
vibe-analyzer --config-dir /custom/path source list

The default is ~/.vibe-analyzer/.

Dev Section

An optional section for debugging. Usually absent in production config — added only when needed:

{
  "dev": {
    "log_level": "trace",
    "spdx_data_path": "tests/mcp/fixtures/config/spdx"
  }
}
ParameterTypeDefaultDescription
log_levelstringdefaultLog level: default, trace, debug, info, warn, error. default means info
spdx_data_pathstring~/.vibe-analyzer/spdxPath to SPDX data for license detection. Downloaded automatically on first run