# Litestar Canonical Origin: https://litestar.dev/ ## LLM Resources - [Full Content](https://litestar.dev/llms-full.txt): Complete page content in markdown format. --- - **Page:** Litestar: The Modern Python ASGI Framework - **Source:** https://litestar.dev/ - **Description:** Build blazing fast APIs with automatic documentation, dependency injection, and type safety. Litestar makes complex web development simple and intuitive. [**New website & v3 **](https://litestar.dev/blog/new-website-and-v3) # **The Modern **Python
**ASGI Framework**
Built to scale Fast APIs with automatic OpenAPI documentation, dependency injection, type safety, and a lot of batteries included. Litestar makes designing complex web apps simpler [**Get started **](https://docs.litestar.dev/) [** View on Github **](https://github.com/litestar-org/litestar) ## **Focused on development experience** - **Modern batteries included** Comprehensive optional features available out-of-the-box - authentication, validation, ORM integration, caching, middleware, and more. Use what you need, when you need it. - **Strict & opinionated design** Thoughtful defaults and clear conventions guide you toward best practices, reducing decision fatigue and ensuring consistent, maintainable code. - **Hierarchical configuration** Layered configuration system allows easy modularization. Override settings at any level - application, controller, or route - for maximum flexibility. - **Powerful plugin system** Extend functionality seamlessly with official and community plugins. Build reusable components that integrate naturally with Litestar's architecture. [Explore documentation](https://docs.litestar.dev/) ## **Everything you need to build modern APIs** Litestar provides all the tools you need out of the box, with minimal configuration required. - **Data Validation And Parsing** Leverage the power of type hints to define how data should be validated, parsed and serialized. [Data Validation And Parsing](https://docs.litestar.dev/2/usage/dto/index.html) - **Open Ecosystem** Define schemas and models for validation with standard types such as dataclasses, libraries like Pydantic, msgspec, attr, or integrate your own. [Open Ecosystem](https://docs.litestar.dev/2/usage/applications.html) - **OpenAPI** Automatically generated OpenAPI schemas help to document APIs and integrate with the frontend via TypeScript schema generation. [OpenAPI](https://docs.litestar.dev/2/usage/openapi/index.html) - **Interactive API Documentation** Interactively explore your APIs through Swagger, Redoc or Stoplight Elements, powered by OpenAPI. [Interactive API Documentation](https://docs.litestar.dev/2/usage/openapi/ui_plugins.html) - **Middlewares** Handle rate-limiting, CORS, CSRF, compression, logging and many more common tasks with Litestar's built-in middlewares. [Middlewares](https://docs.litestar.dev/2/usage/middleware/builtin-middleware.html) - **Data Stores** Interfaces for various key/value stores that seamlessly integrate with your application and third party extensions. [Data Stores](https://docs.litestar.dev/2/usage/stores.html) - **ORM Integration** First-class SQLAlchemy support let's you use your models for validation and serialization directly, reducing code duplication. [ORM Integration](https://docs.litestar.dev/2/usage/databases/sqlalchemy/index.html) - **Dependency Injection** Powerful dependency injection on all application layers, aides in code decoupling and reduces repetition. [Dependency Injection](https://docs.litestar.dev/2/usage/dependency-injection.html) - **Caching** Response caching with minimal configuration and overhead to speed up response times. [Caching](https://docs.litestar.dev/2/usage/caching.html) - **WebSockets** Easy to use WebSockets integration, featuring high- and low-level APIs and support for automatic data validation and serialization. [WebSockets](https://docs.litestar.dev/2/usage/websockets.html) - **Authentication And Authorization** Session and JWT based authentication and utilities at your disposal to start building your authentication layer with ease. [Authentication And Authorization](https://docs.litestar.dev/2/usage/security/index.html) - **Explore Litestar now**[Start reading docs](https://docs.litestar.dev/) ## Extend Litestar with plugins Litestar has a rich module ecosystem, with both official and community-driven plugins. This accelerates development by providing ready-to-use solutions for common needs. [Explore all plugins](https://litestar.dev/plugins) ![Advanced Alchemy](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/advanced-alchemy.png) ### Advanced Alchemy Ready-to-go SQLAlchemy concoctions. [**702.9K**](https://pypi.org/project/advanced-alchemy) [**813**](https://github.com/litestar-org/advanced-alchemy) [Advanced Alchemy](https://litestar.dev/plugins/advanced-alchemy) ![Litestar AsyncPG](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-asyncpg.svg) ### Litestar AsyncPG Asyncpg plugin for Litestar [**2.1K**](https://pypi.org/project/litestar-asyncpg) [**15**](https://github.com/litestar-org/litestar-asyncpg) [Litestar AsyncPG](https://litestar.dev/plugins/litestar-asyncpg) ![Litestar Autowire](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-autowire.svg) ### Litestar Autowire Package-based route, listener, and task discovery for Litestar [**348**](https://pypi.org/project/litestar-autowire) [**3**](https://github.com/cofin/litestar-autowire) [Litestar Autowire](https://litestar.dev/plugins/litestar-autowire) ### Litestar Email Email plugin for Litestar [**2.5K**](https://pypi.org/project/litestar-email) [**16**](https://github.com/litestar-org/litestar-email) [Litestar Email](https://litestar.dev/plugins/litestar-email) ![Litestar Granian](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-granian.png) ### Litestar Granian Granian plugin for Litestar [**16.5K**](https://pypi.org/project/litestar-granian) [**44**](https://github.com/cofin/litestar-granian) [Litestar Granian](https://litestar.dev/plugins/litestar-granian) ![Litestar HTMX](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-htmx.svg) ### Litestar HTMX HTMX Integration for Litestar [**1.7M**](https://pypi.org/project/litestar-htmx) [**12**](https://github.com/litestar-org/litestar-htmx) [Litestar HTMX](https://litestar.dev/plugins/litestar-htmx) ![Litestar MCP](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-mcp.svg) ### Litestar MCP Litestar plugin for Model Context Protocol (MCP) integration [**6K**](https://pypi.org/project/litestar-mcp) [**13**](https://github.com/cofin/litestar-mcp) [Litestar MCP](https://litestar.dev/plugins/litestar-mcp) ![Litestar OracleDB](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-oracledb.svg) ### Litestar OracleDB Oracle DB plugin for Litestar [**15**](https://pypi.org/project/litestar-oracledb) [**4**](https://github.com/litestar-org/litestar-oracledb) [Litestar OracleDB](https://litestar.dev/plugins/litestar-oracledb) ![Litestar Queues](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-queues.svg) ### Litestar Queues Task queues, workers, schedules, and backend integrations for Litestar [**854**](https://pypi.org/project/litestar-queues) [**10**](https://github.com/cofin/litestar-queues) [Litestar Queues](https://litestar.dev/plugins/litestar-queues) ### Litestar SAQ Litestar integration for SAQ [**21.7K**](https://pypi.org/project/litestar-saq) [**35**](https://github.com/litestar-org/litestar-saq) [Litestar SAQ](https://litestar.dev/plugins/litestar-saq) ![Litestar Vite](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-vite.svg) ### Litestar Vite Vite plugin for Litestar [**16.9K**](https://pypi.org/project/litestar-vite) [**37**](https://github.com/litestar-org/litestar-vite) [Litestar Vite](https://litestar.dev/plugins/litestar-vite) ### SQLSpec SQL Experiments in Python [**10K**](https://pypi.org/project/sqlspec) [**105**](https://github.com/litestar-org/sqlspec) [SQLSpec](https://litestar.dev/plugins/sqlspec) ## **Unlock synergy, seamless integrations with Litestar** Explore Litestar seamless integrations with other tools and platforms, enhancing productivity and workflow efficiency. ### **Scalar** Scalar integration. [Card link](https://github.com/scalar/scalar) ### **RapiDoc** RapiDoc integration. [Card link](https://github.com/rapi-doc/RapiDoc) ### **ReDoc** ReDoc integration. [Card link](https://github.com/Redocly/redoc) ### **Spotlight Elements** Elements integration. [Card link](https://github.com/stoplightio/elements) ### **Swagger UI** Swagger UI integration. [Card link](https://github.com/swagger-api/swagger-ui) ### **YAML** YAML integration. [Card link](https://yaml.org/) ## **Work with any Python data model** Litestar supports all popular Python data modeling libraries out of the box. Choose your favorite or mix and match based on your needs. ### **Pydantic** The most popular data validation library for Python. [Card link](https://docs.pydantic.dev/) ### **Dataclasses** Python's built-in dataclasses with full support for serialization and validation. [Card link](https://docs.python.org/3/library/dataclasses.html) ### **Attrs** Python classes without boilerplate. Mature and battle-tested with excellent performance. [Card link](https://www.attrs.org/) ### **TypedDict** Type hints for dictionaries with specific key-value types and API responses. [Card link](https://docs.python.org/3/library/typing.html#typing.TypedDict) ### **Msgspec** Fast serialization and validation library with JSON and MessagePack support. [Card link](https://msgspec.dev/) ## **The developer's choice for simple and powerful APIs** Litestar was born from developers' need to boost productivity and platform performance. What began as a starlette based-solution is now a solid ASGI frameworks to build APIs that scale. **1.7M** Monthly downloads [Card link](https://pypi.org/project/litestar/) **8.5K** GitHub Stars [Card link](https://github.com/litestar-org/litestar) **Open source** Litestar is 100% powered by our passionate open source community. [Start contributing](https://github.com/litestar-org/litestar) [Card link](https://github.com/litestar-org/litestar) **300** Contributors [Card link](https://github.com/litestar-org/litestar/graphs/contributors) **2.1K** Members [Card link](https://discord.gg/litestar) ## **Sponsors** Litestar is made possible by contributors and sponsor, it will remain free and open source under the MIT License. [Become a sponsor](https://opencollective.com/litestar) - [![Description of image](https://litestar.dev/_ipx/s_40x40/sponsors/scalar.png)**Scalar**](https://scalar.com/) - [![Description of image](https://litestar.dev/_ipx/s_40x40/sponsors/telemetry_sports.jpg)**Telemetry Sports**](https://telemetrysports.com/) --- - **Page:** Litestar Blog - **Source:** https://litestar.dev/blog - **Description:** Read the latest news about Litestar ecosystem # **Litestar Blog** Read the latest news about Litestar ecosystem ![Announcing Litestar 3 image](https://litestar.dev/_og/s/props_eyJibG9nIjp7InRpdGxlIjoiQW5ub3VuY2luZyBMaXRlc3RhciAzIiwiY2F0ZWdvcnkiOiJBbm5vdW5jZW1lbnQifX0,k_blog-0,c_Blog,p_Ii9ibG9nIg.png) AnnouncementJul 26, 2026 ## **Announcing Litestar 3** Litestar 3 is afoot. Have a look at what awaits you ![Janek Nouvertné avatar](https://github.com/provinzkraut.png) **Janek Nouvertné** ![Introducing the New Litestar Website and the upcoming 3.0 release image](https://litestar.dev/_og/s/props_eyJibG9nIjp7InRpdGxlIjoiSW50cm9kdWNpbmcgdGhlIE5ldyBMaXRlc3RhciBXZWJzaXRlIGFuZCB0aGUgdXBjb21pbmcgMy4wIHJlbGVhc2UiLCJjYXRlZ29yeSI6IkFubm91bmNlbWVudCJ9fQ,k_blog-1,c_Blog,p_Ii9ibG9nIg.png) AnnouncementJul 25, 2026 ## **Introducing the New Litestar Website and the upcoming 3.0 release** We are proud to announce the launch of our new Litestar website, and some hints at the beta of Litestar 3.0. ![Julien Courtès avatar](https://github.com/Kumzy.png) **Julien Courtès** --- - **Page:** Introducing the New Litestar Website and the upcoming 3.0 release - **Source:** https://litestar.dev/blog/new-website-and-v3 - **Description:** We are proud to announce the launch of our new Litestar website, and some hints at the beta of Litestar 3.0. We are thrilled to announce the launch of our new website along a preview of the upcoming v3 version of Litestar. This major update is the result of years of hard work and dedication from our team, and we can't wait to share it with you! ## Website With the upcoming v3, we wanted to have a new website that would reflect evolution of the project and the ecosystem around the framework. ### Plugin Directory We wired a page to list all the plugins available for the Litestar framework. It includes official plugins maintained by the Litestar team as well as plugins developped by the community. #### Submit Your Plugin If you want to develop or register your plugin, you can have it listed there by submitting your plugin: 1. Fork the [litestar-org/plugin-registry](https://github.com/litestar-org/plugin-registry) repository 2. Add your plugin information following our submission guidelines 3. Create a pull request with your plugin details We will then merge our submission and you will be listed in the plugin page. ### Blog Section We decided to add a blog to share some exciting news about the litestar framework and the ecosystem. We will be posting release announcements and updates. ### Next improvements We have a ton of ideas for the website, not sure all the things we have in mind will make it one day, but here is a list of some of the things: - Deployment guide (how to deploy your Litestar application in production) - Tutorials (interactive tutorials to learn Litestar hands-on) - Starter templates (boilerplates to kickstart your projects or create a plugin) - Docker and containerization best practices - Performance optimization tips This section will help you take your Litestar applications from development to production with confidence. ## Litestar v3 Litestar 3 is on its way! Read all about what's coming in the [Litestar 3 announcement](/blog/v3-announcement). ### New documentation We have revamped the documentation for the v3 release, making it more comprehensive and easier to navigate. But writing good documentation is hard and takes a lot of time, so we are still working on it and we will keep improving it as we get closer to the release. Do not hesitate to check it out and give us feedback on how we can improve it, or even better, contribute to it if you want to help us! ## EuroPython 2026 We will be attending [EuroPython 2026](https://ep2026.europython.eu/) in Kraków in July. This is a great opportunity for us to connect with the community, share our progress on Litestar v3, and gather feedback. Cody and Julien gave a [talk](https://ep2026.europython.eu/session/designing-performant-apis-with-litestar) about how to design performant APIs with Litestar, make sure to check it out! Also Jacob gave also a [talk](https://ep2026.europython.eu/session/supercharging-litestar-extensibility-through-plugins) about supercharging litestar with plugins. ## Join our community The Litestar project lives because of our community. Here's how you can get involved: ### Connect on Discord Join our vibrant [Discord community](https://discord.gg/litestar) where you can: - Get help with your projects - Share your creations - Discuss new features and ideas - Connect with other Litestar developers ### Contribute to the project Litestar is open source and welcomes contributors! Whether you're interested in: - **Code contributions**: Bug fixes, new features, performance improvements - **Documentation**: Writing guides, improving examples, fixing typos - **Community support**: Helping others on Discord and GitHub - **Plugin development**: Creating tools that extend Litestar's capabilities Every contribution makes a difference. Check out our [contribution guide](https://docs.litestar.dev/latest/contribution-guide) to get started. ### Talk about Litestar If you enjoy using Litestar, consider sharing your experience with others, you can: - Write blog posts or tutorials about your projects - Talk to others about your experience with Litestar ## Get started today If you want to try out Litestar, you can install it using pip or uv (or any package manager of your choice): ```bash pip install litestar # or uv add litestar ``` Visit our [documentation](https://docs.litestar.dev) for comprehensive guides, explore the [plugin directory](/plugins) for useful extensions, and join our [Discord community](https://discord.gg/litestar) to connect with fellow developers. We can't wait to see what you'll build with Litestar! --- - **Page:** About Litestar - **Source:** https://litestar.dev/about - **Description:** Learn about the Litestar organization, our community-driven approach, and the team of maintainers who make it all possible. # **About Litestar** Learn about the Litestar organization, our community-driven approach, and the team of maintainers who make it all possible. **6** Maintainers Card link **300** Contributors [Card link](https://github.com/litestar-org/litestar/graphs/contributors) **2.25.0** Version [Card link](https://github.com/litestar-org/litestar/releases) **MIT** License [Card link](https://github.com/litestar-org/litestar/blob/main/LICENSE) ## **Our Organization** Litestar is developed by volunteers and outside contributors, led by a dedicated team of Maintainers. Our community-driven project encourages user involvement and values every contribution. **Community-Driven** Developed by volunteers and outside contributors with an open, welcoming approach to all participants. **Every Contribution Welcome** We follow the All Contributors guidelines and appreciate every form of contribution, big or small. **Open Participation** Join our community through issues, discussions, pull requests, and code contributions. ## **Project History** Litestar has evolved significantly since its inception, originally starting as 'Starlite'. The rebranding to 'Litestar' in version 2.0 marked a new chapter, avoiding confusion with similar frameworks. January 2022 **Originally "Starlite"** The project began its journey under the name "Starlite", establishing itself as a powerful ASGI framework. October 2023 **Renamed to "Litestar" in v2.0** To avoid confusion with similar framework names, we rebranded to "Litestar" with version 2.0, marking a new chapter in our development. Q3-Q4 2026 **Litestar v3.0 Release** Major version release bringing enhanced performance, new features, and improved developer experience to the framework. ## **Meet Our Maintainers and Members** Litestar is developed by a dedicated team of maintainers and contributors who ensure the project's success. ![Andrew Truong](https://github.com/adhtruong.png) ### **Andrew Truong** Maintainer [** GitHub **](https://github.com/adhtruong) ![Cody Fincher](https://github.com/cofin.png) ### **Cody Fincher** Maintainer [** GitHub **](https://github.com/cofin) ![Jacob Coffee](https://github.com/JacobCoffee.png) ### **Jacob Coffee** Maintainer [** GitHub **](https://github.com/JacobCoffee) ![Julien Courtès](https://github.com/Kumzy.png) ### **Julien Courtès** Maintainer [** GitHub **](https://github.com/Kumzy) ![Peter Schutt](https://github.com/peterschutt.png) ### **Peter Schutt** Maintainer [** GitHub **](https://github.com/peterschutt) ![Janek Nouvertné](https://github.com/provinzkraut.png) ### **Janek Nouvertné** Maintainer [** GitHub **](https://github.com/provinzkraut) ![DanCardin](https://github.com/DanCardin.png) ### **DanCardin** Member [** GitHub **](https://github.com/DanCardin) ![euri10](https://github.com/euri10.png) ### **euri10** Member [** GitHub **](https://github.com/euri10) ![Harshal Laheri](https://github.com/Harshal6927.png) ### **Harshal Laheri** Member [** GitHub **](https://github.com/Harshal6927) ![Sobolevn](https://github.com/sobolevn.png) ### **Sobolevn** Member [** GitHub **](https://github.com/sobolevn) ![Winston H.](https://github.com/winstxnhdw.png) ### **Winston H.** Member [** GitHub **](https://github.com/winstxnhdw) Litestar was made possible by all the contributors that participated in the project over time. Thank you! [**All contributors**](https://github.com/litestar-org/litestar/graphs/contributors) ## **Ways to Contribute** Litestar welcomes contributors from all backgrounds and skill levels. Join our growing community to help by answering questions, improving documentation, joining discussions, or contributing to development. **Opening Issues** Report bugs, request features, or ask questions to help improve the project. [Opening Issues](https://github.com/litestar-org/litestar/issues/new) **Participating in Discussions** Share ideas, help others, and engage with the community in our discussions. [Participating in Discussions](https://github.com/litestar-org/litestar/discussions) **Reviewing Pull Requests** Help review code changes and provide feedback to maintain high quality. [Reviewing Pull Requests](https://github.com/litestar-org/litestar/pulls) **Contributing Code** Submit bug fixes, new features, or improvements to the codebase. [Contributing Code](https://github.com/litestar-org/litestar/blob/main/CONTRIBUTING.md) **Contributing Documentation** Improve the documentation or fix errors. [Contributing Documentation](https://github.com/litestar-org/litestar/blob/main/CONTRIBUTING.md) ### **Get Involved ** Every contribution is welcome and appreciated! Join our community and help make Litestar even better. [**Contribute on GitHub **](https://github.com/litestar-org/litestar) [** Join Discord **](https://discord.gg/litestar) --- - **Page:** SQLSpec · Litestar Plugins - **Source:** https://litestar.dev/plugins/sqlspec - **Description:** SQL Experiments in Python # SQLSpec SQL Experiments in Python [**10K downloads**](https://pypistats.org/packages/sqlspec)• [**105 stars**](https://github.com/litestar-org/sqlspec)• [**v0.67.0**](https://github.com/litestar-org/sqlspec/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) **Type-safe SQL execution for Python, without an ORM.** [![PyPI](https://img.shields.io/pypi/v/sqlspec)](https://pypi.org/project/sqlspec/) [![Python](https://img.shields.io/pypi/pyversions/sqlspec)](https://pypi.org/project/sqlspec/) [![License](https://img.shields.io/pypi/l/sqlspec)](https://github.com/litestar-org/sqlspec/blob/main/LICENSE) [![Docs](https://img.shields.io/badge/docs-sqlspec.dev-blue)](https://sqlspec.dev/) SQLSpec is a SQL execution layer for Python. You write the SQL -- as strings, through a builder API, or loaded from files. SQLSpec handles connections, parameter binding, and dialect translation. It maps results back to typed Python objects. It uses [sqlglot](https://github.com/tobymao/sqlglot) under the hood. Queries are parsed, validated, and optimized before they hit the database. | **Area** | **Support** | | --- | --- | | **One API** | The same session and result APIs with sync or async drivers. | | **Databases** | PostgreSQL, SQLite, DuckDB, MySQL, SQL Server, Oracle, CockroachDB, BigQuery, Spanner, and supported Arrow Database Connectivity backends such as Snowflake, Flight SQL, and GizmoSQL. | | **Data tools** | Typed result mapping, Arrow export, built-in storage, and native bulk ingest where the adapter supports it. | | **Frameworks** | Litestar, FastAPI, Flask, Sanic, and Starlette. | ## Quick Start ``` uv add sqlspec # or pip install sqlspec ``` ``` from dataclasses import dataclass from sqlspec import SQLSpec from sqlspec.adapters.sqlite import SqliteConfig @dataclass class Greeting: message: str spec = SQLSpec() db = spec.add_config(SqliteConfig(connection_config={"database": ":memory:"})) with spec.provide_session(db) as session: greeting = session.select_one("SELECT 'Hello, SQLSpec!' AS message", schema_type=Greeting) print(greeting.message) ``` Write SQL, define a schema, get typed objects back. The [getting started guide](https://sqlspec.dev/getting_started/) covers adapter installation and the query builder. ## Features - **Session lifecycle** -- sync and async sessions with pooling where the adapter supports it - **Parameter binding and dialect translation** -- powered by sqlglot, with a fluent query builder and `**.sql**` file loader - **Result mapping** -- map rows to Pydantic, msgspec, attrs, or dataclass models, or export to Arrow tables for pandas and Polars - **Storage layer** -- read and write Arrow tables to local files, fsspec, or object stores - **Framework integrations** -- Litestar plugin with DI, Starlette/FastAPI/Sanic middleware, Flask extension - **Google ADK** -- SQLSpec-backed session, event, memory, and artifact services - **Observability** -- OpenTelemetry and Prometheus instrumentation, structured logging with correlation IDs - **Event channels** -- LISTEN/NOTIFY, Oracle AQ/TxEventQ, and durable table-backed queues with polling fallback - **Migrations** -- native schema migration CLI backed by SQLSpec's SQL file loader ## Documentation - [Getting Started](https://sqlspec.dev/getting_started/) -- installation, adapter selection, first steps - [Usage Guides](https://sqlspec.dev/usage/) -- adapters, configuration, SQL file loader, and more - [Recipes](https://sqlspec.dev/recipes/) -- production patterns (DI, service layers, multi-tenancy) - [API Reference](https://sqlspec.dev/reference/) -- full API docs - [CLI Reference](https://sqlspec.dev/usage/cli.html) -- migration and management commands ## Playground Want to try it without installing anything? The [interactive playground](https://sqlspec.dev/playground) runs SQLSpec in your browser with a sandboxed Python runtime. ## Reference Applications - **[PostgreSQL + Vertex AI Demo](https://github.com/cofin/postgres-vertexai-demo)** -- Vector search with pgvector and real-time chat using Litestar and Google ADK. Shows connection pooling, migrations, type-safe result mapping, vector embeddings, and response caching. - **[Oracle + Vertex AI Demo](https://github.com/cofin/oracledb-vertexai-demo)** -- Oracle 23ai vector search with semantic similarity using HNSW indexes. Demonstrates NumPy array conversion, large object handling, and real-time performance metrics. ## Contributing Contributions are welcome -- whether that's bug reports, new adapter ideas, or pull requests. Take a look at the [contributor guide](https://sqlspec.dev/contributing/) to get started. ## License MIT --- - **Page:** Advanced Alchemy · Litestar Plugins - **Source:** https://litestar.dev/plugins/advanced-alchemy - **Description:** Ready-to-go SQLAlchemy concoctions. # ![Advanced Alchemy](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/advanced-alchemy.png) Advanced Alchemy Ready-to-go SQLAlchemy concoctions. [**702.9K downloads**](https://pypistats.org/packages/advanced-alchemy)• [**813 stars**](https://github.com/litestar-org/advanced-alchemy)• [**v1.12.0**](https://github.com/litestar-org/advanced-alchemy/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) ![Advanced Alchemy Logo](https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/AA%20-%20Banner%20-%20Inline%20-%20Light.svg) | **Project** | **Status** | | --- | --- | | CI/CD | [![Latest Release](https://github.com/litestar-org/advanced-alchemy/actions/workflows/publish.yml/badge.svg)](https://github.com/litestar-org/advanced-alchemy/actions/workflows/publish.yml) [![ci](https://github.com/litestar-org/advanced-alchemy/actions/workflows/ci.yml/badge.svg)](https://github.com/litestar-org/advanced-alchemy/actions/workflows/ci.yml) [![Documentation Building](https://github.com/litestar-org/advanced-alchemy/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/litestar-org/advanced-alchemy/actions/workflows/docs.yml) | | Quality | [![Coverage](https://codecov.io/github/litestar-org/advanced-alchemy/graph/badge.svg?token=vKez4Pycrc)](https://codecov.io/github/litestar-org/advanced-alchemy) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_advanced-alchemy&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_advanced-alchemy) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_advanced-alchemy&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_advanced-alchemy) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_advanced-alchemy&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_advanced-alchemy) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_advanced-alchemy&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_advanced-alchemy) | | Package | [![PyPI - Version](https://img.shields.io/pypi/v/advanced-alchemy?labelColor=202235&color=edb641&logo=python&logoColor=edb641)](https://badge.fury.io/py/advanced-alchemy)![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/advanced-alchemy?labelColor=202235&color=edb641&logo=python&logoColor=edb641)![Advanced Alchemy PyPI - Downloads](https://img.shields.io/pypi/dm/advanced-alchemy?logo=python&label=package%20downloads&labelColor=202235&color=edb641&logoColor=edb641) | | Community | [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) | | Meta | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Advanced%20Alchemy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/advanced-alchemy) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) | Check out the [project documentation](https://advanced-alchemy.litestar.dev) 📚 for more information. ## About A carefully crafted, thoroughly tested, optimized companion library for SQLAlchemy, offering: - Sync and async repositories, featuring common CRUD and highly optimized bulk operations - Integration with major web frameworks including Litestar, Starlette, FastAPI, Sanic - Custom-built alembic configuration and CLI with optional framework integration - Utility base classes with audit columns, primary keys and utility functions - [SQLModel](https://sqlmodel.tiangolo.com/) compatibility — use `**SQLModel**` `**table=True**` models directly with repositories and services - Composite primary key support — work with multi-column primary keys across repositories, services, and bulk operations - Read/write replica routing with automatic query routing, round-robin/random replica selection, and sticky-primary mode - Dogpile caching integration for query result caching - Built in `**File Object**` data type for storing objects: - Unified interface for various storage backends ([`**fsspec**`](https://filesystem-spec.readthedocs.io/en/latest/) and [`**obstore**`](https://developmentseed.org/obstore/latest/)) - Optional lifecycle event hooks integrated with SQLAlchemy's event system to automatically save and delete files as records are inserted, updated, or deleted. - Optimized JSON types including a custom JSON type for Oracle - Integrated support for UUID6 and UUID7 ([`**uuid-utils**`](https://github.com/aminalaee/uuid-utils) when installed, otherwise native in Python 3.14+, with UUID4 fallback on older versions). - Integrated support for Nano ID using [`**fastnanoid**`](https://github.com/oliverlambson/fastnanoid) (install with the `**nanoid**` extra) - Custom encrypted text type with multiple backend support including [`**pgcrypto**`](https://www.postgresql.org/docs/current/pgcrypto.html) for PostgreSQL and the Fernet implementation from [`**cryptography**`](https://cryptography.io/en/latest/) for other databases - Custom password hashing type with multiple backend support including [`**Argon2**`](https://github.com/P-H-C/phc-winner-argon2), [`**Passlib**`](https://passlib.readthedocs.io/en/stable/), and [`**Pwdlib**`](https://pwdlib.readthedocs.io/en/stable/) with automatic salt generation and rehash-on-verify for transparent hash upgrades on login - Custom TOTP shared-secret type that stores an authenticator seed encrypted at rest and verifies time-based one-time passwords via [`**pyotp**`](https://github.com/pyauth/pyotp) (install with the `**pyotp**` extra) - Custom one-time-code type that stores email/SMS verification codes hashed in JSON with built-in expiry, single-use redemption, attempt lockout, and a secure code generator - Pre-configured base classes with audit columns UUID or Big Integer primary keys and a [sentinel column](https://docs.sqlalchemy.org/en/20/core/connections.html#configuring-sentinel-columns). - Synchronous and asynchronous repositories featuring: - Common CRUD operations for SQLAlchemy models - Bulk inserts, updates, upserts, and deletes with dialect-specific enhancements - Integrated counts, pagination, sorting, filtering with `**LIKE**`, `**IN**`, `**IS NULL**`/ `**IS NOT NULL**`, and dates before and/or after. - Tested support for multiple database backends including: - SQLite via [aiosqlite](https://aiosqlite.omnilib.dev/en/stable/) or [sqlite](https://docs.python.org/3/library/sqlite3.html) - Postgres via [asyncpg](https://magicstack.github.io/asyncpg/current/) or [psycopg3 (async or sync)](https://www.psycopg.org/psycopg3/) - MySQL via [asyncmy](https://github.com/long2ice/asyncmy) - Oracle via [oracledb (async or sync)](https://oracle.github.io/python-oracledb/) (tested on 18c and 23c) - Google Spanner via [spanner-sqlalchemy](https://github.com/googleapis/python-spanner-sqlalchemy/) - DuckDB via [duckdb\_engine](https://github.com/Mause/duckdb_engine) - Microsoft SQL Server via [pyodbc](https://github.com/mkleehammer/pyodbc) or [aioodbc](https://github.com/aio-libs/aioodbc) - CockroachDB via [sqlalchemy-cockroachdb (async or sync)](https://github.com/cockroachdb/sqlalchemy-cockroachdb) - ...and much more ## Usage ### Installation ``` pip install advanced-alchemy ``` > !IMPORTANT > Check out [the installation guide](https://advanced-alchemy.litestar.dev/latest/#installation) in our official documentation! ### Repositories Advanced Alchemy includes a set of asynchronous and synchronous repository classes for easy CRUD operations on your SQLAlchemy models.
Click to expand the example ``` from advanced_alchemy import base, repository, config from sqlalchemy import create_engine from sqlalchemy.orm import Mapped, sessionmaker class User(base.UUIDBase): # you can optionally override the generated table name by manually setting it. __tablename__ = "user_account" # type: ignore[assignment] email: Mapped[str] name: Mapped[str] class UserRepository(repository.SQLAlchemySyncRepository[User]): """User repository.""" model_type = User db = config.SQLAlchemySyncConfig(connection_string="duckdb:///:memory:", session_config=config.SyncSessionConfig(expire_on_commit=False)) # Initializes the database. with db.get_engine().begin() as conn: User.metadata.create_all(conn) with db.get_session() as db_session: repo = UserRepository(session=db_session) # 1) Create multiple users with `add_many` bulk_users = [ {"email": 'cody@litestar.dev', 'name': 'Cody'}, {"email": 'janek@litestar.dev', 'name': 'Janek'}, {"email": 'peter@litestar.dev', 'name': 'Peter'}, {"email": 'jacob@litestar.dev', 'name': 'Jacob'} ] objs = repo.add_many([User(**raw_user) for raw_user in bulk_users]) db_session.commit() print(f"Created {len(objs)} new objects.") # 2) Select paginated data and total row count. Pass additional filters as kwargs created_objs, total_objs = repo.get_many_and_count(LimitOffset(limit=10, offset=0), name="Cody") print(f"Selected {len(created_objs)} records out of a total of {total_objs}.") # 3) Let's remove the batch of records selected. deleted_objs = repo.delete_many([new_obj.id for new_obj in created_objs]) print(f"Removed {len(deleted_objs)} records out of a total of {total_objs}.") # 4) Let's count the remaining rows remaining_count = repo.count() print(f"Found {remaining_count} remaining records after delete.") ```
For a full standalone example, see the sample [here](https://github.com/litestar-org/advanced-alchemy/blob/main/examples/standalone.py) ### Services Advanced Alchemy includes an additional service class to make working with a repository easier. This class is designed to accept data as a dictionary or SQLAlchemy model, and it will handle the type conversions for you.
Here's the same example from above but using a service to create the data: ``` from advanced_alchemy import base, repository, filters, service, config from sqlalchemy import create_engine from sqlalchemy.orm import Mapped, sessionmaker class User(base.UUIDBase): # you can optionally override the generated table name by manually setting it. __tablename__ = "user_account" # type: ignore[assignment] email: Mapped[str] name: Mapped[str] class UserService(service.SQLAlchemySyncRepositoryService[User]): """User repository.""" class Repo(repository.SQLAlchemySyncRepository[User]): """User repository.""" model_type = User repository_type = Repo db = config.SQLAlchemySyncConfig(connection_string="duckdb:///:memory:", session_config=config.SyncSessionConfig(expire_on_commit=False)) # Initializes the database. with db.get_engine().begin() as conn: User.metadata.create_all(conn) with db.get_session() as db_session: service = UserService(session=db_session) # 1) Create multiple users with `add_many` objs = service.create_many([ {"email": 'cody@litestar.dev', 'name': 'Cody'}, {"email": 'janek@litestar.dev', 'name': 'Janek'}, {"email": 'peter@litestar.dev', 'name': 'Peter'}, {"email": 'jacob@litestar.dev', 'name': 'Jacob'} ]) print(objs) print(f"Created {len(objs)} new objects.") # 2) Select paginated data and total row count. Pass additional filters as kwargs created_objs, total_objs = service.get_many_and_count(LimitOffset(limit=10, offset=0), name="Cody") print(f"Selected {len(created_objs)} records out of a total of {total_objs}.") # 3) Let's remove the batch of records selected. deleted_objs = service.delete_many([new_obj.id for new_obj in created_objs]) print(f"Removed {len(deleted_objs)} records out of a total of {total_objs}.") # 4) Let's count the remaining rows remaining_count = service.count() print(f"Found {remaining_count} remaining records after delete.") ```
### Web Frameworks Advanced Alchemy works with nearly all Python web frameworks. Several helpers for popular libraries are included, and additional PRs to support others are welcomed. #### Litestar Advanced Alchemy is the official SQLAlchemy integration for Litestar. In addition to installing with `**pip install advanced-alchemy**`, it can also be installed as a Litestar extra with `**pip install litestar[sqlalchemy]**`.
Litestar Example ``` from litestar import Litestar from litestar.plugins.sqlalchemy import SQLAlchemyPlugin, SQLAlchemyAsyncConfig # alternately... # from advanced_alchemy.extensions.litestar import SQLAlchemyAsyncConfig, SQLAlchemyPlugin alchemy = SQLAlchemyPlugin( config=SQLAlchemyAsyncConfig(connection_string="sqlite+aiosqlite:///test.sqlite"), ) app = Litestar(plugins=[alchemy]) ```
For a full Litestar example, check [here](https://github.com/litestar-org/advanced-alchemy/blob/main/examples/litestar/litestar_service.py) #### Flask
Flask Example ``` from flask import Flask from advanced_alchemy.extensions.flask import AdvancedAlchemy, SQLAlchemySyncConfig app = Flask(__name__) alchemy = AdvancedAlchemy( config=SQLAlchemySyncConfig(connection_string="duckdb:///:memory:"), app=app, ) ```
For a full Flask example, see [here](https://github.com/litestar-org/advanced-alchemy/blob/main/examples/flask/flask_services.py) #### FastAPI
FastAPI Example ``` from advanced_alchemy.extensions.fastapi import AdvancedAlchemy, SQLAlchemyAsyncConfig from fastapi import FastAPI app = FastAPI() alchemy = AdvancedAlchemy( config=SQLAlchemyAsyncConfig(connection_string="sqlite+aiosqlite:///test.sqlite"), app=app, ) ```
For a full FastAPI example with optional CLI integration, see [here](https://github.com/litestar-org/advanced-alchemy/blob/main/examples/fastapi/fastapi_service.py) #### Starlette
Pre-built Example Apps ``` from advanced_alchemy.extensions.starlette import AdvancedAlchemy, SQLAlchemyAsyncConfig from starlette.applications import Starlette app = Starlette() alchemy = AdvancedAlchemy( config=SQLAlchemyAsyncConfig(connection_string="sqlite+aiosqlite:///test.sqlite"), app=app, ) ```
#### Sanic
Pre-built Example Apps ``` from sanic import Sanic from sanic_ext import Extend from advanced_alchemy.extensions.sanic import AdvancedAlchemy, SQLAlchemyAsyncConfig app = Sanic("AlchemySanicApp") alchemy = AdvancedAlchemy( sqlalchemy_config=SQLAlchemyAsyncConfig(connection_string="sqlite+aiosqlite:///test.sqlite"), ) Extend.register(alchemy) ```
## Contributing All [Litestar Organization](https://github.com/litestar-org) projects will always be a community-centered, available for contributions of any size. Before contributing, please review the [contribution guide](https://advanced-alchemy.litestar.dev/latest/contribution-guide.html). If you have any questions, reach out to us on [Discord](https://discord.gg/litestar), our org-wide [GitHub discussions](https://github.com/orgs/litestar-org/discussions) page, or the [project-specific GitHub discussions page](https://github.com/litestar-org/advanced-alchemy/discussions). --- ![Litestar Organization Project](https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Organization%20Project%20-%20Banner%20-%20Inline%20-%20Light.svg) An official [Litestar Organization](https://github.com/litestar-org) Project --- - **Page:** Litestar AsyncPG · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-asyncpg - **Description:** Asyncpg plugin for Litestar # ![Litestar AsyncPG](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-asyncpg.svg) Litestar AsyncPG Asyncpg plugin for Litestar [**2.1K downloads**](https://pypistats.org/packages/litestar-asyncpg)• [**15 stars**](https://github.com/litestar-org/litestar-asyncpg)• [**v0.5.0**](https://github.com/litestar-org/litestar-asyncpg/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) ![Litestar AsyncPG Logo](https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/asyncPG%20-%20Banner%20-%20Inline%20-%20Light.svg) | **Project** | | **Status** | | --- | --- | --- | | CI/CD | | [![Latest Release](https://github.com/litestar-org/litestar-asyncpg/actions/workflows/publish.yml/badge.svg)](https://github.com/litestar-org/litestar-asyncpg/actions/workflows/publish.yml) [![ci](https://github.com/litestar-org/litestar-asyncpg/actions/workflows/ci.yml/badge.svg)](https://github.com/litestar-org/litestar-asyncpg/actions/workflows/ci.yml) [![Documentation Building](https://github.com/litestar-org/litestar-asyncpg/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/litestar-org/litestar-asyncpg/actions/workflows/docs.yml) | | Quality | | [![Coverage](https://codecov.io/github/litestar-org/litestar-asyncpg/graph/badge.svg?token=vKez4Pycrc)](https://codecov.io/github/litestar-org/litestar-asyncpg) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-asyncpg&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-asyncpg) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-asyncpg&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-asyncpg) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-asyncpg&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-asyncpg) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-asyncpg&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-asyncpg) | | Package | | [![PyPI - Version](https://img.shields.io/pypi/v/litestar-asyncpg?labelColor=202235&color=edb641&logo=python&logoColor=edb641)](https://badge.fury.io/py/litestar)![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641)![Advanced Alchemy PyPI - Downloads](https://img.shields.io/pypi/dm/litestar-asyncpg?logo=python&label=package%20downloads&labelColor=202235&color=edb641&logoColor=edb641) | | Community | | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev) | | Meta | | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Advanced%20Alchemy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/litestar-asyncpg) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![Litestar Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-%23edb641.svg?&logo=github&logoColor=edb641&labelColor=202235)](https://github.com/sponsors/litestar-org) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) [![code style - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json&labelColor=202235)](https://github.com/psf/black) | A barebones AsyncPG plugin for Litestar. This plugin is useful for when you plan to use no ORM or need to manage the postgres connection separately. ## Usage ### Installation ``` pip install litestar-asyncpg ``` ### Example Here is a basic application that demonstrates how to use the plugin. ``` from __future__ import annotations from typing import TYPE_CHECKING from litestar import Controller, Litestar, get from litestar_asyncpg import AsyncpgConfig, AsyncpgPlugin, PoolConfig if TYPE_CHECKING: from asyncpg import Connection class SampleController(Controller): @get(path="/sample") async def sample_route(self, db_connection: Connection) -> dict[str, str]: """Check database available and returns app config info.""" result = await db_connection.fetch("select 1") return {"select_1": str(result)} asyncpg = AsyncpgPlugin(config=AsyncpgConfig(pool_config=PoolConfig(dsn="postgresql://app:app@localhost:5432/app"))) app = Litestar(plugins=[asyncpg], route_handlers=[SampleController]) ``` --- - **Page:** Litestar Granian · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-granian - **Description:** Granian plugin for Litestar # ![Litestar Granian](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-granian.png) Litestar Granian Granian plugin for Litestar [**16.5K downloads**](https://pypistats.org/packages/litestar-granian)• [**44 stars**](https://github.com/cofin/litestar-granian)• [**v0.16.0**](https://github.com/cofin/litestar-granian/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) Run Litestar applications with Granian while preserving Litestar startup, shutdown, logging, and server integrations. ## Install ``` python -m pip install litestar-granian ``` ## Run your first app Save this as `**example.py**`: ``` from litestar import Litestar, get from litestar_granian import GranianPlugin @get("/") async def hello() -> dict[str, str]: return {"hello": "world"} app = Litestar(route_handlers=[hello], plugins=[GranianPlugin()]) ``` Start the server: ``` litestar --app example:app run ``` Open http://127.0.0.1:8000/ in a browser, or run: ``` curl http://127.0.0.1:8000/ ``` You should receive: ``` {"hello":"world"} ``` Press `**Ctrl+C**` in the server terminal to stop it. ## Why use this plugin? - Keep the familiar `**litestar run**` command while using Granian. - Start Litestar server integrations once around all Granian workers. - Configure workers, protocols, logging, metrics, and static files from one CLI. ## What the plugin changes `**GranianPlugin()**` replaces Litestar's standard `**run**` command with a Granian-backed command. It does not change commands that start another ASGI server directly. Run the complete command reference with: ``` litestar --app example:app run --help ```
Optional event loops The default installation uses Granian's standard loop selection and installs no optional event loop. Install and select one integration at a time: ``` python -m pip install "litestar-granian[uvloop]" litestar --app example:app run --loop uvloop ``` On supported platforms, use the matching **rloop** or **winloop** extra and pass **--loop rloop** or **--loop winloop**.
## Next steps - [Quickstart](https://github.com/cofin/litestar-granian/blob/main/docs/getting-started/quickstart.rst) — repeat the first run and learn what to check. - [Configuration](https://github.com/cofin/litestar-granian/blob/main/docs/guides/configuration.rst) — choose bindings, workers, protocols, TLS, reload, and event loops. - [Logging and metrics](https://github.com/cofin/litestar-granian/blob/main/docs/guides/logging-and-metrics.rst) — see how Granian automatically matches Litestar's formatter or accepts a complete override. - [Deployment](https://github.com/cofin/litestar-granian/blob/main/docs/guides/deployment.rst) — forward signals and verify clean shutdown. - [CLI reference](https://github.com/cofin/litestar-granian/blob/main/docs/reference/cli.rst) — browse every option and environment variable. ## License `**litestar-granian**` is distributed under the [MIT License](https://github.com/cofin/litestar-granian/blob/main/LICENSE). --- - **Page:** Litestar Autowire · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-autowire - **Description:** Package-based route, listener, and task discovery for Litestar # ![Litestar Autowire](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-autowire.svg) Litestar Autowire Package-based route, listener, and task discovery for Litestar [**348 downloads**](https://pypistats.org/packages/litestar-autowire)• [**3 stars**](https://github.com/cofin/litestar-autowire)• [**v0.2.0**](https://github.com/cofin/litestar-autowire/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) Domain package discovery for Litestar applications. `**litestar-autowire**` lets a Litestar app treat each feature or bounded context as a small Python package. Group the domain's controllers, listeners, and jobs together, then wire the domain root into the app once. Use it when your app has a `**domains/**` package and each domain owns its Litestar surface: ``` my_app/ domains/ accounts/ controllers.py events.py jobs.py billing/ controllers.py ``` ## Installation ``` pip install litestar-autowire ``` Optional integrations: ``` pip install "litestar-autowire[dishka]" pip install "litestar-autowire[queues]" ``` ## Quick Start Define normal Litestar controllers inside a domain package: ``` # my_app/domains/accounts/controllers.py from litestar import Controller, get class AccountController(Controller): path = "/accounts" @get("/", sync_to_thread=False) def list_accounts(self) -> dict[str, str]: return {"status": "ok"} ``` Register the domain root once: ``` from litestar import Litestar from litestar_autowire import AutowireConfig, AutowirePlugin app = Litestar( plugins=[ AutowirePlugin( AutowireConfig(domain_packages=["my_app.domains"]), ) ], ) ``` Autowire checks the configured domain package root and its direct child domain packages for these module names: - controllers: `**controllers**`, `**routes**`, `**controller**`, `**route**` - listeners: `**events**`, `**listeners**` - queue tasks: `**jobs**` By default, Autowire defers discovery logs to the Litestar startup lifespan. The summary includes the number of loaded controllers, domains, listeners, and tasks. Debug logs include the controller inventory grouped by domain. Set `**log_discovered=False**` to disable these logs. ## Integrations Built-in integrations use string aliases: ``` AutowireConfig( domain_packages=["my_app.domains"], integrations=["dishka", "queues"], ) ``` - `**dishka**`: wrap discovered controllers in Dishka's Litestar router. Configure Dishka separately with `**setup_dishka(...)**`. - `**queues**`: import task modules through `**litestar_queues.discover_tasks**`. Configure `**QueuePlugin**` separately in the Litestar app. Unknown string aliases raise `**ValueError**` so typos do not silently disable an integration. Use `**AutowireLoader**` when another registry needs each discovered domain module loaded: ``` from litestar_autowire import AutowireConfig, AutowireLoader config = AutowireConfig( domain_packages=["my_app.domains"], integrations=[ AutowireLoader( name="inventory_jobs", modules="jobs", loader="my_app.jobs:discover_jobs", ) ], ) ``` The loader receives existing module paths such as `**my_app.domains.accounts.jobs**`. Use the `**pkg.module:func**` form to make the module import and callable lookup explicit. If the loader returns an integer, Autowire adds it to the startup task count. For custom behavior, pass an integration object: ``` from litestar_autowire import AutowireConfig, AutowireContext class InventoryIntegration: name = "inventory" def on_autowire(self, context: AutowireContext) -> None: context.app_config.state["autowire_domain_packages"] = context.config.domain_packages config = AutowireConfig( domain_packages=["my_app.domains"], integrations=[InventoryIntegration()], ) ``` Custom integration names cannot reuse built-in names. ## Development ``` uv sync --all-extras --dev make lint make test make docs ``` --- - **Page:** Litestar HTMX · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-htmx - **Description:** HTMX Integration for Litestar # ![Litestar HTMX](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-htmx.svg) Litestar HTMX HTMX Integration for Litestar [**1.7M downloads**](https://pypistats.org/packages/litestar-htmx)• [**12 stars**](https://github.com/litestar-org/litestar-htmx)• [**v0.5.0**](https://github.com/litestar-org/litestar-htmx/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) ![Litestar HTMX Logo](https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Light.svg) See the [documentation](https://docs.litestar.dev/latest/usage/htmx.html) for usage details --- - **Page:** Litestar Email · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-email - **Description:** Email plugin for Litestar # Litestar Email Email plugin for Litestar [**2.5K downloads**](https://pypistats.org/packages/litestar-email)• [**16 stars**](https://github.com/litestar-org/litestar-email)• [**v0.4.0**](https://github.com/litestar-org/litestar-email/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) Email support for Litestar applications. This plugin provides a pluggable email backend system for sending transactional emails with support for multiple providers. ## Installation ``` pip install litestar-email ``` For production backends, install with the appropriate extra: ``` # SMTP backend pip install litestar-email[smtp] # Amazon SES backend (adds botocore for SigV4 signing) pip install litestar-email[ses] # aiohttp transport (alternative to httpx for API backends) pip install litestar-email[aiohttp] ``` > **Note**: API backends (Resend, SendGrid, Mailgun, SES) use `**httpx**` which is bundled with Litestar. No extra HTTP transport installation is needed. SES additionally requires the `**[ses]**` extra for AWS Signature Version 4 signing. ## Usage ``` from litestar import Litestar from litestar_email import EmailConfig, EmailPlugin # Development: console output config = EmailConfig( backend="console", from_email="noreply@example.com", from_name="My App", ) app = Litestar(plugins=[EmailPlugin(config=config)]) ``` For production, pass a backend config object directly: ``` from litestar_email import EmailConfig, EmailPlugin, SMTPConfig config = EmailConfig( backend=SMTPConfig(host="smtp.example.com", port=587, use_tls=True), from_email="noreply@example.com", ) app = Litestar(plugins=[EmailPlugin(config=config)]) ``` ### Sending Email ``` from litestar_email import EmailMessage message = EmailMessage( subject="Welcome!", body="Thanks for signing up.", to=["user@example.com"], ) async with config.provide_service() as mailer: await mailer.send_message(message) ``` If `**message.from_email**` is omitted, the service uses `**config.from_email**` and `**config.from_name**` as defaults. ### Dependency Injection The plugin registers a `**mailer**` dependency for handlers by default: ``` from litestar import get from litestar_email import EmailMessage, EmailService @get("/welcome/{email:str}") async def send_welcome(email: str, mailer: EmailService) -> dict[str, str]: message = EmailMessage( subject="Welcome!", body="Thanks for signing up.", to=[email], ) await mailer.send_message(message) return {"status": "sent"} ``` This works for both router handlers and controller methods the same way, since the dependency is registered on the app. If you need a service outside of Litestar (e.g., for a worker), use `**config.get_service()**` for a one-off instance or `**config.provide_service()**` for batch sending. ### Events and Listeners Event listeners in Litestar execute outside request context and cannot receive DI-injected dependencies. Pass the mailer explicitly: ``` from litestar import Litestar, get from litestar.events import listener from litestar_email import EmailConfig, EmailMessage, EmailPlugin, EmailService, SMTPConfig config = EmailConfig( backend=SMTPConfig(host="localhost", port=1025), from_email="noreply@example.com", from_name="My App", ) @get("/register/{email:str}") async def register(email: str, mailer: EmailService) -> dict[str, str]: # Pass the DI-injected mailer to the event request.app.emit("user.registered", email, mailer=mailer) return {"status": "queued"} @listener("user.registered") async def on_user_registered(email: str, mailer: EmailService) -> None: # mailer is passed explicitly from emit(), not injected via DI await mailer.send_message( EmailMessage(subject="Welcome!", body="Thanks for signing up.", to=[email]), ) app = Litestar( plugins=[EmailPlugin(config=config)], listeners=[on_user_registered], ) ``` You can override the dependency and state keys via `**EmailConfig**` if needed: `**email_service_dependency_key="email_service"**` and `**email_service_state_key="email_service"**`. ### Standalone (No Litestar) Use the config helpers directly without Litestar: ``` from litestar_email import EmailConfig, EmailMessage, SMTPConfig config = EmailConfig( backend=SMTPConfig(host="localhost", port=1025), from_email="noreply@example.com", ) message = EmailMessage( subject="Hello!", body="This is a standalone send.", to=["user@example.com"], ) async with config.provide_service() as mailer: await mailer.send_message(message) ``` For batch sends, use the context manager to reuse the connection: ``` async with config.provide_service() as mailer: await mailer.send_messages([message1, message2, message3]) ``` ### HTML Email ``` from litestar_email import EmailMultiAlternatives message = EmailMultiAlternatives( subject="Welcome!", body="Thanks for signing up.", # Plain text fallback html_body="

Welcome!

Thanks for signing up.

", to=["user@example.com"], ) ``` ## Available Backends | **Backend** | **Config Class** | **Use Case** | | --- | --- | --- | | `**console**` | - | Development (prints to stdout) | | `**memory**` | - | Testing (stores in memory) | | `**smtp**` | `**SMTPConfig**` | Production SMTP servers | | `**resend**` | `**ResendConfig**` | Resend HTTP API | | `**sendgrid**` | `**SendGridConfig**` | SendGrid HTTP API | | `**mailgun**` | `**MailgunConfig**` | Mailgun HTTP API | | `**ses**` | `**SESConfig**` | Amazon SES API v2 (SigV4-signed) | API backends (Resend, SendGrid, Mailgun, SES) support configurable HTTP transports: ``` from litestar_email import ResendConfig # Default: uses httpx (bundled with Litestar) config = ResendConfig(api_key="re_xxx...") # Alternative: use aiohttp config = ResendConfig(api_key="re_xxx...", http_transport="aiohttp") ``` ## Testing The `**InMemoryBackend**` is designed for testing: ``` from litestar_email.backends import InMemoryBackend def test_sends_welcome_email(): InMemoryBackend.clear() # ... code that sends email ... assert len(InMemoryBackend.outbox) == 1 assert InMemoryBackend.outbox[0].subject == "Welcome!" ``` If you need direct backend access in tests, use `**config.get_backend()**`: ``` from litestar_email import EmailConfig, EmailMessage config = EmailConfig(backend="memory") backend = config.get_backend() message = EmailMessage(subject="Hello", body="Body", to=["user@example.com"]) await backend.send_messages([message]) ``` ## Development ``` make install # Install dependencies make test # Run tests make lint # Run linting make check-all # Run all checks ``` ## License MIT --- - **Page:** Litestar Queues · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-queues - **Description:** Task queues, workers, schedules, and backend integrations for Litestar # ![Litestar Queues](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-queues.svg) Litestar Queues Task queues, workers, schedules, and backend integrations for Litestar [**854 downloads**](https://pypistats.org/packages/litestar-queues)• [**10 stars**](https://github.com/cofin/litestar-queues)• [**v0.12.0**](https://github.com/cofin/litestar-queues/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) [![PyPI](https://img.shields.io/pypi/v/litestar-queues)](https://pypi.org/project/litestar-queues/) [![Python](https://img.shields.io/pypi/pyversions/litestar-queues)](https://pypi.org/project/litestar-queues/) [![License](https://img.shields.io/pypi/l/litestar-queues)](https://github.com/cofin/litestar-queues/blob/main/LICENSE) [![CI](https://github.com/cofin/litestar-queues/actions/workflows/ci.yml/badge.svg)](https://github.com/cofin/litestar-queues/actions/workflows/ci.yml) [![Docs](https://img.shields.io/badge/docs-cofin.github.io-blue)](https://cofin.github.io/litestar-queues/) Litestar Queues lets a Litestar application persist work, run it in a worker, and inspect the result. Use it for work that should outlive the request that started it: sending email, importing files, refreshing reports, or calling a slow service. ## Quickstart Install the package: ``` pip install litestar-queues ``` Create `**app.py**`: ``` from litestar import Litestar, post from litestar.di import NamedDependency from litestar_queues import QueueConfig, QueuePlugin, QueueService, task @task("accounts.sync", queue="accounts", timeout=30) async def sync_account(account_id: str) -> dict[str, str]: return {"account_id": account_id, "status": "synced"} @post("/accounts/{account_id:str}/sync") async def create_sync_job( account_id: str, queue_service: NamedDependency[QueueService] ) -> dict[str, str]: result = await queue_service.enqueue(sync_account, account_id) return {"task_id": str(result.id), "status": result.status or "pending"} app = Litestar( route_handlers=[create_sync_job], plugins=[QueuePlugin(config=QueueConfig())], ) ``` Run the application: ``` LITESTAR_APP=app:app litestar run --reload ``` Enqueue a task: ``` curl -X POST http://127.0.0.1:8000/accounts/acct-123/sync ``` The response contains a task ID and an initial status: ``` {"task_id": "...", "status": "pending"} ``` By default, `**QueueConfig()**` starts a dedicated worker process alongside the server and uses an ephemeral SQLite database. The database is removed on normal shutdown and does not persist across restarts. ## Production boundary The default setup uses a temporary SQLite database and a local worker to get started quickly. In production, decouple task storage from execution: - **Storage**: Use Redis, Valkey, SQLSpec, or Advanced Alchemy so tasks persist across deploys and restarts. - **Workers**: Run standalone worker processes or Cloud Run jobs so background work scales independently from web requests. ## Next steps - [Start here](https://cofin.github.io/litestar-queues/getting_started/index.html) - [Understand the model](https://cofin.github.io/litestar-queues/usage/concepts.html) - [Follow a how-to guide](https://cofin.github.io/litestar-queues/usage/index.html) - [Choose backends](https://cofin.github.io/litestar-queues/usage/backends.html) - [Run an example](https://cofin.github.io/litestar-queues/examples/index.html) - [Browse the API reference](https://cofin.github.io/litestar-queues/reference/index.html) Litestar Queues supports Python 3.10 through 3.14 and is licensed under MIT. --- - **Page:** Litestar MCP · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-mcp - **Description:** Litestar plugin for Model Context Protocol (MCP) integration # ![Litestar MCP](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-mcp.svg) Litestar MCP Litestar plugin for Model Context Protocol (MCP) integration [**6K downloads**](https://pypistats.org/packages/litestar-mcp)• [**13 stars**](https://github.com/cofin/litestar-mcp)• [**v0.16.0**](https://github.com/cofin/litestar-mcp/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) A lightweight plugin that integrates Litestar web applications with the Model Context Protocol (MCP) by exposing marked routes as MCP tools, resources, and prompts over MCP Streamable HTTP and JSON-RPC. [![PyPI - Version](https://img.shields.io/pypi/v/litestar-mcp)](https://pypi.org/project/litestar-mcp/) [![Python Version](https://img.shields.io/pypi/pyversions/litestar-mcp)](https://pypi.org/project/litestar-mcp/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) ## Overview This plugin automatically discovers Litestar routes marked for MCP and exposes them through an MCP-native transport surface. Pass `**mcp_tool="name"**`, `**mcp_resource="name"**`, or `**mcp_prompt="name"**` straight through to `**@get**` / `**@post**` / etc. — Litestar funnels unknown kwargs into `**handler.opt**`, so no second decorator or `**opt={...}**` wrapper is needed. Standalone prompt callables that are not bound to an HTTP route can be registered through `**LitestarMCP(prompts=[...])**`. ## Features - **Protocol-Native Transport** — MCP Streamable HTTP with JSON-RPC requests and SSE streams. - **Three MCP Primitives** — tools, resources, *and* prompts, with `**prompts/list**` and `**prompts/get**` driven by the same handler discovery as the rest of the surface. - **Simple Route Marking** — pass `**mcp_tool**` / `**mcp_resource**` / `**mcp_prompt**` kwargs straight through to Litestar's route decorators, or register standalone prompts via `**LitestarMCP(prompts=[...])**`. - **RFC 6570 URI Templates** — `**mcp_resource_template="app://…/{var}"**` dispatches concrete URIs to handlers with extracted vars. - **First-Class Descriptions** — structured `**mcp_description**`, `**mcp_agent_instructions**`, `**mcp_when_to_use**`, `**mcp_returns**` kwargs. - **Type Safe** — full type hints with dataclasses; `**msgspec**`-powered tool-argument validation. - **Automatic Discovery** — routes are discovered at app initialization. - **OpenAPI Integration** — server info derived from OpenAPI config. - **Bring Your Own Auth** — MCP inherits the app's Litestar authentication middleware, including litestar-security or a custom `**AbstractAuthenticationMiddleware**`. - **Optional Task Support** — the MCP Tasks extension with Litestar Store records; applications coordinate execution across workers. - **Optional MCP Skills** — serve Agent Skills from static filesystem folders or dynamic, request-aware `**SkillSource**` backends through the `**io.modelcontextprotocol/skills**` extension with SHA-256 manifests. - **Optional A2A 1.0** — official SDK models and handlers on native Litestar JSON-RPC/SSE routes, without required Starlette, FastAPI or Uvicorn dependencies. ## Quick Start ### Installation ``` pip install litestar-mcp # or uv add litestar-mcp ``` ### Basic Usage ``` from litestar import Litestar, get, post from litestar.openapi.config import OpenAPIConfig from litestar_mcp import LitestarMCP # Mark routes for MCP exposure using the opt attribute @get("/users", mcp_tool="list_users") async def get_users() -> list[dict]: """List all users in the system.""" return [{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}] @post("/analyze", mcp_tool="analyze_data") async def analyze_data(data: dict) -> dict: """Analyze the provided data and return insights.""" return {"result": f"Analyzed {len(data)} items"} @get("/config", mcp_resource="app_config") async def get_app_config() -> dict: """Get the current application configuration.""" return {"debug": True, "version": "1.0.0"} # Add the MCP plugin to your Litestar app app = Litestar( route_handlers=[get_users, analyze_data, get_app_config], plugins=[LitestarMCP()], openapi_config=OpenAPIConfig(title="My API", version="1.0.0"), ) ``` ### Standalone Application (Alternative) If you are building a standalone MCP server, you can use the `**MCP**` class which provides a simplified declarative API and programmatically boots the server using the standard Litestar CLI: ``` from litestar_mcp import MCP # 1. Initialize the application mcp = MCP("my-mcp-server", instructions="Exposes utility tools.") # 2. Register tools, resources, or prompts using decorators @mcp.tool() def add(a: int, b: int) -> int: """Calculate the sum of two integers.""" return a + b # 3. Expose the app globally so that the CLI can discover it app = mcp.app if __name__ == "__main__": # 4. Boot the modern Streamable HTTP server mcp.run(transport="streamable-http", port=8000) ``` The standalone decorators accept Litestar route-handler keyword arguments such as `**dependencies**`, `**guards**`, `**response_headers**`, `**responses**`, `**summary**`, `**tags**`, DTO options, hooks, and arbitrary extra kwargs stored in `**handler.opt**`. The `**name**` keyword names the MCP primitive; use `**route_name**` to set Litestar's route-handler name separately. ### With Configuration ``` from litestar_mcp import LitestarMCP, MCPConfig config = MCPConfig( base_path="/api/mcp", # Change the base path name="Custom Server Name", # Override server name include_in_schema=True, # Include MCP routes in OpenAPI schema ) app = Litestar( route_handlers=[get_users, analyze_data, get_app_config], plugins=[LitestarMCP(config)], openapi_config=OpenAPIConfig(title="My API", version="1.0.0"), ) ``` ## Resources vs Tools: When to Use Each ### Use Resources (`**mcp_resource**`) for - **Read-only data** that AI models need to reference - **Static or semi-static information** like documentation, schemas, configurations - **Data that doesn't require parameters** to retrieve - **Reference material** that AI models should "know about" **Examples:** ``` @get("/schema", mcp_resource="database_schema") async def get_schema() -> dict: """Database schema information.""" return {"tables": ["users", "orders"], "relationships": [...]} @get("/docs", mcp_resource="api_docs") async def get_documentation() -> dict: """API documentation and usage examples.""" return {"endpoints": [...], "examples": [...]} ``` ### Use Tools (`**mcp_tool**`) for - **Actions that perform operations** or mutations - **Dynamic queries** that need input parameters - **Operations that change state** in your application - **Computations or data processing** tasks **Examples:** ``` @post("/users", mcp_tool="create_user") async def create_user(user_data: dict) -> dict: """Create a new user account.""" # Perform user creation logic return {"id": 123, "created": True} @get("/search", mcp_tool="search_data") async def search(query: str, limit: int = 10) -> dict: """Search through application data.""" # Perform search with parameters return {"results": [...], "total": 42} ``` ## How It Works 1. **Route Discovery**: At app initialization, the plugin scans all route handlers for the `**opt**` attribute 2. **Automatic Exposure**: Routes marked with `**mcp_tool**` or `**mcp_resource**` are automatically exposed 3. **MCP Transport**: The plugin adds a Streamable HTTP MCP endpoint under the configured base path (default `**/mcp**`) 4. **Server Info**: Server name and version are derived from your OpenAPI configuration ## MCP Endpoints Once configured, your application exposes these MCP-compatible endpoints: - `**POST /mcp**` - stateless MCP `**2026-07-28**` JSON-RPC and subscription streams - `**litestar --app my_app:app mcp stdio**` - in-process stdio for desktop clients - `**litestar mcp bridge**` - stdio proxy to a running Streamable HTTP server Install `**litestar-mcp[a2a]**` to mount an official A2A SDK request handler and agent card independently of MCP. The adapter accepts A2A 1.0 JSON-RPC requests with `**A2A-Version: 1.0**`; it rejects missing/legacy versions and offers no 0.3 conversion, gRPC or REST binding. Applications supply authentication, durable stores, executor resource scopes, worker coordination and push delivery policy. See the [A2A guide](https://cofin.github.io/litestar-mcp/latest/usage/a2a.html). Use `**server/discover**` instead of an initialize handshake: ``` curl -X POST http://127.0.0.1:8000/mcp \ -H 'Content-Type: application/json' \ -H 'MCP-Protocol-Version: 2026-07-28' \ -H 'Mcp-Method: server/discover' \ -d '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"curl","version":"1"}}}}' ``` Every request is independent. There are no protocol sessions, sticky-routing headers, GET/DELETE transport handlers, or SSE replay. MCP IDs must be strings or finite integer-valued numbers. Missing, null, boolean, container or fractional IDs fail before tool execution or stream allocation. Progress streams apply bounded backpressure; slow subscription consumers are completed and disconnected. Shared task Stores persist records but do not distribute task execution or local input/cancel queues. See the [0.14 migration guide](https://cofin.github.io/litestar-mcp/latest/usage/migration_0_14.html) for removed aliases and configuration. **Built-in Resources:** - `**litestar://openapi**` - Your application's OpenAPI schema (always available via `**resources/read**`) ## Configuration Configure the plugin using `**MCPConfig**`: ``` from litestar_mcp import MCPConfig config = MCPConfig() ``` **Configuration Options:** | **Option** | **Type** | **Default** | **Description** | | --- | --- | --- | --- | | `**base_path**` | `**str**` | `**"/mcp"**` | Base path for the MCP Streamable HTTP endpoint | | `**include_in_schema**` | `**bool**` | `**False**` | Whether to include MCP routes in OpenAPI schema | | `**name**` | `**str \| None**` | `**None**` | Override server name. If None, uses OpenAPI title | | `**instructions**` | `**str \| None**` | `**None**` | Server instructions returned to clients from `**server/discover**` | | `**guards**` | `**list[Any] \| None**` | `**None**` | Litestar guards applied to the MCP router | | `**route_opt**` | `**dict[str, Any] \| None**` | `**None**` | Route metadata merged onto the MCP handler, including litestar-security policies | | `**allowed_origins**` | `**list[str] \| None**` | `**None**` | Exact additional Origins; present Origins must be same-origin or allowlisted | | `**include_operations**` | `**list[str] \| None**` | `**None**` | Only expose matching operation names | | `**exclude_operations**` | `**list[str] \| None**` | `**None**` | Exclude matching operation names | | `**include_tags**` | `**list[str] \| None**` | `**None**` | Only expose routes with matching OpenAPI tags | | `**exclude_tags**` | `**list[str] \| None**` | `**None**` | Exclude routes with matching OpenAPI tags | | `**tasks**` | `**bool \| MCPTaskConfig**` | `**False**` | Enable the `**io.modelcontextprotocol/tasks**` extension | | `**skills**` | `**MCPSkillsConfig \| None**` | `**None**` | Serve Agent Skills over MCP from configured directories and/or dynamic `**SkillSource**` providers | | `**opt_keys**` | `**MCPOptKeys**` | `**MCPOptKeys()**` | Rename the `**handler.opt**` keys the plugin reads (`**mcp_tool**`, `**mcp_resource**`, ...) | | `**list_page_size**` | `**int**` | `**100**` | Page size for `**tools/list**`, `**resources/list**`, `**resources/templates/list**`, `**skills/list**`, `**prompts/list**`, and `**resources/directory/read**` | | `**cache_ttl_ms**` | `**int**` | `**0**` | Conservative cache lifetime for discovery/list/resource results | | `**cache_scope**` | `**"private" \| "public"**` | `**"private"**` | Cache sharing policy | | `**subscription_max_streams**` | `**int**` | `**10000**` | Maximum concurrent `**subscriptions/listen**` streams | | `**subscription_keepalive_seconds**` | `**float**` | `**15.0**` | Subscription keepalive interval | | `**subscription_channels**` | `**ChannelsPlugin \| None**` | `**None**` | Optional cross-worker notification fan-out | | `**stream_queue_capacity**` | `**int**` | `**256**` | Bounded subscription and request-progress queues | | `**stream_cleanup_timeout**` | `**float**` | `**5.0**` | Deadline for cooperative response cleanup; expiry is logged | | `**max_blob_bytes**` | `**int \| None**` | `**26214400**` | Maximum raw byte length for base64-embedded blobs; `**None**` disables the cap | | `**before_tool_call**` | `**BeforeToolCallHook \| None**` | `**None**` | Observe each `**tools/call**` before dispatch | | `**after_tool_call**` | `**AfterToolCallHook \| None**` | `**None**` | Observe each `**tools/call**` result, exception, and duration | ## Complete Example ``` from litestar import Litestar, get, post, delete from litestar.openapi.config import OpenAPIConfig from litestar_mcp import LitestarMCP, MCPConfig # Resources - read-only reference data @get("/users/schema", mcp_resource="user_schema") async def get_user_schema() -> dict: """User data model schema.""" return { "type": "object", "properties": { "id": {"type": "integer"}, "name": {"type": "string"}, "email": {"type": "string"} } } @get("/api/info", mcp_resource="api_info") async def get_api_info() -> dict: """API capabilities and information.""" return { "version": "2.0.0", "features": ["user_management", "data_analysis"], "rate_limits": {"requests_per_minute": 1000} } # Tools - actionable operations @get("/users", mcp_tool="list_users") async def list_users(limit: int = 10) -> dict: """List users with optional limit.""" # Fetch users from database return {"users": [{"id": 1, "name": "Alice"}], "total": 1} @post("/users", mcp_tool="create_user") async def create_user(user_data: dict) -> dict: """Create a new user account.""" # Create user logic return {"id": 123, "created": True, "user": user_data} @post("/analyze", mcp_tool="analyze_dataset") async def analyze_dataset(config: dict) -> dict: """Analyze data with custom configuration.""" # Analysis logic return {"insights": [...], "metrics": {...}} # Regular routes (not exposed to MCP) @get("/health") async def health_check() -> dict: return {"status": "healthy"} # MCP configuration mcp_config = MCPConfig( name="User Management API", base_path="/mcp" ) # Create Litestar app app = Litestar( route_handlers=[ get_user_schema, get_api_info, # Resources list_users, create_user, analyze_dataset, # Tools health_check # Regular route ], plugins=[LitestarMCP(mcp_config)], openapi_config=OpenAPIConfig( title="User Management API", version="2.0.0" ), ) ``` ## Authentication Authentication is a **Litestar middleware** concern. Apps with an existing auth middleware get MCP authentication for free — `**request.user**` and `**request.auth**` are populated before tool handlers run. Three integration paths: ### Path A — Bring Your Own Middleware If your Litestar app already ships an `**AbstractAuthenticationMiddleware**` (or Litestar's built-in JWT backends), MCP inherits it automatically: ``` from litestar import Litestar from litestar.middleware import DefineMiddleware from litestar_mcp import LitestarMCP, MCPConfig app = Litestar( route_handlers=[...], plugins=[LitestarMCP(MCPConfig())], middleware=[DefineMiddleware(YourAuthMiddleware)], # MCP gets this for free ) ``` See `**docs/examples/notes/sqlspec/google_iap.py**` for a runnable example. ### litestar-security Use litestar-security for policy evaluation and RFC 9728 protected-resource metadata. Pass route policy metadata with `**MCPConfig(route_opt={"auth": required("api-key")})**`; evaluator failures can emit the required `**WWW-Authenticate**` resource metadata. ### In-process stdio Run `**litestar --app my_app:app mcp stdio**` to serve the application in-process to a desktop MCP client. Use `**mcp bridge**` when the MCP server is already running over Streamable HTTP. Stdio uses native `**Litestar.lifespan()**`. Its `**shutdown_timeout**` bounds request cleanup and shutdown after startup completes; application hooks own bounded, cancellation-safe startup rollback. `**MCPStdioContext.session**` remains an application session. Provide a verified identity for protected tasks; anonymous stdio requests have no owner ID. ## Development ``` # Clone the repository git clone https://github.com/cofin/litestar-mcp.git cd litestar-mcp # Install with development dependencies make install # Run the complete Python quality gate make check-all # Run the pinned MCP 2026-07-28 conformance suite make conformance # Build strict documentation and validate examples make docs make validate-examples validate-uvx validate-pep723 # Run example uv run python docs/examples/hello_world/main.py ``` The conformance target owns Node.js `**24.18.1**` through `**NODE_VERSION**` in the Makefile. When [nodenv](https://github.com/nodenv/nodenv) is available, the target selects that version with `**NODENV_VERSION**`; otherwise it uses the active `**node**`/`**npm**` installation. A local `**.node-version**` is ignored so contributors can use nodenv without changing repository state. The conformance runner reports passed, waived and failed scenarios separately. Its pinned alpha validator has documented task-extension schema waivers in `**tools/ci/run_mcp_conformance.py**`; `**MCP_CONFORMANCE_STRICT=1**` disables those waivers. A waived check is not a protocol pass. ## License MIT License. See [LICENSE](https://github.com/cofin/litestar-mcp/blob/main/LICENSE) for details. ## Contributing Contributions welcome! Please see our [contribution guide](https://github.com/cofin/litestar-mcp/blob/main/docs/contribution-guide.rst) for details. --- - **Page:** Litestar OracleDB · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-oracledb - **Description:** Oracle DB plugin for Litestar # ![Litestar OracleDB](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-oracledb.svg) Litestar OracleDB Oracle DB plugin for Litestar [**15 downloads**](https://pypistats.org/packages/litestar-oracledb)• [**4 stars**](https://github.com/litestar-org/litestar-oracledb)• [**v0.2.0**](https://github.com/litestar-org/litestar-oracledb/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) ![Litestar Logo - Light](https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/oracledb%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only)![Litestar Logo - Dark](https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/oracledb%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only) | **Project** | | **Status** | | --- | --- | --- | | CI/CD | | [![Latest Release](https://github.com/litestar-org/litestar-oracledb/actions/workflows/publish.yml/badge.svg)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/publish.yml) [![ci](https://github.com/litestar-org/litestar-oracledb/actions/workflows/ci.yml/badge.svg)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/ci.yml) [![Documentation Building](https://github.com/litestar-org/litestar-oracledb/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/docs.yml) | | Quality | | [![Coverage](https://codecov.io/github/litestar-org/litestar-oracledb/graph/badge.svg?token=vKez4Pycrc)](https://codecov.io/github/litestar-org/litestar-oracledb) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) | | Package | | [![PyPI - Version](https://img.shields.io/pypi/v/litestar-oracledb?labelColor=202235&color=edb641&logo=python&logoColor=edb641)](https://badge.fury.io/py/litestar)![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641)![Litestar OracleDB PyPI - Downloads](https://img.shields.io/pypi/dm/litestar-oracledb?logo=python&label=package%20downloads&labelColor=202235&color=edb641&logoColor=edb641) | | Community | | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev) | | Meta | | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Advanced%20Alchemy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/litestar-oracledb) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![Litestar Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-%23edb641.svg?&logo=github&logoColor=edb641&labelColor=202235)](https://github.com/sponsors/litestar-org) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) [![code style - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json&labelColor=202235)](https://github.com/psf/black) | A barebones Oracle Database plugin for Litestar. This plugin is useful for when you plan to use no ORM or need to manage the Oracle connection separately. ## Usage ### Installation ``` pip install litestar-oracledb ``` ### Example Here is a basic application that demonstrates how to use the plugin. ``` from __future__ import annotations from typing import TYPE_CHECKING from litestar import Controller, Litestar, Request, get from litestar_oracledb import AsyncDatabaseConfig, AsyncPoolConfig, OracleDatabasePlugin if TYPE_CHECKING: from oracledb import AsyncConnection class SampleController(Controller): @get(path="/") async def sample_route(self, request: Request, db_connection: AsyncConnection) -> dict[str, str]: """Check database available and returns app config info.""" with db_connection.cursor() as cursor: await cursor.execute("select 'a database value' a_column from dual") result = await cursor.fetchone() request.logger.info(result[0]) if result: return {"a_column": result[0]} return {"a_column": "dunno"} oracledb = OracleDatabasePlugin( config=AsyncDatabaseConfig( pool_config=AsyncPoolConfig(user="system", password="super-secret", dsn="localhost:1513/FREEPDB1") # noqa: S106 ) ) app = Litestar(plugins=[oracledb], route_handlers=[SampleController]) ``` --- - **Page:** Litestar SAQ · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-saq - **Description:** Litestar integration for SAQ # Litestar SAQ Litestar integration for SAQ [**21.7K downloads**](https://pypistats.org/packages/litestar-saq)• [**35 stars**](https://github.com/litestar-org/litestar-saq)• [**v0.8.0**](https://github.com/litestar-org/litestar-saq/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) ## Installation ``` pip install litestar-saq ``` For OpenTelemetry support: ``` pip install litestar-saq[otel] ``` ## Usage Here is a basic application that demonstrates how to use the plugin. ``` from litestar import Litestar from litestar_saq import QueueConfig, SAQConfig, SAQPlugin saq = SAQPlugin( config=SAQConfig( use_server_lifespan=True, queue_configs=[ QueueConfig(name="samples", dsn="redis://localhost:6379/0") ], ) ) app = Litestar(plugins=[saq]) ``` You can start a background worker with the following command now: ``` litestar --app-dir=examples/ --app basic:app workers run Using Litestar app from env: 'basic:app' Starting SAQ Workers ────────────────────────────────────────────────────────────────── INFO - 2023-10-04 17:39:03,255 - saq - worker - Worker starting: Queue>>, name='samples'> INFO - 2023-10-04 17:39:06,545 - saq - worker - Worker shutting down ``` You can also start the process for only specific queues. This is helpful if you want separated processes working on different queues instead of combining them. ``` litestar --app-dir=examples/ --app basic:app workers run --queues sample Using Litestar app from env: 'basic:app' Starting SAQ Workers ────────────────────────────────────────────────────────────────── INFO - 2023-10-04 17:39:03,255 - saq - worker - Worker starting: Queue>>, name='samples'> INFO - 2023-10-04 17:39:06,545 - saq - worker - Worker shutting down ``` If you are starting the process for only specific queues and still want to read from the other queues or enqueue a task into another queue that was not initialized in your worker or is found somewhere else, you can do so like here ``` import os from saq import Queue def get_queue_directly(queue_name: str, redis_url: str) -> Queue: return Queue.from_url(redis_url, name=queue_name) redis_url = os.getenv("REDIS_URL") queue = get_queue_directly("queue-in-other-process", redis_url) # Get queue info info = await queue.info(jobs=True) # Enqueue new task await queue.enqueue("task_name", arg1="value1") ``` ## Monitored Jobs For long-running tasks, use the `**monitored_job**` decorator to automatically send heartbeats and prevent SAQ from marking jobs as stuck: ``` from litestar_saq import monitored_job @monitored_job() # Auto-calculates interval from job.heartbeat async def long_running_task(ctx): await process_large_dataset() return {"status": "complete"} @monitored_job(interval=30.0) # Explicit 30-second interval async def train_model(ctx, model_id: str): for epoch in range(100): await train_epoch(model) return {"model_id": model_id} ``` ## OpenTelemetry Integration litestar-saq supports optional OpenTelemetry instrumentation for distributed tracing. ### Configuration ``` from litestar_saq import SAQConfig, QueueConfig config = SAQConfig( queue_configs=[QueueConfig(dsn="redis://localhost:6379/0")], enable_otel=None, # Auto-detect (default) - enabled if OTEL installed AND Litestar OpenTelemetryPlugin is active # enable_otel=True, # Force enable (raises error if not installed) # enable_otel=False, # Force disable ) ``` When enabled, the plugin creates: - **CONSUMER spans** for job processing - **PRODUCER spans** for job enqueue operations - **Automatic context propagation** across process boundaries Spans follow [OpenTelemetry messaging semantic conventions](https://opentelemetry.io/docs/specs/semconv/messaging/) with `**messaging.system = "saq"**`. --- - **Page:** Litestar Vite · Litestar Plugins - **Source:** https://litestar.dev/plugins/litestar-vite - **Description:** Vite plugin for Litestar # ![Litestar Vite](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-vite.svg) Litestar Vite Vite plugin for Litestar [**16.9K downloads**](https://pypistats.org/packages/litestar-vite)• [**37 stars**](https://github.com/litestar-org/litestar-vite)• [**v0.32.0**](https://github.com/litestar-org/litestar-vite/releases) [![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin) Litestar Vite connects the Litestar backend to a Vite toolchain. It supports SPA, Template, Inertia, and meta-framework workflows, and it can proxy Vite dev traffic through your ASGI port or run Vite directly. ## Features - One-port dev: proxies Vite HTTP + WS/HMR through Litestar on a single ASGI port by default. - Framework-mode support: use `**mode="framework"**` (alias `**mode="ssr"**`) for Astro, Nuxt, and SvelteKit. Litestar proxies everything except your API routes. - Production assets: reads the Vite manifest from `**public/manifest.json**` (configurable) and serves under `**asset_url**`. - Type-safe frontends: optional OpenAPI/routes export plus `**@hey-api/openapi-ts**` via the Vite plugin. - Inertia support: Inertia v2/v3 protocol support with session middleware, script-element bootstrap by default, and optional SSR. ## Install ``` pip install litestar-vite npm install litestar-vite-plugin ``` ## Quick Start ``` from litestar import Litestar from litestar_vite import VitePlugin app = Litestar(plugins=[VitePlugin()]) ``` ``` litestar assets init --template vue litestar assets install litestar run --reload ``` `**VitePlugin()**` detects development and production behavior without manual `**VITE_DEV_MODE**` parsing. The effective `**litestar run --host/--port**` values are also passed to the frontend environment and `**.litestar.json**` bridge. ### Optional Granian native static serving Granian 0.16+ can serve eligible production bundle files before the request enters Python: ``` from litestar import Litestar from litestar_granian import GranianPlugin from litestar_vite import VitePlugin app = Litestar(plugins=[VitePlugin(), GranianPlugin(static="auto")]) ``` This is an optimization, not a separate application configuration. The Litestar static route stays registered, so Uvicorn and other ASGI servers serve the same files. Granian automatically falls back to Litestar when assets are protected, customized, missing, or otherwise unsafe to intercept. Native hits bypass ASGI middleware, guards, compression, custom headers, and Python access logging. Keep protected or customized assets on the Litestar fallback path. See the [production guide](https://litestar-org.github.io/litestar-vite/latest/usage/production.html) for the server matrix and advanced configuration. ## Documentation - Get started: https://litestar-org.github.io/litestar-vite/latest/usage/index.html - Framework guides: https://litestar-org.github.io/litestar-vite/latest/frameworks/index.html - Inertia: https://litestar-org.github.io/litestar-vite/latest/frameworks/inertia/index.html - API reference: https://litestar-org.github.io/litestar-vite/latest/reference/index.html - Changelog: https://litestar-org.github.io/litestar-vite/latest/changelog.html ## Common Commands - `**litestar assets init --template **`: scaffold a frontend or framework app - `**litestar assets install**`: install frontend dependencies with the configured executor - `**litestar assets build**`: build production assets - `**litestar assets serve**`: run the frontend toolchain directly - `**litestar assets generate-types**`: export OpenAPI, routes, and Inertia page-prop metadata - `**litestar assets doctor**`: inspect and optionally repair config drift ## Development ``` # Install Python, docs, and JS dependencies; build package artifacts make install && make build # Run an example app uv run litestar --app-dir examples/vue-inertia assets install uv run litestar --app-dir examples/vue-inertia run ``` Replace `**vue-inertia**` with any other example app: `**vue**`, `**react**`, `**svelte**`, `**react-inertia**`, `**htmx**`, `**angular**`, `**astro**`, `**nuxt**`, or `**sveltekit**`. litestar-vite now defaults Inertia apps to script-element bootstrap. Inertia v3 clients use that transport automatically; if you pin Inertia v2, keep `**createInertiaApp({ defaults: { future: { useScriptElementForInitialPage: true } } })**` aligned in the browser entry and SSR entry when `**ssr=True**` is enabled, or opt back into the legacy `**data-page**` path with `**InertiaConfig(use_script_element=False)**`. ## Links - Docs: https://litestar-org.github.io/litestar-vite/latest/ - Examples: `**examples/**` (React, Vue, Svelte, HTMX, Inertia, Astro, Nuxt, SvelteKit, Angular) - Real-world example: [litestar-fullstack](https://github.com/litestar-org/litestar-fullstack) - Issues: https://github.com/litestar-org/litestar-vite/issues/ --- - **Page:** Announcing Litestar 3 - **Source:** https://litestar.dev/blog/v3-announcement - **Description:** Litestar 3 is afoot. Have a look at what awaits you A long long time ago, we released [Litestar 2.0](https://github.com/litestar-org/litestar/releases/tag/v2.0.0), and with it came the promise of another major version. A version that would not be in development for too long, and would focus mostly on stabilising existing features, improved developer experience, and removing leftovers from the 1.x -> 2.x transition. Now, over 3 years later, we gotta admit that this did not go according to plan! This is mostly due to unforeseen happenstances, and the core maintainer team not being able to spend as much time on the project as they would have liked. However, things have and are still brewing, the project is growing, and significant progress has been made, so let's take a look at some of the things Litestar 3 will bring! ## What's coming ### Overwhelmingly overhauled and extended dependency injection Yes, Litestar 3 will finally bring the most requested (and debated) feature of the past years: A new dependency injection system. *What's new about it?* In a nutshell: - Type-based injection *alongside* the existing name-based injection - Native DI in guards, hooks and other places - Ad-hoc DI *everywhere* with access to a request / application context (e.g. arbitrary ASGI middlewares) - Explicit registration of DI providers / values - Nested resolution scopes **What's it look like?** While it's currently being developed in secrecy, we can take a little peek behind the curtain, and see what its API looks like: #### Type-based DI Litestar `2.23.0` introduced `NamedDependency`, as part of its move towards more explicit declarations (read more [here](https://docs.litestar.dev/2/topics/explicit_declarations.html)). This also laid the groundwork for the new type-based DI system: Litestar 3 will feature `TypeDependency` alongside `NamedDependency`; The semantics remain the same, with the exception that the provider key won't be inferred from the parameter name, but will be the type itself: ```python @get("/") async def handler(some_service: TypeDependency[SomeService]) -> None: pass router = Router( "/", [handler], dependencies={SomeService: provide_some_service}, ) ``` #### Extended DI availability **DI in guards** ```python async def provide_user(request: TypeDependency[Request[User]]) -> User: return request.user async def require_admin_user(active_user: TypeDependency[User]) -> None: if not active_user.is_admin: raise NotAuthorized() @get("/", guards=[require_admin_user]) async def handler() -> None: pass router = Router( "/", [handler], dependencies={User: provide_user}, ) ``` #### Ad-hoc DI The `Litestar` and `ASGIConnection` instances will expose a `di_context` attribute, which can be used to dynamically resolve dependencies: ```python class SomeMiddleware(ASGIMiddleware): async def handle(self, scope: Scope, send: Send, receive: Receive, next_app: ASGIApp) -> None: litestar_app = Litestar.from_scope(scope) db_session = await litestar_app.di_context.resolve(AsyncSession) ... await next_app(scope, send, receive) ``` When using type-based DI, this has the added benefit of being type-safe, e.g. `.resolve` has a signature of `async def resolve[T](type_: type[T]) -> T`. Using the same DI context, you can dynamically *provide* values: ```python @contextlib.asynccontextmanager async def lifespan(app: Litestar) -> AsyncGenerator[None]: app.di_context.provide(MySettings, my_settings) ``` ### A whole new logging experience Litestar's logging integration has been greatly simplified. And by simplified I mean "mostly removed". While it had a noble goal (providing a unified interface for different logging libraries, suited for the needs of usage in a web framework environment), it often fell short of them, and users and developers alike ended up frustrated. And filing and fixing a lot of bugs. So we went back to the drawing board and came up with an integration that's reduced the logging interface to the bare minimum Litestar *actually* needs, for the few logging features it has: You can provide an object conforming to the stdlib's `logging.Logger` interface or, alternatively, to structlog's logger interface, which can be toggled via a `log_structured=True` parameter. But that's about it. Nothing more to it. You can read more about it [here](https://docs.litestar.dev/main/release-notes/changelog.html#3.0.0-remove%20logging%20config%20and%20related%20constructs) and [there](https://docs.litestar.dev/main/usage/logging.html). ### Redesigning handler registration One of the major changes is something that has no visible effects above the surface; In 3.0, Litestar's layer system, i.e. how route handlers, controllers, routers and applications are wired together, has been completely rewritten. Litestar's routing generally works top-down: - An application registers a router, a router registers a handler, etc. - A handler will receive configuration from the layers *above* it ```python class SomeController(Controller): path = "/controller" guards = [controller_guard] @get("/handler", guards=[handler_guard]) async def handler(self) -> None: pass app = Litestar([SomeController], guards=[app_guard]) ``` In this example, `app` registers `SomeController`, which in turn registers `handler`, while `handler` receives `guards` from all levels above it. At least on the API surface this is the case. Underneath, it poses a bit of a technical challenge: If components (handlers, controllers, routers) are meant to be standalone, how can e.g. a handler know about guards registered above it? The usual solution to this would be to make them active elements of the routing process; When a request comes in, it is first handled by the app, which resolves its guards, then if the request path matches a subcomponent, further routing is handed down to it, in this instance the controller, and the same process repeats all the way down until a leaf node in the routing tree is hit, and a response can be generated. This approach though comes with its own downsides: It requires distributing a lot of the dispatch logic into components, compared to a more centralised design, and it also removes opportunities for optimisation (e.g. if we know all guards / dependencies / etc. a request will hit at once, we can resolve them concurrently or skip those we know can't be reached). For these reasons, in Litestar 2, a different design was chosen: During the registration process, a component kept track of its parent layers, providing access to them through the handler. The handler could then resolve them lazily whenever needed. However convenient, this design had a few downsides mainly that: - It required keeping all the layers around, which were basically just static configuration except the parent tracking - It had to (deep)copy things frequently, causing complicated workarounds, hampered startup performance and led to unexpected behaviour in some cases - Handlers were stateful, opening the door to race conditions and other issues stemming from what's now effectively global state (this was mitigated somewhat by the copying though) And there were a few things that we could not do with this, for example caching resolved components statically. **The new approach** The new component registration in Litestar 3 departs from the dynamic nature, and fully embraces static configuration; Transient components (i.e. controllers and routers) completely disappear at runtime, and purely function as an intermediate configuration layer. When a handler is added to a router, nothing happens immediately - only a reference to the handler is stored there. The actual registration happens after a component is added to an application. On startup, the application recursively walks all components, bottom-up, and *merges* them into a new handler. That is, a completely new handler instance will be created, from the merged values of all the layers above it. In practice this means that ```python class SomeController(Controller): path = "/controller" guards = [controller_guard] @get("/handler", guards=[handler_guard]) async def handler(self) -> None: pass router = Router("/router", [SomeController], guards=[router_guard]) app = Litestar([router], guards=[app_guard]) ``` is, after registration, the same as ```python @get( "/router/controller/handler", guards=[ app_guard, router_guard, controller_guard, handler_guard, ] ) async def handler() -> None: pass app = Litestar([handler]) ``` These are not just semantically the same, but also technically. The original handler supplied by the user is left completely untouched, only the reference to the function is kept. Everything else is re-created with the merged values. With this change, routers, controllers and handlers now contain virtually no runtime logic any more, and serve purely as configuration objects. It has also proven to provide some modest startup time improvements for larger apps, but the main benefit is maintainability; The code is much more concise, tightly grouped and split by responsibility. Components are now truly independent, and they need not and cannot know anything about the context they're included in. An exemplary payoff of this redesign is the new zero-overhead middleware exclusions; Middlewares that are statically excluded from a component (e.g. via an `opt` key or a path filter) won't be applied to that component at all, instead of dynamically checking if the middleware should be skipped at runtime. (Read more about this [here](https://docs.litestar.dev/main/release-notes/changelog.html#3.0.0-zero%20cost%20excluded%20middlewares)) ### More exciting things There are many more changes, such as [middleware configuration constraints](https://docs.litestar.dev/main/usage/middleware/creating-middleware.html#configuration-constraints), [improved cloud file system integration](https://docs.litestar.dev/main/release-notes/whats-new-3.html#improved-file-system-handling-fsspec-integration), [async native test client](https://docs.litestar.dev/main/release-notes/changelog.html#3.0.0-make) and many more. See [3.x changelog](https://docs.litestar.dev/main/release-notes/changelog.html) and [What's changed in 3.0](https://docs.litestar.dev/main/release-notes/whats-new-3.html) for an overview. ## Release when? Litestar 3.0 will probably release some time within 2026. There's one major feature still waiting for completion before going into beta (DI overhaul). This is currently blocked by a lack of maintainer resources (i.e. I - Janek - do not have enough time at the moment to consistently work on it). The groundwork is laid though, the core is working, all preparations have been made. I currently expect the beta to land by the end of this summer. After that, the final release date for 3.0 depends on how the beta goes. Since 3.0 has been developed on `main` for quite a while now, and people have been test-driving it, we currently don't expect any major surprises, so we're aiming for ~3 months after the beta release. ## And beyond Technical details aside, what's the future like for Litestar? What are the long term goals? Where are we headed conceptually? How are we doing emotionally? What does Litestar want? It's been a long time since Litestar 2.0 released, and a lot has changed since then. The project has grown, maintainers came and went, and the project has seen a steady increase in usage. The project is in a good shape now. Much better than it was when 2.0 was released. There are fewer "big things" on our to-do lists, to the point where I expect that after 3.0, we can put our maintenance focus (even) more on minor improvements, documentation updates and other auxiliary resources. Furthermore, Litestar has managed to establish a niche in the well satiated web framework space for itself, comfortably placing it as a viable alternative to well known names, albeit not rivalling them in sheer popularity. The Litestar of today has a unique flavour and style to it, that we, I, and a growing community of users have come to cherish. I'm hoping beyond 3.0, we can explore this even further, but I would not expect a major release any time soon after. Once 3.0 is released and well, I will take some time to focus on [msgspec](https://msgspec.dev/), a project that Litestar relies on a great deal for many of its internals, and where I've recently joined the maintainer team. Keeping Litestar's ecosystem and foundations alive is equally important as the core-framework-work itself, and I'm more than happy about the opportunity for all of this work. Well then, I hope you feel a bit more informed after reading this. If on the other hand it raised more questions than it answered, don't hesitate to pop over to our [discussions page](https://github.com/orgs/litestar-org/discussions) or [discord](https://discord.gg/litestar) and ask away! --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation ![Advanced Alchemy](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/advanced-alchemy.png) ### Advanced Alchemy Ready-to-go SQLAlchemy concoctions. [**702.9K**](https://pypi.org/project/advanced-alchemy) [**813**](https://github.com/litestar-org/advanced-alchemy) [Advanced Alchemy](https://litestar.dev/plugins/advanced-alchemy) ![Litestar AsyncPG](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-asyncpg.svg) ### Litestar AsyncPG Asyncpg plugin for Litestar [**2.1K**](https://pypi.org/project/litestar-asyncpg) [**15**](https://github.com/litestar-org/litestar-asyncpg) [Litestar AsyncPG](https://litestar.dev/plugins/litestar-asyncpg) ![Litestar Autowire](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-autowire.svg) ### Litestar Autowire Package-based route, listener, and task discovery for Litestar [**348**](https://pypi.org/project/litestar-autowire) [**3**](https://github.com/cofin/litestar-autowire) [Litestar Autowire](https://litestar.dev/plugins/litestar-autowire) ### Litestar Email Email plugin for Litestar [**2.5K**](https://pypi.org/project/litestar-email) [**16**](https://github.com/litestar-org/litestar-email) [Litestar Email](https://litestar.dev/plugins/litestar-email) ![Litestar Granian](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-granian.png) ### Litestar Granian Granian plugin for Litestar [**16.5K**](https://pypi.org/project/litestar-granian) [**44**](https://github.com/cofin/litestar-granian) [Litestar Granian](https://litestar.dev/plugins/litestar-granian) ![Litestar HTMX](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-htmx.svg) ### Litestar HTMX HTMX Integration for Litestar [**1.7M**](https://pypi.org/project/litestar-htmx) [**12**](https://github.com/litestar-org/litestar-htmx) [Litestar HTMX](https://litestar.dev/plugins/litestar-htmx) ![Litestar MCP](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-mcp.svg) ### Litestar MCP Litestar plugin for Model Context Protocol (MCP) integration [**6K**](https://pypi.org/project/litestar-mcp) [**13**](https://github.com/cofin/litestar-mcp) [Litestar MCP](https://litestar.dev/plugins/litestar-mcp) ![Litestar OracleDB](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-oracledb.svg) ### Litestar OracleDB Oracle DB plugin for Litestar [**15**](https://pypi.org/project/litestar-oracledb) [**4**](https://github.com/litestar-org/litestar-oracledb) [Litestar OracleDB](https://litestar.dev/plugins/litestar-oracledb) ![Litestar Queues](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-queues.svg) ### Litestar Queues Task queues, workers, schedules, and backend integrations for Litestar [**854**](https://pypi.org/project/litestar-queues) [**10**](https://github.com/cofin/litestar-queues) [Litestar Queues](https://litestar.dev/plugins/litestar-queues) ### Litestar SAQ Litestar integration for SAQ [**21.7K**](https://pypi.org/project/litestar-saq) [**35**](https://github.com/litestar-org/litestar-saq) [Litestar SAQ](https://litestar.dev/plugins/litestar-saq) ![Litestar Vite](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-vite.svg) ### Litestar Vite Vite plugin for Litestar [**16.9K**](https://pypi.org/project/litestar-vite) [**37**](https://github.com/litestar-org/litestar-vite) [Litestar Vite](https://litestar.dev/plugins/litestar-vite) ### SQLSpec SQL Experiments in Python [**10K**](https://pypi.org/project/sqlspec) [**105**](https://github.com/litestar-org/sqlspec) [SQLSpec](https://litestar.dev/plugins/sqlspec) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Database - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation ![Advanced Alchemy](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/advanced-alchemy.png) ### Advanced Alchemy Ready-to-go SQLAlchemy concoctions. [**702.9K**](https://pypi.org/project/advanced-alchemy) [**813**](https://github.com/litestar-org/advanced-alchemy) [Advanced Alchemy](https://litestar.dev/plugins/advanced-alchemy) ![Litestar AsyncPG](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-asyncpg.svg) ### Litestar AsyncPG Asyncpg plugin for Litestar [**2.1K**](https://pypi.org/project/litestar-asyncpg) [**15**](https://github.com/litestar-org/litestar-asyncpg) [Litestar AsyncPG](https://litestar.dev/plugins/litestar-asyncpg) ![Litestar OracleDB](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-oracledb.svg) ### Litestar OracleDB Oracle DB plugin for Litestar [**15**](https://pypi.org/project/litestar-oracledb) [**4**](https://github.com/litestar-org/litestar-oracledb) [Litestar OracleDB](https://litestar.dev/plugins/litestar-oracledb) ### SQLSpec SQL Experiments in Python [**10K**](https://pypi.org/project/sqlspec) [**105**](https://github.com/litestar-org/sqlspec) [SQLSpec](https://litestar.dev/plugins/sqlspec) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Deployment - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation ![Litestar Granian](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-granian.png) ### Litestar Granian Granian plugin for Litestar [**16.5K**](https://pypi.org/project/litestar-granian) [**44**](https://github.com/cofin/litestar-granian) [Litestar Granian](https://litestar.dev/plugins/litestar-granian) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Others - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins) ## Browse plugins Shift+click to select plugins for bulk installation ![Litestar Autowire](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-autowire.svg) ### Litestar Autowire Package-based route, listener, and task discovery for Litestar [**348**](https://pypi.org/project/litestar-autowire) [**3**](https://github.com/cofin/litestar-autowire) [Litestar Autowire](https://litestar.dev/plugins/litestar-autowire) ### Litestar Email Email plugin for Litestar [**2.5K**](https://pypi.org/project/litestar-email) [**16**](https://github.com/litestar-org/litestar-email) [Litestar Email](https://litestar.dev/plugins/litestar-email) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=UI - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation ![Litestar HTMX](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-htmx.svg) ### Litestar HTMX HTMX Integration for Litestar [**1.7M**](https://pypi.org/project/litestar-htmx) [**12**](https://github.com/litestar-org/litestar-htmx) [Litestar HTMX](https://litestar.dev/plugins/litestar-htmx) ![Litestar Vite](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-vite.svg) ### Litestar Vite Vite plugin for Litestar [**16.9K**](https://pypi.org/project/litestar-vite) [**37**](https://github.com/litestar-org/litestar-vite) [Litestar Vite](https://litestar.dev/plugins/litestar-vite) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Background+Processing - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation ![Litestar Queues](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-queues.svg) ### Litestar Queues Task queues, workers, schedules, and backend integrations for Litestar [**854**](https://pypi.org/project/litestar-queues) [**10**](https://github.com/cofin/litestar-queues) [Litestar Queues](https://litestar.dev/plugins/litestar-queues) ### Litestar SAQ Litestar integration for SAQ [**21.7K**](https://pypi.org/project/litestar-saq) [**35**](https://github.com/litestar-org/litestar-saq) [Litestar SAQ](https://litestar.dev/plugins/litestar-saq) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=AI - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation ![Litestar MCP](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-mcp.svg) ### Litestar MCP Litestar plugin for Model Context Protocol (MCP) integration [**6K**](https://pypi.org/project/litestar-mcp) [**13**](https://github.com/cofin/litestar-mcp) [Litestar MCP](https://litestar.dev/plugins/litestar-mcp) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Official - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation ![Advanced Alchemy](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/advanced-alchemy.png) ### Advanced Alchemy Ready-to-go SQLAlchemy concoctions. [**702.9K**](https://pypi.org/project/advanced-alchemy) [**813**](https://github.com/litestar-org/advanced-alchemy) [Advanced Alchemy](https://litestar.dev/plugins/advanced-alchemy) ![Litestar AsyncPG](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-asyncpg.svg) ### Litestar AsyncPG Asyncpg plugin for Litestar [**2.1K**](https://pypi.org/project/litestar-asyncpg) [**15**](https://github.com/litestar-org/litestar-asyncpg) [Litestar AsyncPG](https://litestar.dev/plugins/litestar-asyncpg) ![Litestar Autowire](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-autowire.svg) ### Litestar Autowire Package-based route, listener, and task discovery for Litestar [**348**](https://pypi.org/project/litestar-autowire) [**3**](https://github.com/cofin/litestar-autowire) [Litestar Autowire](https://litestar.dev/plugins/litestar-autowire) ### Litestar Email Email plugin for Litestar [**2.5K**](https://pypi.org/project/litestar-email) [**16**](https://github.com/litestar-org/litestar-email) [Litestar Email](https://litestar.dev/plugins/litestar-email) ![Litestar Granian](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-granian.png) ### Litestar Granian Granian plugin for Litestar [**16.5K**](https://pypi.org/project/litestar-granian) [**44**](https://github.com/cofin/litestar-granian) [Litestar Granian](https://litestar.dev/plugins/litestar-granian) ![Litestar HTMX](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-htmx.svg) ### Litestar HTMX HTMX Integration for Litestar [**1.7M**](https://pypi.org/project/litestar-htmx) [**12**](https://github.com/litestar-org/litestar-htmx) [Litestar HTMX](https://litestar.dev/plugins/litestar-htmx) ![Litestar MCP](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-mcp.svg) ### Litestar MCP Litestar plugin for Model Context Protocol (MCP) integration [**6K**](https://pypi.org/project/litestar-mcp) [**13**](https://github.com/cofin/litestar-mcp) [Litestar MCP](https://litestar.dev/plugins/litestar-mcp) ![Litestar OracleDB](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-oracledb.svg) ### Litestar OracleDB Oracle DB plugin for Litestar [**15**](https://pypi.org/project/litestar-oracledb) [**4**](https://github.com/litestar-org/litestar-oracledb) [Litestar OracleDB](https://litestar.dev/plugins/litestar-oracledb) ![Litestar Queues](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-queues.svg) ### Litestar Queues Task queues, workers, schedules, and backend integrations for Litestar [**854**](https://pypi.org/project/litestar-queues) [**10**](https://github.com/cofin/litestar-queues) [Litestar Queues](https://litestar.dev/plugins/litestar-queues) ### Litestar SAQ Litestar integration for SAQ [**21.7K**](https://pypi.org/project/litestar-saq) [**35**](https://github.com/litestar-org/litestar-saq) [Litestar SAQ](https://litestar.dev/plugins/litestar-saq) ![Litestar Vite](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-vite.svg) ### Litestar Vite Vite plugin for Litestar [**16.9K**](https://pypi.org/project/litestar-vite) [**37**](https://github.com/litestar-org/litestar-vite) [Litestar Vite](https://litestar.dev/plugins/litestar-vite) ### SQLSpec SQL Experiments in Python [**10K**](https://pypi.org/project/sqlspec) [**105**](https://github.com/litestar-org/sqlspec) [SQLSpec](https://litestar.dev/plugins/sqlspec) --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Analytics - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation No plugin found for undefined. [Contribute on GitHub](https://github.com/litestar-org/plugin-registry)How to create a plugin? --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Authentication - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation No plugin found for undefined. [Contribute on GitHub](https://github.com/litestar-org/plugin-registry)How to create a plugin? --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Monitoring - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation No plugin found for undefined. [Contribute on GitHub](https://github.com/litestar-org/plugin-registry)How to create a plugin? --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Performance - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation No plugin found for undefined. [Contribute on GitHub](https://github.com/litestar-org/plugin-registry)How to create a plugin? --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Serialization - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins) [Security](https://litestar.dev/plugins?category=Security) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation No plugin found for undefined. [Contribute on GitHub](https://github.com/litestar-org/plugin-registry)How to create a plugin? --- - **Page:** Litestar plugins - **Source:** https://litestar.dev/plugins?category=Security - **Description:** Discover a list of Litestar plugins to enhance your application. From authentication to database integrations, find the perfect plugin to supercharge your Litestar project. # **Ship faster with **12+** Litestar Plugins ** Discover our list of plugins to supercharge your Litestar project. Created and maintained by people from the Litestar team and community. [Official](https://litestar.dev/plugins?category=Official) [AI](https://litestar.dev/plugins?category=AI) [Analytics](https://litestar.dev/plugins?category=Analytics) [Authentication](https://litestar.dev/plugins?category=Authentication) [Database](https://litestar.dev/plugins?category=Database) [Deployment](https://litestar.dev/plugins?category=Deployment) [Background Processing](https://litestar.dev/plugins?category=Background+Processing) [Monitoring](https://litestar.dev/plugins?category=Monitoring) [Performance](https://litestar.dev/plugins?category=Performance) [Serialization](https://litestar.dev/plugins?category=Serialization) [Security](https://litestar.dev/plugins) [UI](https://litestar.dev/plugins?category=UI) [Others](https://litestar.dev/plugins?category=Others) ## Browse plugins Shift+click to select plugins for bulk installation No plugin found for undefined. [Contribute on GitHub](https://github.com/litestar-org/plugin-registry)How to create a plugin?