Skip to content

Configuration

NEXUS follows the XDG Base Directory Specification. The default data directory is:

~/.local/share/nexus/

Override it at any time:

Terminal window
export NEXUS_DATA_DIR=/mnt/fast-ssd/nexus
onexus run

The directory is created on first run if it does not exist. All databases live here.

VariableDefaultDescription
NEXUS_DATA_DIR~/.local/share/nexus/Root directory for all runtime data
NEXUS_LLM_PORT8384Port of the local LLM HTTP server
NEXUS_DEFAULT_PROVIDERlocalDefault inference provider (local, openai, anthropic)
NEXUS_OPENAI_KEY:OpenAI API key (enables OpenAI provider)
NEXUS_ANTHROPIC_KEY:Anthropic API key (enables Anthropic provider)
NEXUS_OPENAI_MODELgpt-4o-miniOpenAI model name
NEXUS_ANTHROPIC_MODELclaude-sonnet-4-20250514Anthropic model name
NEXUS_LOG_LEVELINFOLog verbosity: DEBUG, INFO, WARNING, ERROR
NEXUS_AGENTS_CATALOG:Path to an ONEXUS-Agents catalog clone

Variables can be set in your shell profile or in a .env file in the working directory.

NEXUS is model-agnostic. The kernel runs without any model connected, connect a provider at startup via env vars or at runtime via the API.

Terminal window
# OpenAI
export NEXUS_OPENAI_KEY=sk-...
export NEXUS_DEFAULT_PROVIDER=openai
onexus run
# Anthropic
export NEXUS_ANTHROPIC_KEY=sk-ant-...
export NEXUS_DEFAULT_PROVIDER=anthropic
onexus run

Run any model locally via llama.cpp, Ollama, or vLLM. NEXUS connects to localhost:8384 by default.

Compatible open-source models (all MIT or Apache 2.0):

ModelNotes
Qwen 3 8BGood balance of speed and quality
Qwen 3 32BComplex reasoning, long-context tasks
DeepSeek-R1 7BCode generation, technical analysis
Phi-4 MiniFast responses, lightweight
Llama 3.1 8BGeneral purpose, well-rounded
Gemma 2 9BStrong multilingual support
Terminal window
# llama.cpp
llama-server --model qwen3-8b-q4.gguf --port 8384 --ctx-size 8192
# Ollama
ollama serve # then: ollama run qwen3:8b

Providers can be added, removed, and switched while the kernel is running:

Terminal window
# List providers
curl http://localhost:8000/api/providers
# Register OpenAI
curl -X POST http://localhost:8000/api/providers \
-H "Content-Type: application/json" \
-d '{"provider": "openai", "api_key": "sk-...", "model": "gpt-4o", "set_default": true}'
# Register Anthropic
curl -X POST http://localhost:8000/api/providers \
-H "Content-Type: application/json" \
-d '{"provider": "anthropic", "api_key": "sk-ant-...", "set_default": true}'
# Register a local model server
curl -X POST http://localhost:8000/api/providers \
-H "Content-Type: application/json" \
-d '{"provider": "local", "base_url": "http://localhost:11434", "set_default": true}'
# Switch default
curl -X POST http://localhost:8000/api/providers/default/anthropic
# Remove a provider
curl -X DELETE http://localhost:8000/api/providers/openai

The provider router automatically falls back to the default if a specific provider is unhealthy.

All state is durable across sessions. There is no configuration file for runtime state, everything is stored in SQLite databases inside NEXUS_DATA_DIR:

DatabaseContents
nexus.dbMemory (working, episodic, semantic), audit log (WAL), trust scores and outcome history

To start completely fresh, run onexus forget --yes (clears Engram only) or delete the data directory entirely.