--- id: litestar version: "2.24.0" license: MIT license_treatment: permissive maintenance: active --- # litestar — Litestar - A production-ready, highly performant, extensible ASGI API Framework License: permissive · Maintenance: active · Downloads: 2.0M/mo ## What it is and what it does Litestar is a production-ready ASGI framework designed specifically for building REST APIs. It provides structured tooling for common API concerns: automatic request/response validation using type hints, dependency injection for managing request-scoped and application-scoped resources, middleware support, and automatic OpenAPI 3.1 schema generation. The framework supports both function-based and class-based route handlers, integrates with SQLAlchemy for ORM use, and includes a plugin system for extending serialization and other behaviors. The framework emphasizes strict typing—it requires type annotations on route handlers and uses them to drive validation, serialization, and documentation. It bundles msgspec for fast data parsing and supports multiple data model formats (dataclasses, TypedDict, Pydantic v1 and v2, attrs). Its 16 runtime dependencies include anyio for async compatibility, httpx for HTTP client support, and rich for CLI output. Installation is straightforward; the base package is pure Python, and an optional 'standard' extra adds uvicorn and the CLI. Use it for: - Build REST APIs with automatic request validation and OpenAPI documentation from Python type hints. - Create microservices with dependency injection and middleware layering for cross-cutting concerns. - Integrate SQLAlchemy models directly into route handlers for ORM-backed endpoints. - Generate interactive API documentation (Swagger, Redoc, RapiDoc, Scalar, Stoplight Elements) automatically. - Develop async-first applications using class-based controllers for organized route grouping. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Litestar is an ASGI framework for building REST APIs with built-in data validation, dependency injection, ORM integration, and OpenAPI schema generation. Yes. Litestar is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively under MIT. It is well-suited for developers building REST APIs who value strict typing, automatic validation, and built-in ORM support. The framework's opinionated design and rich feature set (dependency injection, middleware, OpenAPI generation) reduce boilerplate. Install it if you are building an ASGI API and want these conveniences; skip it if you prefer minimal frameworks or are not building REST APIs. ## Install pip install litestar uv add litestar poetry add litestar ## Installing litestar Before you install: Low install friction with a pure-wheel distribution. Active maintenance with recent releases; repository shows 8393 stars and current development activity. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects without licensing concerns. Quickstart: pip install litestar from litestar import Litestar, get @get("/") async def hello_world() -> dict[str, str]: return {"hello": "world"} app = Litestar(route_handlers=[hello_world]) Requires Python 3.8 or later; async/await syntax required for route handlers. Verify before relying: - Performance benchmarks against other ASGI frameworks to validate 'high-performance' claims. - Specific SQLAlchemy integration version compatibility and feature set. - Whether all 16 runtime dependencies are required or if some are optional extras. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags asgi api framework, rest api python, async web framework, data validation framework, dependency injection asgi, openapi schema generation, orm integration framework, rest-api, async-framework, openapi [View on SkillFed](https://skillfed.io/packages/litestar) · [View on PyPI](https://pypi.org/project/litestar/)