We welcome contributions that advance the geometric analysis of language models.
# Clone and setup
git clone https://github.com/Ethyros-AI/ModelCypher.git
cd ModelCypher
poetry install --all-extras
# Run tests
poetry run pytest tests/
# Run a quick validation
poetry run mc --help- Architecture: Follow the hexagonal architecture in
docs/ARCHITECTURE.md. Domain logic (core/domain) must remain framework-agnostic where possible. - Testing: New features require unit tests. We maintain >90% test coverage.
- Typing: Strict
mypycompliance is required. - Math: All geometric operations must be cited in docstrings (e.g., "Implements CKA as per Kornblith et al., 2019").
- Research loops: Repeated experiment iteration must follow
docs/research/AUTONOMOUS-RESEARCH-PROTOCOL.md: baseline first, frozen evaluator, one mutable surface per run family, append-only ledger.
We follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change that neither fixes a bug nor adds a feature |
test |
Adding or updating tests |
chore |
Maintenance tasks |
perf |
Performance improvement |
Common scopes: geometry, merge, training, safety, cli, thermo, entropy
feat(geometry): add Gromov-Wasserstein distance computation
fix(merge): correct null-space projection normalization
docs(readme): update installation instructions for accelerator backend
refactor(training): extract checkpoint logic into separate module
test(safety): add property tests for behavioral probes
-
Fork and branch: Create a feature branch from
maingit checkout -b feat/your-feature-name
-
Make changes: Follow the code style and testing requirements
-
Test locally:
poetry run pytest tests/ -v
-
Push and create PR: Target the
mainbranch -
PR description should include:
- Summary of changes
- Related issues (if any)
- Test plan or validation steps
- Artifact directory or ledger entry for any experimental claim
We use ruff for linting and formatting:
# Check style
poetry run ruff check src/
# Auto-fix issues
poetry run ruff check --fix src/- Line length: 100 characters max
- Imports: Use absolute imports; ruff handles sorting
- Docstrings: Google style for non-trivial functions
- Type hints: Required for all function signatures
- Logging: Use
logging.getLogger(__name__), not print()
- Create a new file in
src/modelcypher/cli/commands/ - Register in
src/modelcypher/cli/app.py - Follow the pattern of existing commands
- Add
--aimode support for JSON output
Example structure:
"""My new command."""
import typer
app = typer.Typer()
@app.command()
def my_command(
input_path: str = typer.Argument(..., help="Input path"),
output: str = typer.Option("text", help="Output format"),
):
"""Short description of what the command does."""
# Implementation- Create module in
src/modelcypher/core/domain/<area>/ - Define port interface in
src/modelcypher/ports/if needed - Add service orchestration in
src/modelcypher/core/use_cases/ - Write tests in
tests/test_<module>.py - Add CLI command if user-facing
- No adapter imports: Domain modules must not import from
adapters/ - Pure functions: Prefer pure mathematical operations
- Dataclasses: Use frozen dataclasses for results
- Logging: Use module-level logger
# Unit tests only
poetry run pytest tests/ -m unit
# Property-based tests
poetry run pytest tests/ -m property
# Integration tests (requires models)
poetry run pytest tests/ -m integration
# Backend-specific tests are tagged; see pytest markers in pyproject.tomlIf you are an AI assistant generating code for this repository:
- No Hallucinations: Do not invent modules or imports. Check
src/modelcypherfor existing tools. - Rigor: Prefer Backend protocol vector operations over loop-based logic. Never use numpy (see AGENTS.md).
- Context: Respect the existing "knowledge-as-geometry" ontology. See
docs/GLOSSARY.md. - Git Safety: Do not run destructive git commands. Other agents may be working concurrently.
- Experiment discipline: Do not iterate on experiments without a frozen evaluator and append-only ledger. See
docs/research/AUTONOMOUS-RESEARCH-PROTOCOL.md.
- Documentation: See
docs/START-HERE.mdfor orientation - Issues: Open a GitHub issue for bugs or feature requests
- Discussions: Use GitHub Discussions for questions
Thank you for contributing!