Jorge Turbica / blog · Blog ← All articles ES · Leer en español
Languages

ty 1.0: OpenAI now type-checks its Python with it by default, at a 24x median speedup

Astral calls ty production-ready: fewer false positives than mypy, built-in Pydantic and Django, and a baseline to migrate without blocking CI.

OpenAI already type-checks many millions of lines of Python with ty, and moving to it brought a median 24x speedup and 73% lower peak memory. Astral released ty 1.0 on December 1, 2026, and for the first time recommends it for production to everyone. If your team is still on mypy or Pyright, it is now worth benchmarking on your own repo.

What ty is and why 1.0 matters

ty is a Python type checker and language server written in Rust by the team behind uv and Ruff. It competes with mypy, Pyright and the newer Pyrefly and Zuban. Until now it was a beta that plenty of people ran in their editor and few trusted in CI; 1.0 changes that.

Adoption was already moving fast before the label. PyPI downloads went from 1.7 million in October 2025 to 49.6 million in October 2026. In Astral's November audit of the 25,000 most-downloaded PyPI packages, 11.6% of repositories with a type checker used ty, third behind mypy and Pyright. Among repositories created in the last year it reaches 22.6%, against 26.0% for Pyright and 62.9% for mypy. Besides OpenAI, Astral lists FastAPI and tox as users.

What actually changed

Accuracy, not just speed. On the Python typing conformance suite, ty is down to 14 false positives and 13 false negatives, from 224 and 405 at the beta. mypy scores 190 and 109 on the same suite. That is what really decides a migration: a fast checker that invents errors ends up buried in # type: ignore.

Library support out of the box. ty understands Pydantic, Django, pytest and attrs without plugins. For Django you also need django-types installed.

A new inference engine. There is a new generics solver and bidirectional inference. Return type inference for unannotated functions exists but is opt-in; it defaults to "never".

Automatic fixes. Diagnostics can link across files and suggest fixes, and ty check --fix applies them.

Performance, as measured by Astral. On an M3 Max, ty was the fastest on 16 of 18 projects for cold command-line checks (1.46x faster than Pyrefly and 3.56x faster than Zuban by geometric mean) and the fastest language server on 14 of 17 projects when recomputing diagnostics after an edit. That table has no mypy or Pyright numbers, so OpenAI's 24x is the best hint of how it fares against them.

What may change in your results

Astral does not publish a list of breaking changes, but it does point out where ty behaves differently from mypy and Pyright: it relaxes narrowing after checks like isinstance and is stricter when inferring container and attribute types. In practice, switching from mypy to ty will surface errors you never saw and drop others. It is not a silent drop-in.

If you want more rigor there are opt-in strictness settings such as strict-generic-narrowing and the unsound-return warning. The default target Python version is 3.15; pin yours in the config if you target something else.

Installing it

The usual routes, from the official docs:

bash
# Try it without installing anything
uvx ty check

# As a project dev dependency (best for CI)
uv add --dev ty
uv run ty check

# Global tool
uv tool install ty@latest
pipx install ty

In Docker, copy the binary from the official image: COPY --from=ghcr.io/astral-sh/ty:1.0.0 /ty /bin/. Pin the version rather than using latest: Astral promises improvements every week, which also means diagnostics that shift from week to week. For the editor, there is a VS Code extension on the Marketplace.

Configuration lives in pyproject.toml under [tool.ty] or in a ty.toml:

toml
[tool.ty]
baseline = "ty-baseline.json"

[tool.ty.environment]
python-version = "3.12"

[tool.ty.rules]
possibly-unresolved-reference = "warn"

Migrating without blocking CI

For a large repo, the most useful piece of 1.0 is the diagnostic baseline. Instead of fixing hundreds of errors before turning the checker on, you record the existing ones and CI only fails on new ones:

bash
# Save current diagnostics to ty-baseline.json
uv run ty check --update-baseline
git add ty-baseline.json pyproject.toml

# In CI: only errors missing from the baseline fail
uv run ty check

The baseline stores each diagnostic individually, so a new error in a file that already had errors still breaks the build. The feature is in preview. The alternative is ty check --add-ignore, which adds suppression comments in one pass; it clutters the code but needs no extra file.

How I would roll it out:

  1. Run uvx ty check on a branch and compare the diagnostic count with your current checker.
  2. Review a sample of the new errors: if they are real bugs, ty is already paying for the migration.
  3. Pin ty==1.0.0 in your dev dependencies, generate the baseline and run it in CI alongside mypy or Pyright for a few weeks.
  4. Drop the old checker once the team stops seeing differences that matter.

Versus mypy and Pyright

mypy is still the most widely used and has the most mature plugin ecosystem; Pyright owns the editor through Pylance. ty does not win on plugins. It wins on response times and on a false-positive count in the conformance suite far below mypy's. If type checking alone takes minutes in your CI, or your editor stalls on a monorepo, it is the first candidate to try. If you depend on a specific mypy plugin, check first whether ty covers that library natively.

Sources

Jorge Turbica

Software Engineer and SRE. I write about the real challenges I run into in production.

See portfolio ↗