Astral Unveils ty: A Blazing Fast Python Type Checker and Language Server Built in Rust

Python Development Tools

Astral, creators of uv and Ruff, announces the Beta release of ty, a new Python type checker and language server. Built in Rust, ty offers unparalleled speed, advanced type checking, and a best-in-class diagnostic system, providing a superior alternative to existing tools.

Astral is proud to announce the Beta release of ty, an incredibly fast Python type checker and language server written in Rust. Designed as a high-performance alternative to existing tools like mypy, Pyright, and Pylance, ty is now exclusively used in Astral's own projects and is recommended for production use by motivated users.

At Astral, we are dedicated to building high-performance developer tools for the Python ecosystem, known for uv, our Python package manager, and Ruff, our linter and formatter. ty represents the next significant addition to the Astral toolchain.

Benchmarking ty against other popular type checkers reveals its exceptional speed. When type checking the home-assistant project on the command line without caching (M4), ty completed in 2.19s, significantly outperforming Pyrefly (5.32s), Pyright (19.62s), and mypy (45.66s).

A core design principle of ty is its incremental architecture, built from the ground up to power a language server. This design allows it to selectively re-run only necessary computations when a user edits a file or modifies a function, leading to extremely fast live updates in editors. For instance, when re-computing diagnostics in the language server after editing a file in the PyTorch project (M4), ty finished in just 4.5ms, dramatically faster than Pyright (370.5ms) and Pyrefly (2.60s).

You can install ty today with uv tool install ty@latest, or via our VS Code extension.

Like Ruff and uv, ty is grounded in Astral's core product principles, with an obsessive focus on performance. Without caching, ty is consistently between 10x and 60x faster than mypy and Pyright. The difference is even more pronounced in an editor environment; for example, after editing a critical file in the PyTorch repository, ty recomputes diagnostics in 4.7ms: 80x faster than Pyright (386ms) and 500x faster than Pyrefly (2.38 seconds). ty truly delivers exceptional speed!

Beyond speed, ty aims to be a superior type checker by being correct, pragmatic, and ergonomic. It advances the state of Python type checking with features like first-class intersection types, advanced type narrowing, and sophisticated reachability analysis. This provides more accurate feedback and avoids assumptions about user intent that often lead to false positives. Our goal is to build not only a faster type checker; we want to build a better type checker, one that balances correctness with a deep focus on the end-user experience.

ty was built in the open by our core team alongside dozens of active contributors under the MIT license, and the same applies to our editor extensions. It can be run anywhere Python is written, including in the browser. Even compared to other Rust-based language servers like Pyrefly, ty can run orders of magnitude faster when performing incremental updates on large projects.

ty boasts a best-in-class diagnostic system, inspired by the Rust compiler's own world-class error messages. A single ty diagnostic can consolidate context from multiple files at once to explain not only what is wrong, but why, and often how to fix it.

When assigning an invalid value to a dictionary key, ty highlights both the type mismatch at the assignment site and the corresponding item declaration.

The diagnostic output serves as the primary user interface for a type checker. We prioritized our diagnostic system from the outset, designing it as a first-class feature in ty with both human users and automated agents in mind.

When importing an unresolved module, ty surfaces both the unresolved import at its site and the corresponding Python version configuration.

For users of VS Code, Cursor, or similar editors, we highly recommend installing the ty VS Code extension. The ty language server supports all the capabilities that you'd expect for a modern language server (Go to Definition, Symbol Rename, Auto-Complete, Auto-Import, Semantic Syntax Highlighting, Inlay Hints, etc.), and runs in any editor that implements the Language Server Protocol.

Following the Beta release, our immediate priority is supporting early adopters. We are working towards a Stable release next year, with key focus areas between Beta and Stable including: (1) enhancing stability and implementing bug fixes, (2) completing the long tail of features outlined in the Python typing specification, and (3) providing first-class support for popular third-party libraries such as Pydantic and Django.

Looking further ahead, ty is poised to power advanced semantic capabilities across the entire Astral toolchain, enabling features like dead code elimination, unused dependency detection, SemVer-compatible upgrade enforcement, CVE reachability analysis, type-aware linting, and more ambitious functionalities yet to be fully revealed.

Our commitment, as with Ruff and uv, is to continuously improve ty every week by closely collaborating with our users, ultimately aiming to make Python the most productive programming ecosystem globally.