Setting up a provider
The AI assistant is off until you add a connection. Open Tools → Settings → AI, or click Go to AI settings from the assistant panel.
You can configure several AI connections and switch between them per query.
Fields
| Field | Meaning |
|---|---|
| Connection name | How it appears in the picker |
| API URL | The provider's base URL |
| API type | openai, anthropic or gemini — this selects the request format |
| Username (Basic Auth) | Optional, for gateways that require basic authentication |
| API key / Token | Your key |
| Model | The model identifier |
| System prompt | Instructions prepended to every request |
| Send table schema | Include the structure of the selected tables |
| Send data sample (TOP 5) | Include up to 5 rows from each selected table |
Providers
OpenAI-compatible
API type: openai
API URL: https://api.openai.com/v1The request goes to {URL}/chat/completions with a Bearer token.
Anthropic
API type: anthropic
API URL: https://api.anthropic.com/v1The request goes to {URL}/messages with an x-api-key header and API version 2023-06-01. Responses are capped at 4096 tokens.
Google Gemini
API type: gemini
API URL: https://generativelanguage.googleapis.com/v1betaThe key is passed as a query parameter and the system prompt as systemInstruction.
Local models
Any server that speaks the OpenAI chat API works — set API type to openai and point the URL at it. For Ollama:
API type: openai
API URL: http://localhost:11434/v1
Model: llama3.1 # or whatever you have pulled
API key: ollama # required by the field, ignored by the serverThe same applies to LM Studio, vLLM, llama.cpp's server and similar. Nothing leaves your machine in this configuration — which is the point, if your schema is confidential.
What gets sent
Read this before enabling schema and samples
- Send table schema transmits table and column names and their types.
- Send data sample (TOP 5) transmits real rows from your database — up to five per selected table, personal data included.
Both are off unless you turn them on, and they apply only to the tables you pick for a given question. With a cloud provider, that data leaves your machine and is subject to that provider's terms. With a local model it does not leave the machine at all.
Request preview in the assistant panel shows the exact JSON before you send it. When in doubt, look.
Checking it works
Open a SQL editor, click AI, pick the connection, ask something simple like "select the ten newest rows from users" and send. An authentication or model-name error comes back verbatim from the provider, which usually says exactly what is wrong.
