Connect to Ollama from Excel
GPT for Excel can connect to an Ollama server to use locally running open-source models. Ollama is an open-source platform that allows you to easily install, run, and serve models from a local machine, keeping your prompting entirely offline. You can use any model from the Ollama library.
You can use Ollama models as Agent models and as bulk models. The server requirements are different for each type of model:
-
Agent models: The server must run Ollama v0.13.3 or later, which supports OpenAI's Responses API, and must be publicly accessible over the internet through HTTPS, because the Agent calls the server through GPT for Work servers. The model must support a context length of at least 32K tokens.
-
Bulk models: Any Ollama server, including a local server that is not accessible over the internet.
Prerequisites
Your space is on the Business or Enterprise plan or pay-as-you-go pricing.
You have an Ollama server running with one or more models. For instructions on how to set up the server, see:
Depending on the model you use, the model settings defined in GPT for Excel (temperature (creativity), top-p, frequency penalty, and presence penalty) may not work as expected. If you get bad results, try tweaking the settings.
To use models from an Ollama server:
Set up the API endpoint for an Ollama server​
- Agent models
- Bulk models
-
Sign in to the GPT for Work dashboard with your Microsoft account.
-
In the sidebar, select Custom API endpoints.
-
Select the Agent models tab.
-
Click OpenAI-compatible endpoints (Responses API).
tipIf you already have OpenAI-compatible API endpoints set up, click Add an OpenAI-compatible API endpoint.
-
Define the endpoint settings:
-
Endpoint URL: Enter the public URL of the Ollama server. The server must be publicly accessible over the internet, for example through a reverse proxy or a tunneling service. Setting this up depends on your infrastructure and is not covered by this documentation.
-
Model ID: Enter the ID of the model to use, as listed by the
ollama listcommand. The model ID is sent to the endpoint in the request payload. -
Display name (optional): Enter a short name that identifies the model in the Agent model switcher.
-
API key (optional): Leave this field empty. The Ollama server does not require an API key for access.

-
-
Click Check to validate the settings and click Save.
You have set up the Ollama server API endpoint. The model is now available in the Agent model switcher and in the Agent models page of the GPT for Work dashboard.
-
Sign in to the GPT for Work dashboard with your Microsoft account.
-
In the sidebar, select Custom API endpoints.
-
Select the Bulk models tab.
-
Click OpenAI-compatible endpoints (Chat Completions API).
tipIf you already have OpenAI-compatible API endpoints set up, click Add an OpenAI-compatible API endpoint.
-
Define the endpoint settings:
-
Endpoint URL: Enter the URL of the Ollama server.
-
Display name (optional): Enter a short name that is prefixed to the model names in the model switcher. By default, the model names are prefixed with "custom/".
-
API key (optional): Leave this field empty. The Ollama server does not require an API key for access.

-
-
Click Check to validate the settings and click Save.
tipIf you get an error saying that the URL is invalid, make sure that the Ollama server supports:
You have set up the Ollama server API endpoint. You can now use all models available through the endpoint in GPT for Excel.
Select a model from the Ollama server​
- Agent models
- Bulk models
-
Open a Microsoft Excel workbook.
-
On the ribbon, select Home > GPT for Excel Word.
infoIf GPT for Excel Word is not visible on the ribbon, or if it's grayed out, select Home > Add-ins > My Add-ins > GPT for Excel Word. Learn more.
-
In the sidebar, select Agent.
-
Open the model switcher and select the model.

The Agent now uses the Ollama model as the Agent model.
Some Agent tools, such as web search, are not available when the Agent uses an endpoint-connected model.
-
Open a Microsoft Excel workbook.
-
On the ribbon, select Home > GPT for Excel Word.
infoIf GPT for Excel Word is not visible on the ribbon, or if it's grayed out, select Home > Add-ins > My Add-ins > GPT for Excel Word. Learn more.
-
In the sidebar, select Bulk tools and select one of the tools.

-
Open the model switcher. You can find the Ollama models under Connected models.
noteThe available models depend on the models available on the Ollama server.
-
Select a model.
GPT for Excel now uses the selected model to generate responses for bulk tools and GPT functions.