Configuration¶
LEGIONHERCULES can be customized through configuration files and environment variables.
Configuration File¶
Location¶
LEGIONHERCULES looks for configuration in:
- Current directory:
./.legionhercules/config.yaml - User home:
~/.legionhercules/config.yaml
Creating Configuration¶
This creates a default configuration file.
Viewing Configuration¶
Configuration Options¶
LLM Settings¶
llm:
provider: ollama
model: llama3.2
base_url: http://localhost:11434
temperature: 0.7
max_tokens: 4096
timeout: 120.0
| Option | Description | Default |
|---|---|---|
| provider | LLM provider (currently only ollama) | ollama |
| model | Model name | llama3.2 |
| base_url | Ollama server URL | http://localhost:11434 |
| temperature | Creativity (0.0-2.0) | 0.7 |
| max_tokens | Maximum tokens per response | 4096 |
| timeout | Request timeout in seconds | 120.0 |
Orchestrator Settings¶
| Option | Description | Default |
|---|---|---|
| max_concurrent_tasks | Maximum parallel tasks | 5 |
| task_timeout | Task timeout in seconds | 300.0 |
| retry_attempts | Number of retries on failure | 3 |
| enable_parallel | Enable parallel execution | true |
Logging Settings¶
| Option | Description | Default |
|---|---|---|
| level | Log level (DEBUG, INFO, WARNING, ERROR) | INFO |
| file | Log file path (null for none) | null |
| use_rich | Use Rich for console output | true |
Agent Definitions¶
agents:
- name: default
description: Default general-purpose agent
system_prompt: You are a helpful AI assistant.
tools:
- file_read
- file_write
- file_edit
- bash
- web_search
max_iterations: 10
timeout_seconds: 120.0
Environment Variables¶
Override configuration with environment variables:
export LEGIONHERCULES_LLM_MODEL=llama3.1:8b
export LEGIONHERCULES_LLM_TEMPERATURE=0.5
export LEGIONHERCULES_LLM_MAX_TOKENS=2048
export LEGIONHERCULES_ORCHESTRATOR_MAX_CONCURRENT_TASKS=10
export LEGIONHERCULES_LOGGING_LEVEL=DEBUG
Variable naming: LEGIONHERCULES_<section>_<option>
Example Configurations¶
Minimal Config¶
Development Config¶
llm:
model: codellama
temperature: 0.3
logging:
level: DEBUG
file: ~/.legionhercules/debug.log
orchestrator:
max_concurrent_tasks: 10
Production Config¶
llm:
model: llama3.1:8b
temperature: 0.5
max_tokens: 2048
logging:
level: WARNING
orchestrator:
max_concurrent_tasks: 3
retry_attempts: 5
Per-Project Configuration¶
Create a local config in your project:
mkdir -p .legionhercules
cat > .legionhercules/config.yaml << 'EOF'
llm:
model: codellama
agents:
- name: project_agent
description: Specialized for this project
system_prompt: |
You are working on a Python web application.
Follow the project's coding standards.
tools:
- file_read
- file_write
- bash
EOF
LEGIONHERCULES will use this config when run from the project directory.