Installation¶
Requirements¶
- Python 3.11 or later
- pip
PyPI (recommended)¶
Verify:
From Source¶
.[dev] includes pytest, ruff, and mypy. For production use only:
Virtual Environment¶
Recommended for all installs:
python -m venv .venv
source .venv/bin/activate # macOS / Linux
.venv\Scripts\activate # Windows
pip install rm-contextos
Optional Feature Sets¶
Install optional extras with pip's bracket syntax:
pip install "rm-contextos[ast]" # tree-sitter symbol extraction (better ranking)
pip install "rm-contextos[tokens]" # tiktoken for accurate token counting
pip install "rm-contextos[headroom]" # Headroom compression support
pip install "rm-contextos[all]" # everything above
Optional Dependencies¶
tiktoken (accurate token counting)¶
Without tiktoken, ContextOS uses a regex approximation (~10–20% error for code).
With tiktoken, token counts use the cl100k_base BPE encoding.
No configuration needed — ContextOS detects and uses it automatically.
headroom-ai (local compression)¶
Required only if you use --compress headroom.
Then start the local proxy before running ContextOS:
See docs/HEADROOM.md for full setup instructions.
CI / Docker¶
Or pin a version:
Upgrading¶
Uninstall¶
ContextOS writes nothing outside .contextos/ directories in your project folders. No config files are created in your home directory.