# SQLModel

> SQL databases in Python, designed for simplicity, compatibility, and robustness

Source: https://talira.ai/catalog/sqlmodel-z71rpfhw
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / databases / orm](https://talira.ai/categories/libraries/databases/orm), [languages / python](https://talira.ai/categories/languages/python)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Self-hostable: no
- Backed by: [Sebastián Ramírez](https://talira.ai/orgs/sebastian-ramirez.md)

SQLModel is a Python library for working with SQL databases through Python objects, defined with type annotations. A single model class is both a [SQLAlchemy](https://talira.ai/catalog/sqlalchemy-wd7fb2fw.md) table and a [Pydantic](https://talira.ai/catalog/pydantic-5as3qf1q.md) model, so the same class validates data, serializes it and reads and writes rows without duplicating models, with editor completion throughout. It's a thin layer over both libraries, keeping all of their power underneath, and was made by FastAPI's author to simplify SQL databases in [FastAPI](https://talira.ai/catalog/fastapi-1tmn6e7v.md) apps. It installs with uv or pip, and ships an official agent skill for AI coding agents.

## Links

- Website: https://sqlmodel.tiangolo.com/
- GitHub: https://github.com/fastapi/sqlmodel
- Docs: https://sqlmodel.tiangolo.com/

## Problems it solves

- stop writing the same model twice for my database tables and my FastAPI request schemas
- a typed Python ORM with editor autocompletion
- read and write SQL rows as validated Python objects

## Features

- one class is both a SQLAlchemy table and a Pydantic model
- Python type annotations with editor completion
- data validation and serialization through Pydantic
- full SQLAlchemy underneath
- designed for FastAPI
- official agent skill for AI coding agents

## Trust

Overall: 0.72 out of 1.
Signals: maintenance 1.00, adoption 0.85, momentum 0.75, community 0.83, backing 0.30, extensibility 0.00.

- last commit 8 days ago
- 83 commits in the last 90 days
- latest release 0.0.50 10 days ago
- 18.7k GitHub stars
- 115 contributors
- accepts sponsorship (Github)
- backed by Sebastián Ramírez

## Related

- Based on [SQLAlchemy](https://talira.ai/catalog/sqlalchemy-wd7fb2fw.md)
- Based on [Pydantic](https://talira.ai/catalog/pydantic-5as3qf1q.md)
- Works with [FastAPI](https://talira.ai/catalog/fastapi-1tmn6e7v.md)

## Alternatives

- [SQLAlchemy](https://talira.ai/catalog/sqlalchemy-wd7fb2fw.md): The Python SQL toolkit and Object Relational Mapper
- [sqlc](https://talira.ai/catalog/sqlc-7w8h0kzr.md): Compile SQL to type-safe code

## Sources

[^1]: https://github.com/fastapi/sqlmodel/blob/main/LICENSE (checked 24 Nov 2026)
