
Pyrefly: replace mypy with Meta's Rust-powered type checker in one pip install
Pyrefly v1.0.0 (Meta, MIT, released May 12 2026) is a Rust-built Python type checker and LSP server that replaces mypy in both CI and the editor with a single pip install. Independent benchmarks show 49× faster than mypy on a 120k-line codebase. The VS Code extension (meta.pyrefly) and PyCharm 2026.1.2 native integration both work out of the box.

If
mypy has been the slowest step in your Python CI for a while, the wait for a serious alternative is over. Meta released Pyrefly v1.0.0 on May 12, 2026 1 — a Rust-based Python type checker and language server (LSP) that already runs on Instagram's 20-million-line codebase as the default type checker. 1 One package, one pip install, covers both CI checks and in-editor type inference.Install
CLI (works with any editor):
pip install pyrefly
# or
uv add --dev pyreflyPython ≥ 3.8 required. Supports Windows (x86-64, ARM64), Linux (x86-64, ARM64, glibc 2.17+), and macOS (ARM64 11.0+, x86-64 10.12+). 2
PyCharm 2026.1.2: open the Type widget at the bottom of the IDE window → select Pyrefly. PyCharm auto-installs it if not present. 4
What it does
Pyrefly is a dual-role tool: run
pyrefly check from the terminal for CI batch checking, or let the bundled LSP server power go-to-definition, hover types, and code completion in your editor — both come from the same binary. 1Type inference goes beyond annotated parameters. Pyrefly infers variable types and return types from unannotated code —
def foo(x): return True is inferred as (x: Any) -> bool without any annotation. 1 Flow types track literal values through control flow: x: int = 4 is tracked as Literal[4] at the next usage, narrowing further in conditionals.Five named presets control how strict the checker is:
off, basic (high-confidence errors only — the default for unconfigured projects), legacy (mypy-compatible behavior for gradual migration), default, and strict (no implicit Any). 5Built-in framework support covers Pydantic (lax mode, range constraints,
RootModel, pydantic-settings) and Django (model relationships, fields, views, factory_boy). Jupyter notebooks get full parity with .py files: rename, find references, code actions, document symbols. 1Usage demo
Migrating from mypy in under a minute:
# 1. Install
pip install pyrefly
# 2. Auto-generate config (detects existing mypy.ini / pyproject.toml / .mypy.ini)
pyrefly init
# → writes [tool.pyrefly] to pyproject.toml, sets preset = "legacy"
# 3. Run
pyrefly check src/The resulting
pyproject.toml block looks like this:[tool.pyrefly]
project-includes = ["src/**/*"]
preset = "legacy"Swap
preset = "legacy" to preset = "default" when you're ready for stricter checking. 5Type annotation inference — useful for adding annotations to an untyped codebase:
pyrefly infer src/utils.pyBefore:
def total(numbers):
return sum(numbers)After (
pyrefly infer output):def total(numbers: list[int]) -> int:
return sum(numbers)VS Code setting — force type errors on regardless of project config:
"python.pyrefly.displayTypeErrors": "force-on"How fast is it?
Independent benchmark data from a public suite that runs daily against 53 popular Python packages 6:
| Package | Pyrefly v1.0 | Pyright v1.1.409 | Mypy v2.1.0 |
|---|---|---|---|
| django | 1.7 s / 292 MB | 23.1 s / 1,035 MB | 12.7 s / 409 MB |
| pandas | 11.7 s / 756 MB | timeout (>300 s) | 31.1 s / 586 MB |
| tensorflow | 11.6 s / 707 MB | 211.7 s / 3,951 MB | 76.6 s / 1,265 MB |
| flask | 0.4 s / 186 MB | 4.1 s / 280 MB | 3.9 s / 189 MB |
Pyrefly did not time out or run out of memory on any of the 53 packages; Pyright timed out on numpy, pandas, and scipy, and OOM-killed on homeassistant and transformers. 6
On a real 120,000-line codebase, one independent test clocked mypy at 9 minutes and Pyrefly at 11 seconds — roughly 49×. 7 A separate April 2026 benchmark on smaller codebases (Rich at 38k LOC, SQLGlot at 74k LOC) found 4–7× faster than mypy. 8 The vendor's headline "76×" derives from Meta's internal Instagram benchmarks; treat it as a plausible ceiling on very large monorepos, not a floor.
For incremental saves in the editor, the improvement is more uniform: PyTorch incremental diagnostics went from 2.4 s to 19 ms on an M4 MacBook Pro — 125× faster. 1
Known limitations
- PyCharm integration is local-interpreter only. Docker, Docker Compose, WSL, SSH, and multi-module project support are planned for a future release. 4
- VS Code: set your Python interpreter explicitly. If the extension doesn't pick up the project virtualenv, open the Command Palette → "Python: Select Interpreter" and point it at your env — Pyrefly then follows VS Code's interpreter selection. [cite:9|[Ann] Pyrefly v1.0 — Reddit r/Python|[https://www.[reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]](https://reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]](https://www.reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]))
- Typing spec conformance: 92.2% (130/141 tests). Pyright sits at 95.7%; the gap is real, though Pyrefly's score improved from 70% at beta. 1
pyrefly coverage reportwas renamed. Usepyrefly report— the old subcommand name is documented but doesn't work in v1.0.0. [cite:9|[Ann] Pyrefly v1.0 — Reddit r/Python|[https://www.[reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]](https://reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]](https://www.reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]))- 575 open issues on GitHub as of May 20, 2026. 9 The project is under active development (last push the same day as this writing); the maintainer is openly responsive — the team's goal is same-day issue triage. [cite:9|[Ann] Pyrefly v1.0 — Reddit r/Python|[https://www.[reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]](https://reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]](https://www.reddit.com/r/Python/comments/1tbyd7m/ann_pyrefly_v10_fast_type_checker_language_server/]]))
Plugin: Pyrefly · Publisher: Meta Platforms, Inc. · Version: 1.0.0 · License: MIT
Language: Python ≥ 3.8 · Use case: Type checking, language server
VS Code: meta.pyrefly on VS Code Marketplace · PyPI: pyrefly on PyPI · Source: facebook/pyrefly on GitHub
Cover image from: Pyrefly v1.0 is here! — pyrefly.org
References
- 1Pyrefly v1.0 is here! — pyrefly.org
- 2Installation
- 3Pyrefly — Python Language Tooling — VS Code Marketplace
- 4Pyrefly LSP Integration with Type Engine in PyCharm 2026.1.2 — JetBrains
- 5Configuration
- 6Type Checker Timing Benchmark — python-type-checking.com
- 7Pyrefly: Up to 76x Faster Than mypy — VentureMagazine
- 8How do Python type checkers compare? — pydevtools.com
- 9facebook/pyrefly — GitHub
Add more perspectives or context around this Drop.