AI providers and keys

Choose Ollama, OpenAI, Anthropic or Google Gemini for AI Chat, pick a model, and store your API key in the macOS Keychain.

AI Chat talks to one provider at a time. Set it up in Settings → AI.

Choose a provider

Use Ollama on your Mac, or OpenAI, Anthropic or Gemini with your own key, stored in the Keychain.

Provider in Settings → AI starts at None, which turns AI Chat off. The other choices are:

Provider Needs an API key Standard endpoint
Ollama (Local) No http://localhost:11434
OpenAI Yes https://api.openai.com/v1
Anthropic Yes https://api.anthropic.com
Google Gemini Yes https://generativelanguage.googleapis.com/v1beta

Ollama

Ollama is a separate, free program that runs models on your own Mac. Install and start it yourself, then choose Ollama (Local). It needs no key.

Pick a model

Each provider has its own Model field, such as OpenAI Model. Leave it blank to use the default model that ships with this version of JSLab, or type the name of the model you want.

The field also lists the models the provider reports. Refresh fetches the list again, and Default goes back to the shipped default. For Ollama, the list is the models you’ve installed.

These are the defaults in this version. A later version can move them forward for everyone who left the field blank.

Provider Default model
Ollama qwen2.5:7b-instruct
OpenAI gpt-4o-mini
Anthropic claude-opus-5-5
Google Gemini gemini-2.0-flash

Point at a different endpoint

Each provider also has a Base URL field, such as Ollama Base URL. Leave it blank for the standard endpoint in the table above, or enter another address, for example an Ollama server on another machine.

API keys

The API Keys section of Settings → AI has a field for each provider that needs one: OpenAI API Key, Anthropic API Key and Google Gemini API Key.

  1. Get a key from the provider’s own site.
  2. Paste it into the field and click Save.
  3. The field then shows A key is stored. Click Remove to delete it.

Keys are stored in your macOS Keychain, never in settings.json. JSLab sends a key only with requests to that provider’s Base URL, and only in a request header, never in a URL.

Without a stored key, a request to OpenAI, Anthropic or Gemini stops before it’s sent, and AI Chat reports a credentials error.

Requests go straight from your Mac to the provider’s endpoint, with your own key.

Send Recent Output

Send Recent Output includes the most recent run’s output with each message, up to 20 KB. It’s on by default. Turn it off to send only your code and the conversation. See Ask AI for everything a message carries.

Last updated