{
 "kind": "tool",
 "slug": "uvicorn",
 "path": "tools/uvicorn/",
 "name": "Uvicorn",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "HTTP servers and APIs",
   "tools/http-servers/"
  ]
 ],
 "lead": "Run your async Python web app.",
 "chips": [
  {
   "label": "HTTP servers and APIs",
   "path": "tools/http-servers/"
  },
  {
   "label": "PYPI"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "pip install uvicorn"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/Kludex/uvicorn"
  },
  {
   "label": "Website",
   "href": "https://uvicorn.dev/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "BSD-3-Clause",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:",
   "note": "Free for paid and closed apps; keep the BSD copyright notice if you ship Uvicorn's code.",
   "src": "https://github.com/Kludex/uvicorn/blob/main/LICENSE.md"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 22, 2026",
   "note": "Latest GitHub release Sep 25, 2026. ",
   "src": "https://github.com/Kludex/uvicorn"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "477 projects",
   "status": "info",
   "sub": "#1 of 102 in its category",
   "note": "Dependency in 477 public GitHub projects set up for AI coding agents that we scanned (7.6%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Uvicorn does",
   "parts": [
    {
     "t": "prose",
     "text": "Uvicorn is a free program that runs Python web apps built with FastAPI, Starlette and similar tools. It takes the requests that come in from browsers and hands them to your code. You start it with one command on your computer or your server."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Try your app while you code",
       "text": "Your assistant builds a FastAPI backend; Uvicorn runs it on your computer and restarts it each time a file changes.",
       "idea": false
      },
      {
       "title": "Serve the app on your own server",
       "text": "On a rented server, Uvicorn runs several copies of your app at once, so one slow request does not hold up the rest.",
       "idea": false
      },
      {
       "title": "Put it behind Nginx",
       "text": "Nginx in front sends files and holds slow visitors, and Uvicorn only runs your Python code.",
       "idea": false
      },
      {
       "title": "Live chat and updates in the page",
       "text": "A chat window or a live progress bar keeps one connection open per visitor; Uvicorn can hold those open while other requests go on.",
       "idea": false
      },
      {
       "title": "Start the server inside a test script",
       "text": "Your test or a small tool starts the web app, sends it a few requests and stops it again, all in one Python file.",
       "idea": false
      },
      {
       "title": "Update code without dropping visitors",
       "text": "After a deploy you send one signal, and Uvicorn swaps its copies of the app one by one, so nobody gets an error page.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Uvicorn popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "82",
       "of": "/ 100",
       "l": "Gid Score, #72 overall"
      },
      {
       "n": "167M",
       "l": "downloads a week, pypi"
      },
      {
       "n": "11.1K",
       "l": "GitHub stars"
      },
      {
       "n": "477",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Uvicorn is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Uvicorn is a dependency in 477 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (29.4% of the 1,623 Python ones), #1 of 102 in http servers and apis.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 3,226; those are left out of every share on this page.",
      "The most used alternative in our scan is Tornado (12 projects).",
      "Projects that use it most often also use FastAPI (90.1%), Pydantic (62.1%), python-dotenv (52.2%).",
      "It is more common in projects set up for OpenClaw (12.0%) than for OpenAI Codex (4.1%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "251 projects, 8.3%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "211 projects, 6.4%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "158 projects, 6.5%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "40 projects, 12.0%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "25 projects, 5.3%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "19 projects, 4.1%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "18 projects, 6.5%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "16 projects, 4.7%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 90.1% of its projects",
       "v": "FastAPI",
       "path": "tools/fastapi/"
      },
      {
       "l": "In 62.1% of its projects",
       "v": "Pydantic",
       "path": "tools/pydantic/"
      },
      {
       "l": "In 52.2% of its projects",
       "v": "python-dotenv",
       "path": "tools/python-dotenv/"
      },
      {
       "l": "In 37.3% of its projects",
       "v": "python-multipart",
       "path": "tools/python-multipart/"
      },
      {
       "l": "In 36.1% of its projects",
       "v": "Requests",
       "path": "tools/requests-py/"
      },
      {
       "l": "In 32.7% of its projects",
       "v": "Pydantic Settings",
       "path": "tools/pydantic-settings/"
      },
      {
       "l": "In 30.8% of its projects",
       "v": "httpx",
       "path": "tools/httpx/"
      },
      {
       "l": "In 30.4% of its projects",
       "v": "PyYAML",
       "path": "tools/pyyaml/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Uvicorn in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Two install tiers: minimal or [standard]",
       "v": "A plain install keeps dependencies to pure Python. <code>uvicorn[standard]</code> uses <code>uvloop</code> and <code>httptools</code> \"if possible\". It also adds <code>websockets</code>, <code>watchfiles</code> for <code>--reload</code>, <code>python-dotenv</code> for <code>--env-file</code>, and PyYAML for YAML log configs."
      },
      {
       "l": "Not tied to one framework",
       "v": "Uvicorn serves the ASGI interface, not a specific framework. The README presents this decoupling as the point of ASGI: any framework that speaks ASGI can run on any ASGI server."
      },
      {
       "l": "Can run inside an existing event loop",
       "v": "There are three ways to start Uvicorn from code: <code>uvicorn.run()</code>, a <code>Config</code> plus <code>Server</code> pair, or <code>await server.serve()</code>. The last one is for when an async environment is already running."
      },
      {
       "l": "Application factories via --factory",
       "v": "Uvicorn can call a zero-argument function that returns the app, instead of importing a ready-made app instance."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "HTTP/2 is experimental and opt-in",
       "v": "The README lists HTTP/2 as supported. The release notes call it experimental. It needs the <code>zttp</code> package and the flags <code>--http zttp --http2</code>. Upgrade-based h2c and WebSockets over HTTP/2 are not supported."
      },
      {
       "l": "Built-in Gunicorn workers are deprecated",
       "v": "The docs still show <code>-k uvicorn.workers.UvicornWorker</code>. They also warn that this module is going away and point to a separate package instead."
      },
      {
       "l": "Process management lives outside Uvicorn",
       "v": "The docs recommend Gunicorn for production. Gunicorn handles scaling worker counts, graceful worker restarts and zero-downtime upgrades."
      }
     ]
    },
    {
     "t": "h3",
     "text": "A bare ASGI app served by Uvicorn"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Python",
       "code": "async def app(scope, receive, send):\n    assert scope['type'] == 'http'\n\n    await send({\n        'type': 'http.response.start',\n        'status': 200,\n        'headers': [\n            (b'content-type', b'text/plain'),\n        ],\n    })\n    await send({\n        'type': 'http.response.body',\n        'body': b'Hello, world!',\n    })\n\n# Run the server:\n# $ uvicorn example:app"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Uvicorn",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/Kludex",
        "30 GitHub sponsors"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "fastapi: ASGI web framework",
        "pydantic: data validation",
        "python-dotenv: .env loading for --env-file",
        "requests: HTTP client",
        "python-multipart: multipart form parsing",
        "numpy: numerical arrays"
       ]
      },
      {
       "title": "More in HTTP servers and APIs",
       "path": "tools/http-servers/",
       "items": [
        {
         "text": "FastAPI",
         "path": "tools/fastapi/"
        },
        {
         "text": "Express",
         "path": "tools/express/"
        },
        {
         "text": "cors",
         "path": "tools/cors/"
        },
        {
         "text": "python-multipart",
         "path": "tools/python-multipart/"
        },
        {
         "text": "Hono",
         "path": "tools/hono/"
        },
        {
         "text": "Flask",
         "path": "tools/flask/"
        },
        {
         "text": "Starlette",
         "path": "tools/starlette/"
        },
        {
         "text": "express-rate-limit",
         "path": "tools/express-rate-limit/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Uvicorn",
       "me": true,
       "facts": [
        "BSD-3-Clause",
        "Gid 82",
        "167M/wk"
       ]
      },
      {
       "name": "Hypercorn",
       "why": "Pick Hypercorn when you need HTTP/3 or the trio async library; Uvicorn's docs list it as an alternative ASGI server.",
       "path": "tools/hypercorn/",
       "facts": []
      },
      {
       "name": "Granian",
       "why": "Pick Granian for a server written in Rust that runs ASGI apps with HTTP/2, TLS and WebSockets.",
       "path": "tools/granian/",
       "facts": []
      },
      {
       "name": "Gunicorn",
       "why": "Pick Gunicorn for classic sync apps (Flask, Django without async) or as a process manager in front of Uvicorn workers.",
       "path": "tools/gunicorn/",
       "facts": []
      },
      {
       "name": "Daphne",
       "why": "Pick Daphne when your project uses Django Channels, the setup it was first built for.",
       "path": "tools/daphne/",
       "facts": []
      },
      {
       "name": "Tornado",
       "why": "High-performance Python web framework and async networking library for building servers.",
       "path": "tools/tornado/",
       "facts": [
        "Apache-2.0",
        "Gid 76",
        "29.1M/wk"
       ]
      }
     ],
     "more": "Compare Uvicorn with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Run this FastAPI app with Uvicorn (pin uvicorn[standard]==0.54.0, Python 3.10+) — use `uvicorn main:app --reload` locally and `uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4` in the Docker image, never both flags together."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Install Uvicorn in your project. The standard extra adds faster parts, file watching for --reload and .env support.",
       "code": "pip install 'uvicorn[standard]'",
       "src": "https://uvicorn.dev/installation/"
      },
      {
       "text": "Write or generate an app in main.py (FastAPI, Starlette, or plain ASGI), then run it.",
       "code": "uvicorn main:app",
       "src": "https://uvicorn.dev/"
      },
      {
       "text": "For production, run several workers and keep the server behind a proxy such as Nginx.",
       "code": "uvicorn main:app --workers 4",
       "src": "https://uvicorn.dev/deployment/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Uvicorn\n- Install `uvicorn[standard]` when you want `uvloop`, `httptools`, `websockets`, `watchfiles` for `--reload`, and `python-dotenv` for `--env-file`. A plain `uvicorn` install is pure Python only.\n- Point the CLI at `module:attribute` (for example `uvicorn main:app`). Add `--factory` when the target is a zero-argument function that returns the ASGI app.\n- Inside code that already runs an event loop, use `uvicorn.Config` plus `await uvicorn.Server(config).serve()`, not `uvicorn.run()`.\n- For Gunicorn deployments, install the `uvicorn-worker` package. The `uvicorn.workers` module is deprecated and will be removed.\n- Treat HTTP/2 as experimental. It needs `zttp` and `--http zttp --http2`. Do not rely on h2c upgrade or WebSockets over HTTP/2.\n- To use `wsproto` instead of `websockets`, add `wsproto` to dependencies explicitly. Passing a `.yaml` file to `--log-config` requires PyYAML.\n"
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "uvicorn.run(app, reload=True) or uvicorn.run(app, workers=4) with the app object",
       "fix": "Pass an import string, uvicorn.run(\"main:app\", reload=True), inside if __name__ == \"__main__\"",
       "why": "In our run with 0.54.0 it printed \"You must pass the application as an import string to enable 'reload' or 'workers'.\" and exited with code 3."
      },
      {
       "dont": "uvicorn main:app --reload --workers 4",
       "fix": "--reload on your computer, --workers N on the server, never both",
       "why": "The two options cannot be combined."
      },
      {
       "dont": "uvicorn main:app inside a Docker container, then wondering why the port does not answer",
       "fix": "uvicorn main:app --host 0.0.0.0 --port 8000",
       "why": "The default host is 127.0.0.1, which is reachable only from inside the container."
      },
      {
       "dont": "gunicorn -k uvicorn.workers.UvicornWorker in new projects",
       "fix": "pip install uvicorn-worker and use its worker class, or use uvicorn --workers N",
       "why": "The worker module inside Uvicorn is deprecated and will be removed."
      },
      {
       "dont": "--forwarded-allow-ips '*' on a server that is reachable directly from the internet",
       "fix": "List only your proxy's address in --forwarded-allow-ips",
       "why": "With '*' anyone can fake the visitor address and the http/https scheme through headers."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Do I need Uvicorn for FastAPI?",
       "a": "FastAPI needs some ASGI server to run, and Uvicorn is one of them; Daphne and Hypercorn also run any ASGI framework.",
       "evidence": {
        "url": "https://uvicorn.dev/concepts/asgi/",
        "quote": "You can use Uvicorn, Daphne, or Hypercorn to run any ASGI framework."
       }
      },
      {
       "q": "Can I use --reload and --workers together?",
       "a": "No. Use --reload on your computer while coding and --workers on the server.",
       "evidence": {
        "url": "https://uvicorn.dev/settings/",
        "quote": "The --reload and --workers arguments are mutually exclusive. You cannot use both at the same time."
       }
      },
      {
       "q": "Should I still run it under Gunicorn?",
       "a": "You can, but the built-in uvicorn.workers module is deprecated; install the separate uvicorn-worker package for that setup, or use Uvicorn's own --workers.",
       "evidence": {
        "url": "https://uvicorn.dev/",
        "quote": "You should use the uvicorn-worker package instead."
       }
      },
      {
       "q": "What does the standard extra add?",
       "a": "The faster uvloop event loop and httptools parser, websockets, watchfiles for --reload, python-dotenv for --env-file and PyYAML for log configs.",
       "evidence": {
        "url": "https://uvicorn.dev/installation/",
        "quote": "When uvloop is installed, Uvicorn will use it by default."
       }
      },
      {
       "q": "Does it see the real visitor's address behind a proxy?",
       "a": "Only if the proxy sends forwarded headers and its address is trusted; by default only 127.0.0.1 and ::1 are trusted.",
       "evidence": {
        "url": "https://uvicorn.dev/settings/",
        "quote": "Otherwise, 127.0.0.1 and ::1 are trusted."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "pypi uvicorn"
  ],
  [
   "Category",
   "HTTP servers and APIs"
  ],
  [
   "License",
   "BSD-3-Clause"
  ],
  [
   "Latest version",
   "0.54.0, September 25, 2026"
  ],
  [
   "On GitHub since",
   "May 2017"
  ],
  [
   "Gid Score",
   "81.8"
  ],
  [
   "Rank in category",
   "#1 of 102"
  ],
  [
   "GitHub",
   "Kludex/uvicorn"
  ],
  [
   "Last change",
   "Nov 22, 2026"
  ]
 ],
 "good": [
  "It needs Python 3.10 or newer; version 0.40.0 dropped Python 3.9.",
  "By default it listens only on your own computer (127.0.0.1); on a server or in a container you set the host to 0.0.0.0.",
  "HTTP/2 support is still marked experimental in version 0.54.0."
 ],
 "checked_line": "Read by AgentGid from 10 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/kludex.png"
}