Stay updated — Join the build list for tutorials and AI insights. No spam.

Configuration

Graphify configuration file options and environment variables.

Configuration

Graphify configuration file options, environment variables, and runtime settings.

📁 Config File Locations

LocationScopePriority
~/.config/graphify/config.yamlGlobal (all projects)Low
.graphify.yamlProject rootMedium
--config PATHCLI argumentHigh

📝 Config File Format (YAML)

 1# ~/.config/graphify/config.yaml
 2
 3# Model settings
 4model:
 5  path: ~/.cache/graphify/model.gguf # Local LLM model path
 6  n_ctx: 8192 # Context window
 7  n_gpu_layers: -1 # -1 = all on GPU; 0 = CPU only
 8  n_threads: 8 # CPU threads for inference
 9  verbose: false # Model debug output
10
11# Extraction settings
12extraction:
13  max_file_size_mb: 10 # Skip files larger than this
14  skip_binary: true # Auto-skip binary files
15  include_patterns: [] # Additional include globs
16  exclude_patterns: [] # Additional exclude globs
17  parallel_workers: 16 # AST extraction workers
18
19# LLM settings (for full graph)
20llm:
21  provider: gemini # gemini, openai, anthropic, moonshot, deepseek
22  api_key_env: GEMINI_API_KEY # Env var name for API key
23  model: gemini-1.5-flash # Model name
24  temperature: 0.1 # Generation temperature
25  max_tokens: 4096 # Max output tokens
26  timeout: 60 # Request timeout (seconds)
27
28# Activity tracking
29activity:
30  enabled: true # Enable activity signaling
31  path: ~/.graphify-stats # Activity data directory
32  auto_signal: true # Auto-touch .graphify-activity
33
34# Output settings
35output:
36  graph_path: graphify-out/graph.json # Graph file location
37  report_path: graphify-out/GRAPH_REPORT.md
38  html_path: graphify-out/graph.html
39  cluster_resolution: 1.0 # Community detection resolution
40  min_community_size: 3 # Min nodes per community
41
42# Logging
43logging:
44  level: INFO # DEBUG, INFO, WARN, ERROR
45  file: '' # Empty = stderr only
46  format: text # text, json

🌍 Environment Variables

VariableDescriptionDefault
GEMINI_API_KEYGoogle Gemini API key—
GOOGLE_API_KEYAlias for Gemini—
OPENAI_API_KEYOpenAI API key—
ANTHROPIC_API_KEYAnthropic API key—
MOONSHOT_API_KEYMoonshot/Kimi API key—
DEEPSEEK_API_KEYDeepSeek API key—
GRAPHIFY_CONFIGCustom config file path~/.config/graphify/config.yaml
GRAPHIFY_CACHE_DIRModel/cache directory~/.cache/graphify
GRAPHIFY_GRAPH_PATHGraph output pathgraphify-out/graph.json
GRAPHIFY_VERBOSEEnable verbose loggingfalse
GRAPHIFY_CODE_ONLYForce code-only modefalse

⚙️ CLI Overrides

All config options can be overridden via CLI flags:

 1# Model overrides
 2graphify . --model-path /custom/model.gguf
 3graphify . --n-ctx 16384
 4graphify . --n-gpu-layers 0
 5
 6# Extraction overrides
 7graphify . --max-file-size 5
 8graphify . --exclude "*.test.py"
 9graphify . --workers 8
10
11# LLM overrides
12graphify . --backend gemini --model gemini-1.5-pro
13graphify . --backend openai --model gpt-4o
14
15# Output overrides
16graphify . --graph-path custom-graph.json
17graphify . --report-path custom-report.md
18
19# Activity
20graphify . --no-activity-signal

🎯 Project-Specific Config

Create .graphify.yaml in project root:

 1# .graphify.yaml (project root)
 2
 3# Override global settings for this project
 4model:
 5  n_ctx: 16384 # Larger context for this codebase
 6
 7extraction:
 8  exclude_patterns:
 9    - '*.generated.py'
10    - 'migrations/'
11    - 'vendor/'
12
13llm:
14  provider: gemini
15  model: gemini-1.5-flash
16
17activity:
18  auto_signal: true

🔧 Common Customizations

Larger Context Window

1model:
2  n_ctx: 16384 # For large files / complex queries

CPU-Only Inference

1model:
2  n_gpu_layers: 0 # Force CPU (no GPU / VRAM issues)

Faster Builds (Less Accurate)

1extraction:
2  parallel_workers: 32
3  max_file_size_mb: 5

More Accurate Communities

1output:
2  cluster_resolution: 1.5
3  min_community_size: 5

Disable Activity Tracking

1activity:
2  enabled: false

🔍 Viewing Current Config

1# Show effective config (merged from all sources)
2graphify config show
3
4# Show specific section
5graphify config show model
6graphify config show llm

🔄 Config Precedence

  1. Defaults (built-in)
  2. Global config (~/.config/graphify/config.yaml)
  3. Project config (.graphify.yaml)
  4. Environment variables
  5. CLI flags (highest priority)

📋 Example: Full Project Config

 1# .graphify.yaml for hbstack/ghafoors-blog
 2
 3model:
 4  path: ~/.cache/graphify/model.gguf
 5  n_ctx: 16384
 6  n_gpu_layers: -1
 7  n_threads: 8
 8
 9extraction:
10  max_file_size_mb: 10
11  skip_binary: true
12  exclude_patterns:
13    - 'node_modules/'
14    - 'dist/'
15    - 'build/'
16    - '.attic/'
17    - 'util/temp-work/'
18    - '*.min.js'
19    - '*.map'
20  parallel_workers: 16
21
22llm:
23  provider: gemini
24  api_key_env: GEMINI_API_KEY
25  model: gemini-1.5-flash
26  temperature: 0.1
27  max_tokens: 4096
28
29activity:
30  enabled: true
31  auto_signal: true
32
33output:
34  graph_path: graphify-out/graph.json
35  cluster_resolution: 1.0
36  min_community_size: 3
37
38logging:
39  level: INFO
40  format: text

Next Steps