Configuration
Configuration Guide
Section titled “Configuration Guide”The Cylestio Perimeter uses YAML configuration files to define server settings, LLM providers, and interceptors.
Configuration File Structure
Section titled “Configuration File Structure”server: # Server configurationllm: # LLM provider settingsinterceptors: # Middleware interceptors (optional)logging: # Logging configurationServer Configuration
Section titled “Server Configuration”Configure the HTTP server settings:
server: port: 3000 # Port to run the server on (default: 3000) host: "0.0.0.0" # Host to bind to (default: "0.0.0.0") workers: 1 # Number of worker processes (default: 1)Server Options
Section titled “Server Options”| Option | Type | Default | Description |
|---|---|---|---|
port | integer | 3000 | Port number for the HTTP server |
host | string | "0.0.0.0" | IP address to bind to ("0.0.0.0" for all interfaces) |
workers | integer | 1 | Number of worker processes (for production use) |
LLM Provider Configuration
Section titled “LLM Provider Configuration”Configure the target LLM provider:
llm: base_url: "https://api.anthropic.com" # Base URL for the LLM provider type: "anthropic" # Provider type: "anthropic" (OpenAI coming soon) timeout: 30 # Request timeout in seconds max_retries: 3 # Maximum number of retries api_key: "${API_KEY}" # Optional: API key (supports env variables)LLM Options
Section titled “LLM Options”| Option | Type | Required | Description |
|---|---|---|---|
base_url | string | Yes | Base URL for the LLM API |
type | string | Yes | Provider type: "anthropic" (OpenAI coming soon) |
timeout | integer | No | Request timeout in seconds (default: 30) |
max_retries | integer | No | Maximum retry attempts (default: 3) |
api_key | string | No | API key (can use environment variables) |
Provider Types
Section titled “Provider Types”Note: OpenAI configuration is coming soon.
Anthropic Configuration
Section titled “Anthropic Configuration”llm: base_url: "https://api.anthropic.com" type: "anthropic" timeout: 30 max_retries: 3Interceptors Configuration
Section titled “Interceptors Configuration”Configure middleware interceptors for monitoring and processing:
interceptors: - type: "interceptor_name" # Type of interceptor enabled: true # Enable/disable this interceptor config: # Interceptor-specific configuration option1: value1 option2: value2Available Interceptors
Section titled “Available Interceptors”printer- Console logging and monitoringevent_recorder- Save events to diskcylestio_trace- Send events to Cylestio API
See the Interceptors Guide for detailed configuration options.
Logging Configuration
Section titled “Logging Configuration”Configure application logging:
logging: level: "INFO" # Log level: DEBUG, INFO, WARNING, ERROR format: "text" # Log format: "text" or "json"Logging Options
Section titled “Logging Options”| Option | Type | Default | Description |
|---|---|---|---|
level | string | "INFO" | Minimum log level to display |
format | string | "text" | Log output format |
Log Levels
Section titled “Log Levels”DEBUG- Detailed diagnostic informationINFO- General operational messagesWARNING- Warning messages for potential issuesERROR- Error messages for serious problems
Log Formats
Section titled “Log Formats”text- Human-readable text format (good for development)json- Structured JSON format (good for production/log aggregation)
Environment Variables
Section titled “Environment Variables”The configuration supports environment variable substitution using ${VARIABLE_NAME} syntax:
llm: api_key: "${ANTHROPIC_API_KEY}"
interceptors: - type: "cylestio_trace" config: access_key: "${CYLESTIO_ACCESS_KEY}"Common Environment Variables
Section titled “Common Environment Variables”| Variable | Purpose | Example |
|---|---|---|
ANTHROPIC_API_KEY | Anthropic API authentication | sk-... |
CYLESTIO_ACCESS_KEY | Cylestio trace interceptor | sk-cylestio-... |
Complete Configuration Example
Section titled “Complete Configuration Example”# Complete configuration with all sectionsserver: port: 3000 host: "0.0.0.0" workers: 1
llm: base_url: "https://api.anthropic.com" type: "anthropic" timeout: 30 max_retries: 3 api_key: "${ANTHROPIC_API_KEY}"
interceptors: - type: "printer" enabled: true config: log_requests: true log_responses: true log_body: false
- type: "event_recorder" enabled: true config: output_dir: "./event_logs" file_format: "jsonl"
logging: level: "INFO" format: "text"Validation
Section titled “Validation”Cylestio Perimeter validates configuration on startup and will report errors for:
- Missing required fields
- Invalid provider types
- Invalid log levels or formats
- Inaccessible output directories
- Missing environment variables