Skip to main content

Connect to Ollama from Microsoft Excel / Word

On Microsoft Excel and Word, GPT for Work 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.

note

Depending on the model you use, the spreadsheet settings defined in GPT for Work may not work as expected. If you get bad results, try tweaking the settings.

Connecting to Ollama in GPT for Work means setting the endpoint URL for the Ollama server and selecting one of the models available on the server.

Prerequisites

Set the Ollama endpoint

  1. Open a Microsoft Excel workbook.

  2. Click GPT for Excel Word in the Home tab.

    Home Ribbon

    info

    You can also go to Home > Add-ins > My add-ins > GPT for Excel Word.

  3. In the sidebar menu, select API keys.

    Set API keys
  4. In the Ollama endpoint field, enter the endpoint URL for the Ollama server, and click Save.

    Set the Ollama endpoint
    tip

    If you get an error saying that the endpoint is invalid, make sure that the Ollama server supports:

    • Cross-origin resource sharing (CORS). See the setup instructions for macOS or Windows.

    • HTTPS (needed with Safari and for local network access). See the setup instructions for macOS or Windows.

You have set the Ollama endpoint in GPT for Excel. You can now select Ollama models.

Select an Ollama model

  1. Expand the model switcher. You can find the available Ollama models under Use your API key or endpoint.

    Select an Ollama model
    note

    The available models depend on the models installed on the Ollama server. If an Ollama model you need is not available, install it.

  2. Select a model.

GPT for Excel now uses the selected model to generate all responses.