facebook

Pyrefly is a fast Python type checker and language server written in Rust by Meta, serving as the default checker for Instagram's 20-million-line codebase.

1.4.0
Published at
12d ago
7,117
Stars
4,762
Download
Synced at
8d ago

Latest release

1.4.0Oct 15, 2026, 04:56 PM
Downloads slow? Switch the source anytime above

README

Project Overview

Pyrefly is an open-source Python type checker and language server from Meta, written in Rust. It checks over 1.85 million lines of code per second, type checking projects like PyTorch 15x faster than Mypy and Pyright. It is the default type checker for Instagram's 20-million-line Python codebase and is adopted by large open-source projects including PyTorch and JAX. Beyond the CLI, it offers extensions for VS Code, Neovim, Zed, and more.

Item Value
Developer Meta
Language Rust
Status Stable (1.0+)
License MIT

Fast type checking proven on industrial-scale codebases.

Key Features

  • Extremely fast: over 1.85 million lines per second; rechecks after saving usually finish in under 10 milliseconds
  • Full-featured language server: navigation, autocomplete, hover info, inlay hints, semantic highlighting
  • Understands frameworks: built-in Pydantic, Django, and pytest support with model validation and fixture navigation out of the box
  • Migration toolkit: pyrefly init to move from Mypy/Pyright and pyrefly suppress to silence existing errors
  • Type inference: pyrefly infer generates type annotations automatically
  • Editor integrations: VS Code, Neovim, Zed, and more
  • Consistent results: the CLI and your editor agree on findings

Target Audience

  • Python developers
  • Large codebase maintainers
  • Teams migrating from Mypy or Pyright
  • Projects using Pydantic or Django
  • Heavy users who value instant IDE feedback

Quick Start

  1. Install the command-line tool
pip install pyrefly
  1. Initialize project configuration
pyrefly init
  1. Run type checking
pyrefly check
  1. With many legacy errors, silence them via suppress and address them gradually

Core Advantages

  • Proven at scale: production use on a 20-million-line codebase at Instagram
  • Leading speed: over an order of magnitude faster than mainstream checkers
  • Adoption friendly: init, suppress, and infer make gradual migration easy
  • Real-world frameworks: built-in framework understanding reduces false positives

System Requirements

Item Requirement
OS Linux, macOS, Windows
Runtime Python (for pip install)
Editors VS Code, Neovim, Zed, and more

Notes

  • Version policy: not strict semantic versioning; upgrades may introduce new type errors
  • Suppressions: after upgrading, use pyrefly suppress to handle newly reported errors in bulk
  • Release cadence: minor versions ship monthly, with patch releases for critical fixes

Release history

Sort