What's New
Highlights from recent uvicorn releases that affect uvicorn.run() (full list in the release notes):
- 0.54.0: HTTP/2 response trailers and 103 Early Hints through ASGI extensions.
- 0.53.0: experimental HTTP/2 with http="zttp", http2=True, and support for the zuvloop event loop. IPv6 loopback (::1) is now trusted by default for proxy headers.
- 0.52.0: experimental zttp HTTP/1.1 implementation (http="zttp"). Not for production traffic yet.
- 0.51.0: SIGHUP restarts workers one at a time, so reloads no longer drop requests. colorama is no longer in the standard extra.
- 0.50.0: ws="auto" now picks websockets-sansio. Any startup failure (app import, socket bind, lifespan) exits with code 3.
- 0.48.0: ssl_ciphers defaults to None, using OpenSSL defaults.
- 0.47.0: new ssl_context_factory parameter for custom SSLContext setups (mTLS, minimum TLS version...).
- 0.45.0: new reset_contextvars parameter, log_level is case-insensitive and log_config accepts os.PathLike.
Deprecation Notices
Be aware of these deprecations when upgrading uvicorn:
uvicorn.workers module deprecated
The uvicorn.workers module is deprecated and will be removed in a future release. If you're using Gunicorn with uvicorn workers, migrate to the separate uvicorn-worker package:
pip install uvicorn-worker
Then use: gunicorn -k uvicorn_worker.UvicornWorker
Legacy websockets implementation deprecated
As of uvicorn 0.50.0 (July 2026), ws="websockets" is deprecated and ws="auto" picks websockets-sansio. Use ws="websockets-sansio" or ws="wsproto". ws_max_queue and ws_per_message_deflate only apply to the legacy implementation.
Python 3.9 no longer supported
As of uvicorn 0.40.0 (December 2025), Python 3.9 support has been dropped. Upgrade to Python 3.10 or later.
ServerState deprecated from main module
As of uvicorn 0.34.1 (April 2025), importing ServerState from the main uvicorn module is deprecated. Import it from uvicorn.server instead.