Setting up AI

NovaSql can have an AI improve your queries (see Improving queries with AI). There are three providers to choose from, under Settings → General → AI provider.

Provider Runs where Needs
Anthropic Claude (cloud) at Anthropic, over the internet an API key
Foundry Local (offline) on your own computer Foundry Local with a loaded model
Ollama (offline) on your own computer Ollama with a loaded model

Each provider keeps its own settings, so switching between them loses nothing.

Anthropic Claude

  1. Create an API key at console.anthropic.com.
  2. Paste it into Anthropic API key in NovaSql.
  3. Pick a model under AI model. The default is claude-opus-5-5, the most thorough. claude-sonnet-5-5 is faster and cheaper, claude-haiku-5-5 the fastest.

Anthropic bills the cost directly to your own account. When improving a query, the editor's content is sent to Anthropic, nothing else.

Foundry Local or Ollama

With a local provider no SQL leaves your computer. The local service has to be running with a model loaded.

Ollama: install Ollama and fetch the model:

ollama pull qwen2.5-coder:7b

NovaSql already has the endpoint (http://localhost:11434) and model (qwen2.5-coder:7b) preset.

Foundry Local: start Foundry Local and load a model. The presets are the endpoint http://127.0.0.1:55588 and the model qwen2.5-coder-7b. If Foundry Local runs on a different port, adjust the Endpoint.

Test connection shows whether the service is reachable and which models it currently offers.

Which is better?

Claude gives better suggestions, especially for complex queries. Local models are private and free, but slower (much slower without a graphics card) and follow instructions less precisely. For sensitive databases a local model is the safe choice.

Other programs with an OpenAI-compatible interface (such as LM Studio or llama.cpp) usually work too: pick one of the two local providers and enter that program's endpoint.