Skip to main content

Connect to OpenAI-compatible local servers from Microsoft Excel and Word

On Microsoft Excel and Word, GPT for Work can connect to any locally running LLM server that provides an OpenAI-compatible API. Once connected, all models available on the local server become available to use in GPT for Work.

note

Depending on the model you use, the spreadsheet settings defined in GPT for Work (temperature (creativity), top-p, frequency penalty, and presence penalty) may not work as expected. If you get bad results, try tweaking the settings.

Here are a few local server solutions that you can use with GPT for Work:

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

Prerequisites

Set the local server URL

  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 Custom local server field, enter the URL for the local server, and click Save.

    Set the local server URL
    tip

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

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

    • HTTPS (needed with Safari and with Microsoft Office for Mac). See the LM Studio setup instructions for macOS.

You have set the local server URL in GPT for Excel. You can now select local models.

Select a model available on the local server

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

    Select a local model
    note

    The available models depend on the models installed on the local server.

  2. Select a model.

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