Skip to main content
BRAIN.md is a routing configuration file you commit to your repo root. Every PRYSM client that runs in that repo — whether in a CI pipeline, a local dev session, or a production deploy — auto-discovers it and applies its rules to every LLM call. Think of it as a pyproject.toml for your AI spend.

A complete BRAIN.md

How PRYSM applies the rules

When you call client.complete() or client.chat.completions.create(), PRYSM:
  1. Loads BRAIN.md from the nearest ancestor directory (or from env PRYSM_BRAIN_PATH).
  2. Classifies the prompt’s intent against the ten signal dimensions.
  3. Walks the rules list in order and applies the first match.
  4. Checks max_cost_per_request — if the chosen model’s estimated cost exceeds the ceiling, downgrades to the next eligible model.
  5. Removes any blocked models from the candidate set.

Validating your BRAIN.md before committing

Or via the CLI:

Sharing BRAIN.md with your team

Anyone — including other AI agents reading your README — can fetch the config:

CI integration: cost-gate your PRs

The BRAIN.md ecosystem

BRAIN.md is an open specification. Any PRYSM-compatible routing engine can consume it. The spec lives at prysm1.com/brain-md, and the community shares configs at prysm1.com/b via prysm brain share.