Skip to content

Configuration

XYBEROS uses a layered configuration system: defaults → YAML file → environment variables → constructor arguments.

Resolution Order

1. Hard-coded defaults in XyberosConfig dataclass
2. config.xyberos.yaml (auto-discovered in CWD or ~/.xyberos/)
3. XYBEROS_* environment variables
4. Constructor arguments to XyberosConfig(...)

YAML Config File

# config.xyberos.yaml — auto-detected in current directory or ~/.xyberos/
llm:
  backend: openai           # openai | anthropic | ollama | openai_compatible | simulated
  model: gpt-4o-mini        # model name for the selected backend
  api_key: ""                # overrides OPENAI_API_KEY / LLM_API_KEY
  base_url: ""               # overrides OPENAI_BASE_URL / LLM_BASE_URL
memory:
  default_ttl: 3600          # seconds
skills:
  enabled: true

Environment Variables

Variable Default Description
XYBEROS_LLM_BACKEND openai LLM backend to use
XYBEROS_LLM_MODEL gpt-4o-mini Model name
XYBEROS_LLM_API_KEY API key
XYBEROS_LLM_BASE_URL Base URL for API
XYBEROS_MEMORY_TTL 3600 Default memory TTL
XYBEROS_SKILLS_ENABLED true Enable built-in skills
XYBEROS_WEB_SEARCH_URL Web search endpoint
XYBEROS_KNOWLEDGE_ROOT cwd Knowledge filesystem root
XYBEROS_MAX_INPUT 1000000 Max input characters
XYBEROS_SAFETY_CONFIG Safety rules YAML path

Programmatic Configuration

from xyberos import xyberos, XYBEROS, XyberosConfig

# Constructor arguments (highest priority)
config = XyberosConfig(
    llm_backend="ollama",
    llm_model="llama3",
    memory_default_ttl=7200,
)

# Auto-load from YAML + env vars
config = XyberosConfig.load()

# With overrides on top of YAML + env
config = XyberosConfig.load(overrides={"llm_backend": "anthropic"})

# Pass to XYBEROS
xyberos = XYBEROS(config=config)

Docker Environment

In docker-compose.yml, environment variables are set by default:

environment:
  - XYBEROS_LLM_BACKEND=ollama
  - XYBEROS_LLM_MODEL=llama3.2
  - OLLAMA_HOST=http://ollama:11434