Connect to Ollama from Excel
This feature is only available if your space is on the Business or Enterprise plan or pay-as-you-go pricing.
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. You can use any model from the Ollama library.
You can use Ollama models both as Agent models and bulk models, but the server requirements are different:
-
Agent models: The server must support the OpenAI Responses API (Ollama 0.13.3 or newer) and be publicly accessible over the internet through HTTPS. In addition, the model must support a context size of at least 32K tokens.
-
Bulk models: Any Ollama server, including a locally running server that is not accessible over the internet.
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
Prerequisites
You have an Ollama server running with one or more models. For instructions on how to set up the server, see:
The server supports the following OpenAI-compatible API resource path:
/v1/responsesThe server is publicly accessible over the internet through HTTPS.
The model supports a context size of at least 32K tokens.
-
Sign in to the GPT for Work dashboard with your Microsoft or Google 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 on the models page of the GPT for Work dashboard.
Prerequisites
You have an Ollama server running with one or more models. For instructions on how to set up the server, see:
-
Sign in to the GPT for Work dashboard with your Microsoft or Google 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 a model. You can find the Ollama models at the end of the list.

GPT for Excel now uses the selected 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 and select a model. You can find the Ollama models under Connected models, at the end of the list.
infoThe available models depend on the models available on the Ollama server.
GPT for Excel now uses the selected model to generate responses for bulk tools and GPT functions.