Docs / Guides

Write SQL with a local AI (Ollama or LM Studio)

SayQL can write SQL with a local AI running in Ollama or LM Studio. Nothing leaves your computer, and you don't need an API key.

Get started

  1. Download SayQL for macOS, Windows or Linux.
  2. Install Ollama, pull a model (for example ollama pull llama3.2) and keep it running. Or start the local server in LM Studio.
  3. In Settings → AI provider, pick Ollama or LM Studio, click Load models, pick a model and Save.
  4. Connect your database and ask in the Ask box.

SayQL connects to Ollama at http://localhost:11434/v1 and LM Studio at http://localhost:1234/v1. Change the base URL in Settings if yours runs elsewhere.

Example questions

  • "Products low on stock"
  • "Revenue by month this year"

"Products low on stock" might come back as:

SELECT name, stock
FROM products
WHERE stock < 10
ORDER BY stock;

What keeps it safe

Nothing leaves your computer. Your questions and schema go only to the model on your machine. Queries still run read-only by default, and anything that could change data asks first.

See AI providers and Privacy and data.

Something missing or unclear? Ask in Discussions.