Pyrefly brings Rust-based type checking to Python IDEs and CI
Meta has released Pyrefly, an open source Python type checker and IDE extension written in Rust, now available in alpha. The tool performs static analysis to verify type consistency and catch errors before code execution, with support for both command-line usage and IDE integration.
Pyrefly is available for immediate testing. Installation is straightforward:
- Install via pip:
pip install pyrefly - Migrate existing type checker configurations using the provided migration guide
- Download the VSCode extension for IDE integration
- Report issues or submit feedback on GitHub
Why a new type checker
Pyrefly's origins trace back to 2017, when Meta began developing Pyre to handle type checking across Instagram's extensive Python codebase. Pyre was built in OCaml and drew design inspiration from Hack and Flow. While Pyre served the company well for years, evolving type system requirements and the need for type checking to power responsive IDE features exposed limitations that prompted a fresh approach.
The team experimented with community solutions, including Pyright for code navigation, but ultimately identified a need for an extensible type checker capable of code navigation, large-scale checking, and exporting types to external services. These requirements drove the decision to build Pyrefly from scratch.
Core design principles
Several guiding principles shaped Pyrefly's development:
Performance as a foundation
Pyrefly aims to move checking from CI pipelines to every keystroke. The Rust implementation can check approximately 1.8 million lines of code per second on large codebases, with careful attention to incremental updates. The architecture is designed for high performance across projects of all sizes.
IDE and CLI parity
A unified view between IDE and command-line tooling was a priority from the start. Pyrefly builds abstractions that capture the differences between these environments without incurring unnecessary overhead—an approach that proved difficult to retrofit onto Pyre after the fact.
Type inference for untyped code
Many Python programs lack annotations, yet Pyrefly still aims to deliver benefits to those codebases. The tool automatically infers types for returns and local variables and surfaces them in the IDE. Users can double-click an inferred type to insert it into the code if desired.
Open development
Pyrefly is released under the MIT license on GitHub. The project welcomes pull requests, issue reports, and discussion via its Discord channel. The open source Python typing specification played a significant role in making Pyrefly's development feasible.
Roadmap and availability
The alpha release marks the beginning of a push toward general availability. The team plans to eliminate the remaining bugs and feature gaps this summer, with community feedback guiding the process. Meta intends to continue contributing to the Python typing ecosystem, building on its history of PEP contributions alongside other type checker maintainers.
Those interested in the technical details behind Pyrefly can find more in a Meta Tech Podcast episode featuring team members and a PyCon US talk on high-performance Python through faster type checking and free threaded execution.



