# schemagate > Shows the model only the tables this caller may read, before any SQL exists, and cuts prompt tokens 65–97%. Any SQLAlchemy database. pip install schemagate. schemagate is an open-source Python library (Apache-2.0, by Ashish Sinha) for text-to-SQL and NL2SQL systems. Given a question and a caller identity, it returns the handful of tables and views the model needs, with every object the caller may not read removed before ranking, plus the DDL fragment for the prompt. It reflects any SQLAlchemy database (Oracle, PostgreSQL, SQL Server, MySQL, SQLite), needs no API key, ships an MCP server, a LangChain retriever, a CLI and a browser Studio, and has a native Oracle 23ai VECTOR store. - Install: pip install schemagate -- or docker run -p 8770:8770 ghcr.io/ashishsinha1602/schemagate - Repository: https://github.com/ashishsinha1602/schemagate - PyPI: https://pypi.org/project/schemagate/ - Demo (runs in the browser, no database): https://ashishsinha1602.github.io/schemagate/ - Install, Docker and the OCI stack: https://ashishsinha1602.github.io/schemagate/install/ - Benchmarks (Spider, BIRD, Spider 2.0): https://ashishsinha1602.github.io/schemagate/benchmarks/ - Running it with a local model, no API key: https://ashishsinha1602.github.io/schemagate/local-models/ - Row-level security (VPD) and what grant-based scoping misses: https://ashishsinha1602.github.io/schemagate/row-level-security/ - Token cost table and calculator: https://ashishsinha1602.github.io/schemagate/cost/ - Migrating from Vanna: https://ashishsinha1602.github.io/schemagate/vanna-alternative/ - What was tested and what broke: https://github.com/ashishsinha1602/schemagate/blob/main/TESTING.md