Cortex · Configuration & integration

Configure models and routes

Choose the models a seat may use before sending work. Cortex has no built-in fleet model names. It reads a named $CORTEX_MODEL_CATALOG TOML/JSON file or ./.cortex/models.toml, adds one-time Thalamus discovery at startup, and otherwise leaves an empty/unrouted catalog. File entries win for the same ID. An unreadable or invalid named file is an error; unknown keys are rejected with their table/key names.

Replace these placeholder names with models available through your route:

[[system2]]
provider = "fleet"
id = "reasoning-model"
context_window = 100000
max_tokens = 4096
[[system1]]
backend = "judge-model"
[defaults]
system2 = "fleet/reasoning-model"
system1 = "judge-model"
[ote]
embedding_model = "embedding-model"
reranker_model = "rerank-model"

System 2 runs the agent's model turns; System 1 answers bounded classification questions. The catalog names models, not endpoints: supply THALAMUS_URL for relay routing. The parser supports tables, array-of-tables and single-line scalar arrays, not every TOML construct. JSON uses the same schema keys.

Catalog area Fields and purpose
system2[] provider, required id, optional name, context_window, max_tokens, reasoning, thinking_format, reasoning_content_field, base_url, api_key_env. Camel-case aliases exist for the corresponding model-descriptor fields.
system1[] Required backend; optional model_id, context_window, timeout_sec, url, api_key_env (with corresponding camel-case aliases for model/context/timeout/key fields). No URL means routed backend when Thalamus is configured.
defaults system2 = "provider/id", system1 = "backend". Credentials alone do not choose a model. PI_DURABLE_SYSTEM2_MODEL can name the System 2 default explicitly.
ote embedding_model, embedding_dims, reranker_model, reranker_prompt_template, domain, archetype, seat_id, entity_patterns, gate_commands, mounts[] (ring, ring_id, access, budget_share_pct).
workflow_policy_aliases Consumer names mapped to built-ins none, orchestrator, implementer; unknown policies are errors.
codemode provider, id, api for the classifier descriptor offered to scripts.
voice executive, subordinates, elevenlabs_voice_id; ElevenLabs also accepts ELEVENLABS_VOICE_ID.

Discovery reads ${THALAMUS_URL}/admin/v1/status once. Healthy intelligence members supply System 2 models; verification members supply System 1 backends; knowledge IDs containing embed/rerank supply OTE model hints. The hint heuristic belongs to Cortex discovery, not Thalamus plane classification. Review the catalog and restart when membership changes rather than expecting continuous rediscovery.

THALAMUS_URL routes System 2 through /v1, System 1 through /v1/systemone, and knowledge through /v1/embeddings and /v1/rerank. Read the Thalamus reference before operating the relay.

Without Thalamus, deliberately configured direct fallbacks are CORTEX_FALLBACK_SYSTEM2_URL, CORTEX_FALLBACK_EMBEDDINGS_URL, CORTEX_FALLBACK_RERANK_URL, and CORTEX_FALLBACK_SYSTEM1_URL_<BACKEND>. Direct fallback is announced. With neither relay nor fallback, the route is unrouted and no request is made; provider keys are not a hidden fleet fallback.

Explicit overrides are PI_DURABLE_SYSTEM1_URL_<BACKEND> (uppercase backend, hyphens converted to underscores), global PI_DURABLE_SYSTEM1_URL, and PI_DURABLE_SYSTEM2_URL. Catalog/per-call URLs outside the Thalamus base are announced and counted as direct-explicit calls. Inspect route classification: a successful call alone does not tell you whether it used the relay.

Use cortex config for conversation-local model, thinking and voice changes. Its table lists accepted values; disabled is a System 1 backend, not a mode. Workflow policy remains seat-level.