Skip to content

Configuration

The Cylestio Perimeter uses YAML configuration files to define server settings, LLM providers, and interceptors.

server: # Server configuration
llm: # LLM provider settings
interceptors: # Middleware interceptors (optional)
logging: # Logging 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)
OptionTypeDefaultDescription
portinteger3000Port number for the HTTP server
hoststring"0.0.0.0"IP address to bind to ("0.0.0.0" for all interfaces)
workersinteger1Number of worker processes (for production use)

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)
OptionTypeRequiredDescription
base_urlstringYesBase URL for the LLM API
typestringYesProvider type: "anthropic" (OpenAI coming soon)
timeoutintegerNoRequest timeout in seconds (default: 30)
max_retriesintegerNoMaximum retry attempts (default: 3)
api_keystringNoAPI key (can use environment variables)

Note: OpenAI configuration is coming soon.

llm:
base_url: "https://api.anthropic.com"
type: "anthropic"
timeout: 30
max_retries: 3

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: value2
  • printer - Console logging and monitoring
  • event_recorder - Save events to disk
  • cylestio_trace - Send events to Cylestio API

See the Interceptors Guide for detailed configuration options.

Configure application logging:

logging:
level: "INFO" # Log level: DEBUG, INFO, WARNING, ERROR
format: "text" # Log format: "text" or "json"
OptionTypeDefaultDescription
levelstring"INFO"Minimum log level to display
formatstring"text"Log output format
  • DEBUG - Detailed diagnostic information
  • INFO - General operational messages
  • WARNING - Warning messages for potential issues
  • ERROR - Error messages for serious problems
  • text - Human-readable text format (good for development)
  • json - Structured JSON format (good for production/log aggregation)

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}"
VariablePurposeExample
ANTHROPIC_API_KEYAnthropic API authenticationsk-...
CYLESTIO_ACCESS_KEYCylestio trace interceptorsk-cylestio-...
# Complete configuration with all sections
server:
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"

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