Skip to main content

qmd (Python/MLX rewrite)

Python/MLX rewrite of qmd — hybrid search over your markdown collections. Apple Silicon + MLX only (no GGUF, no cross-platform support).

Beta: feedback wanted. pyqmd is in public beta. Please report problems or surprises in Issues.

Why this exists

Reasonable people might ask "why?" I read about qmd, and as a Python engineer on Apple Silicon my first thought was: is there a Python version of this that uses MLX models? I couldn't find one, so I built it with fidelity to qmd's behavior as the primary goal. Where fidelity wasn't feasible, or I found a clear improvement, the difference is deliberate and tracked in COMMAND_STATUS.md. pyqmd is an independent port and is not affiliated with qmd.

Somewhere along the way it became as much about building quality software agentically as about the port itself, and by that I mean not vibe-coded. It's built with multiple coding agents (primarily Claude Code, plus OpenCode with Muse Spark models), all using the obra/superpowers skills, under my direction. The repo's convention is that agent-written commits carry a model co-author trailer. Non-trivial changes start as a design doc (published here) and a plan, then go in test-first, and that workflow includes an independent review step before merging. There are over 9k lines of code and over 20k lines of tests and parity checks, including a suite that compares results against a pinned copy of Node qmd. Search-quality changes are measured against pass criteria fixed beforehand, not eyeballed, and the specs record flat or negative results as plainly as wins. The most recent experiment had its decision rule written down before it ran.

Install

uv tool install pyqmd-mlx

(or pipx install pyqmd-mlx). The package is pyqmd-mlx; the command it installs is pyqmd — PyPI's pyqmd is an unrelated project. Upgrade with uv tool upgrade pyqmd-mlx.

Or build it yourself from a clone:

git clone https://github.com/after2400/pyqmd && cd pyqmd
just install   # uv tool install --editable .

(editable, so pulling new commits in the clone updates the installed pyqmd command without reinstalling)

just uninstall

Usage

pyqmd collection add ~/notes --name notes
pyqmd embed
pyqmd query "how do I configure auth"
pyqmd mcp                 # MCP server over stdio
pyqmd mcp --http          # MCP server over Streamable HTTP
pyqmd --help

Index lives at ~/.cache/pyqmd/index.sqlite, distinct from the live Node qmd's ~/.cache/qmd/index.sqlite — both can coexist during the transition.

Optional: heading breadcrumbs

Set PYQMD_EMBED_BREADCRUMBS=1 to embed markdown chunks together with their section-heading path (Doc > Section > Subsection). In a vector-search benchmark on structured documents this found the right passage a few points more often, but after full-text fusion the gain was small and not statistically clear, and we have not measured it through the reranker, so it is off by default. Turning it on (or off again) changes what gets embedded, so run pyqmd embed afterwards; pyqmd status says so until you do. The setting must be the same everywhere pyqmd runs, including an MCP client's server config, or the server will report documents as pending.

Performance note: prefer pyqmd mcp for repeated queries

Every one-shot CLI call (search/vsearch/query) that touches embeddings pays a real, per-process MLX model-load cost, and it doesn't get cheaper on repeat launches the way Node's mmap-backed GGUF loading does (see parity/README.md's "Performance benchmark" section for why). Measured on an Apple Silicon Mac with a warm disk: search 0.4–0.5 s, vsearch about 2.5 s, query --no-rerank 3.5–4.5 s, full query 9–11 s (a cold disk adds more on the first run). If you're issuing more than one embedding-backed query, run pyqmd mcp (or pyqmd mcp --http) instead of shelling out per query — it loads models once and serves unlimited calls from the same process, which is the actual equivalent of Node's cheap repeated invocations here, not a faster load path. Pure-BM25 search doesn't touch MLX at all and stays cheap either way.

Development

just develop     # install dev deps + pre-commit hooks
just test-fast   # non-slow suite
just test-slow   # real-model tests (downloads MLX weights)
just lint

Metadata

Release files for pyqmd-mlx 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqmd-mlx 0.9.1
File Size Uploaded Provenance Actions
pyqmd_mlx-0.9.1.tar.gz 781.6 kB With provenance Details for pyqmd_mlx-0.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyqmd-mlx 0.9.1
File Interpreter ABI Platform Actions
pyqmd_mlx-0.9.1-py3-none-any.whl Python 3 none any Details for pyqmd_mlx-0.9.1-py3-none-any.whl

Total release size: 931.0 kB

Release files / pyqmd_mlx-0.9.1.tar.gz

Download URL pyqmd_mlx-0.9.1.tar.gz
Size 781.6 kB
Tags Source
SHA-256 checksum
How to use checksums
db86d565c38ee714ade9eb7b860ed7c1c548590ff56fc7fb003e6a3a0f1429a5
BLAKE2b-256 checksum
How to use checksums
27d32f21000d2d8e64be71794f37ae0a33ada907fcbd59715c1ed9a860f36966
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / pyqmd_mlx-0.9.1-py3-none-any.whl

Download URL pyqmd_mlx-0.9.1-py3-none-any.whl
Size 149.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b3eb164465bad90d8a5daab9fd7dc1807d21a04caa5835f76c63711cc6f55ec
BLAKE2b-256 checksum
How to use checksums
e4fa98271345425fdcf76cfa273b2d891046ebf7c19822457e4935101b8d3445
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for pyqmd-mlx 0.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyqmd_mlx-0.9.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page