Litestar is worth a look
Litestar is worth a look

Litestar is worth a look

Litestar is worth a look
Litestar is worth a look
As much as I've been disliking fastapi's direction recently, I can't abandon its annotation-based dependency injection. Having to reference injection's parameter name twice, and potentially decoupled from the route itself, does not sound like a fun time. It especially gets complicated with nested dependencies. You have to eagerly determine all the dependencies of your dependencies and provide them to either the route decorator or the app itself.
I would much rather do this
py
@get("/") async def index(injection: Annotated[str, Provide(getThing)]): ...
Than what is currently required
py
@get("/", dependencies={"injection": Provide(getThing)}) async def index(injection: Annotated[str, Dependency()]): ...
litestar#2990 has shown they have no interest in this feature.
Dear OP
SQLModel looks unmaintained. The PRs are languishing in purgatory waiting for the submitters to croak from old age. I died a little inside (see imdb all reviews must start with a drama queen comment like this) noticing the PR count has just achieved 70 PRs as of today. Which must be an achievement in project mismanagement.
According only from the release notes, the last real release was sqlmodel-0.0.23 on Feb 28th 2025. For those keeping score today is Aug 8th 2025
Most activity is bots upgrading gh actions and precommit autoupdate. aka commit spam.
The last human commit was Jun 19th fixing some tests for the docs.
This is a sell point for litestar. Bypassing pydantic also bypasses the horror show of SQLModel.
Will look into msgspec+litestar
Yeah, it's unmaintained because one guy, tiangolo, is the only maintainer for both of those projects, and he doesn't let anyone else approve PRs and so on. I think Litestar has a much better organisation structure.
Probably most projects are as guilty as tiangolo. Myself included. How to scale to multiple maintainers? Tell me about your experience. Would like to know how to avoid this trap.
This seems to be a github weakness. Each of us individually contributes by making a great package. Folks start using it and situation does not scale.
Rinse wash repeat
Currently giving it a try on a small API+async task project.
I think the hardest thing for me has been discovering which dependencies are (can be) injected and through what magic string. But, it's also easy to step through the source to find answers.
After many years of DIYing validation with Django, then attrs+flask, and then getting a lot of that work for free with pydantic+fastapi, msgspec+litestar feels like the natural evolution into a mature pattern.
The sqlalchemy models are first-class citizens, the service and repository classes just work (especially well if you use their advanced alchemy wrapper).
And the devs are very responsive (fixed a tiny bug I found in a weird corner with tests in a matter of hours).
I'm gushing a bit. So I'll just end it by saying I agree with the author: it's worth a look.
Yep, I might give it a try in my next project, but I'm not completely sure if I'll use Go (with Gin) or Litestar and Python.
Just my opinion of course: I wrote golang for years and wanted to love it for the first few. I like some of the patterns, but I got very tired of writing (and reviewing) boilerplate (or in the case of reviews, what should have been boilerplate but got missed). I know it has gotten a bit better in the past few years, but at this point I'd need a huge reason to leave python or look past rust.