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.0

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.0
File Size Uploaded
pyqmd_mlx-0.9.0.tar.gz 765.0 kB Details

Built distribution (wheel)

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

Total release size: 914.1 kB

Release files / pyqmd_mlx-0.9.0.tar.gz

Download URL pyqmd_mlx-0.9.0.tar.gz
Size 765.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a1cf4d0748efd7425b4acb5803d1f434a06d729a16b32d5e18721daeeadfc7b1
BLAKE2b-256 checksum
How to use checksums
10d48bb0f1929a5b2580a10c5e35b8b0313e52eb0b3aad5e8a9e01b2ea6d4af6
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 16, 2026.

Transparency log

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

Download URL pyqmd_mlx-0.9.0-py3-none-any.whl
Size 149.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c49ac6981629186788790274affe02d8123da3d91a551217257a85d249f63f6
BLAKE2b-256 checksum
How to use checksums
f540accc92c601a723ecc36e5cee8d5bae98f24f296b2cb45901e4ffba72b8e0
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

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