Thank you for your interest in contributing to oMLX! This guide will help you get started.
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/<your-username>/omlx.git
cd omlx- Install development dependencies:
pip install -e ".[dev]"Note: oMLX requires Apple Silicon (M1/M2/M3/M4) and Python 3.10+.
Run tests with:
# Fast tests only (recommended during development)
pytest -m "not slow"
# Run a specific test file
pytest tests/test_config.py -v
# Run slow tests (requires model files)
pytest -m slowTest markers:
| Marker | Description |
|---|---|
@pytest.mark.slow |
Tests that require loading models |
@pytest.mark.integration |
Tests that require a running server |
Test file naming: For a source file omlx/<module>.py, the test file should be tests/test_<module>.py.
When modifying source code, always check if existing tests are affected and update them accordingly. New code should include corresponding tests.
All source files should include the Apache 2.0 license identifier:
# SPDX-License-Identifier: Apache-2.0omlx/
├── omlx/ # Main package
│ ├── api/ # API models and adapters (OpenAI, Anthropic)
│ ├── cache/ # KV cache management (paged, prefix, SSD)
│ ├── engine/ # Inference engines (simple, batched, embedding)
│ ├── mcp/ # Model Context Protocol integration
│ ├── models/ # Model wrappers (LLM, embedding)
│ ├── utils/ # Utilities
│ ├── server.py # FastAPI server
│ ├── scheduler.py # Request scheduling with mlx-lm BatchGenerator
│ ├── engine_core.py # Core async inference engine
│ ├── paged_cache.py # Block-based KV cache with LRU eviction
│ └── cli.py # CLI entry point
├── packaging/ # macOS menubar app (PyObjC)
├── tests/ # Test suite
└── docs/ # Documentation
For a more detailed architecture overview, see the Architecture section in the README.
- Bug fixes — Check open issues for reported bugs
- Performance — Inference speed, memory efficiency, cache hit rates
- New features — API endpoints, model format support, admin dashboard improvements
- Documentation — Guides, examples, API references
- Model support — Testing and fixing compatibility with new MLX models
- macOS app — UI improvements, new settings, system integration
-
Fork & branch — Create a feature branch from
main:git checkout -b feature/your-feature
-
Make changes — Write code and tests following the style guidelines above.
-
Test — Ensure all related tests pass:
pytest tests/test_<affected_module>.py -v
-
Submit — Push your branch and open a pull request against
main. Describe what changed and why.
If you have questions or run into issues, please open an issue on GitHub Issues.