Meet Ty: Astral’s Ultra-Fast Python Type Checker
Introduction
In the Python ecosystem, static type checking has long been a powerful but often sluggish companion. Tools like mypy and Pyright have helped developers catch type-related bugs before runtime, but their performance on large codebases has frequently been a source of frustration. Enter Ty—Astral’s new type checker and language server that redefines what “fast” means in this space. Written in Rust and built from the ground up for incremental analysis, Ty represents a fundamental rethinking of how type checking should work in Python development.
The Astral Toolchain: A Pattern of Performance
Astral has established a reputation for building high-performance developer tools for Python. Their package manager uv has become essential to many developers’ workflows, and their linter ruff has set new standards for speed and usability. Ty continues this tradition, joining the Astral toolchain as an extremely fast Python type checker and language server, designed as an alternative to mypy, Pyright, and Pylance.
What makes Ty unique in this landscape? First, like Ruff and uv, Ty is written in Rust, leveraging memory safety and performance characteristics that Python-native tools simply cannot match. But Ty goes beyond this foundation—it was designed from the very beginning to power a language server, with an architecture built entirely around incrementality.
Performance That Rewrites Expectations
The performance claims for Ty are nothing short of dramatic. Without caching, Ty is consistently between 10x and 60x faster than mypy and Pyright. When run in an editor environment, where incremental updates matter most, the gap becomes even more pronounced.
Consider this benchmark: in the PyTorch repository, after editing a central, load-bearing file, Ty recomputes diagnostics in 4.7 milliseconds. This is 80x faster than Pyright (386ms) and 500x faster than Pyrefly (2.38 seconds).
These numbers aren’t just academic—they translate directly to developer experience. When type checking runs in milliseconds rather than seconds, it becomes frictionless. Developers can adopt a tighter feedback loop, catching issues immediately after typing rather than waiting for batch checks.
Even compared to other Rust-based language servers, Ty demonstrates orders-of-magnitude superiority in incremental updates on large projects. This performance enabled Ty to check 2,871 Python files in Django’s source code—averaging 175 lines each—in just a few seconds, with much of that time going to actually printing diagnostic messages to the screen.
Designed for the Editor Experience
Ty’s architecture prioritizes the language server use case above all else. The entire system is built around “incrementality,” enabling selective recomputation of only the necessary portions when a user edits a file or modifies an individual function.
This makes live updates extremely fast in the context of an editor or long-lived process. For developers using VS Code, Cursor, or any editor that implements the Language Server Protocol, Ty supports all expected capabilities: Go to Definition, Symbol Rename, Auto-Complete, Auto-Import, Semantic Syntax Highlighting, Inlay Hints, and more.
The official Ty VS Code extension is available, integrating the language server directly into the editor experience. For users of Neovim, PyCharm, and other editors, Ty runs wherever LSP is supported.
Advanced Type Checking Capabilities
Performance alone wouldn’t make Ty compelling—it needs to be a better type checker, not just a faster one. Ty aims to balance correctness with a deep focus on the end-user experience.
The type checker includes first-class support for advanced typing features:
- First-class intersection types, enabling more precise type combinations
- Advanced type narrowing that improves type inference in conditional branches
- Sophisticated reachability analysis for detecting unused code and dead dependencies
- Support for partially typed code, making adoption easier for existing projects
Beyond these features, Ty pushes forward the state of the art by providing more accurate feedback and avoiding assumptions about user intent that often lead to false positives in other type checkers.
World-Class Diagnostic Messages
Diagnostic output is the primary user interface for a type checker, and Ty treats this as a first-class feature. Inspired by the Rust compiler’s world-class error messages, Ty’s diagnostic system pulls in context from multiple files at once to explain not only what’s wrong, but why—and often, how to fix it.
For example, when assigning an invalid value to a dictionary key, Ty surfaces both the type mismatch at the assignment site and the corresponding item declaration. When importing an unresolved module, Ty surfaces both the unresolved import at the import site and the Python version configuration that caused it.
This contextual approach transforms type checking from a frustrating “you made a mistake” experience into a learning tool that helps developers understand the type system better.
Getting Started with Ty
You can install Ty today with uv tool install ty@latest, or via the VS Code extension. For a quick test against an existing project, the command uvx ty check runs the checker on the current directory.
After installation, Ty will discover installed packages in the active virtual environment (via VIRTUAL_ENV) or find a .venv directory in the project root. It can also be pointed to a specific Python interpreter with the --python flag.
To run the type checker, use ty check. This recursively checks all Python files in the working directory. You can also provide specific paths: ty check example.py.
Ty includes a watch mode (ty check --watch) that monitors files for changes and rechecks affected files—including files that depend on the changed file. This uses fine-grained incrementality to perform subsequent checks much faster than running ty check repeatedly.
Configuration and Customization
Ty’s type checking diagnostics are associated with rules that can be configured to your project’s needs. You can change default severity levels for specific rules using --error, --warn, and --ignore options, and suppress specific violations using suppression comments.
The output format is also configurable. The default style shows detailed context with code snippets and caret highlighting. For CI/CD pipelines or programmatic parsing, the --output-format concise option fits each diagnostic message on a single line.
A Word on Production Readiness
Ty is currently in Beta, and the Astral team uses it exclusively in their own projects. They are ready to recommend it to motivated users for production use. However, the tool is still evolving, with the gap between Beta and Stable focusing on stability, bug fixes, completing features in the Python typing specification, and first-class support for popular third-party libraries like Pydantic and Django.
Early adopters should expect to encounter occasional missing features or edge cases. But the trajectory is clear: Ty represents the future of Python type checking.
The Broader Vision
Ty is not just a type checker—it’s a foundational piece for semantic capabilities across the Astral toolchain. Looking ahead, Ty will enable dead code elimination, unused dependency detection, SemVer-compatible upgrade enforcement, CVE reachability analysis, type-aware linting, and more.
The Astral team’s commitment is that Ty will get significantly better every week by working closely with their users. Their goal is to make Python the most productive programming ecosystem on Earth—and Ty is a critical step on that path.
Conclusion
Ty changes the calculus for Python type checking. The performance gap—10x to 60x faster than existing tools on cold checks, and even more dramatic in incremental scenarios—makes type checking feel instant and frictionless. Combined with advanced type system features, world-class diagnostics, and deep editor integration, Ty represents a genuine leap forward in developer experience.
If you’ve previously abandoned type checking because it felt too slow or cumbersome, Ty is reason to give it another look. The Python ecosystem’s rapid evolution toward faster, Rust-powered tooling continues, and Ty is a powerful addition to that transformation.
Here are short backlink-style references for both topics:
Meet Ty: Astral’s Ultra-Fast Python Type Checker
- VS Code Extension: Ty – VS Code Marketplace
- Installation:
uv tool install ty@latest - Documentation: Ty Docs
- Benchmarks: Astral Performance Blog
- Community: Astral Discord




