Features of !SEMTools
↑ Навигация по задачам в Excel и возможностям надстройки !SEMTools ↑

LM Studio in Excel: local AI models

LM Studio is a free app that runs AI models right on your computer. No cloud services, no API keys and no per-token billing: you download a model once, and the data from your spreadsheet never leaves your machine. The !SEMTools add-in connects LM Studio to Excel, so you can process whole columns with a local model — classify, rewrite, extract data from text.

Below: how to install LM Studio, start its server, choose a model in the add-in and send prompts in bulk. For an overview of all connected models, see AI in Excel.

What LM Studio is and why use it with Excel

LM Studio is an app for Windows, macOS and Linux with a familiar chat window, a model catalog and a built-in server. The server answers requests in the OpenAI API format, so any program can connect to it — Excel included.

Why a local model is useful for spreadsheet work:

  • privacy — commercial data, customer personal data and internal documents stay on your computer;
  • no per-request costs — run tens of thousands of rows without watching a balance;
  • works offline — once the model is downloaded, you don’t need the internet;
  • no regional restrictions or rate limits that cloud APIs sometimes have.

The trade-off is your computer’s resources. A local model answers slower than a cloud one and is weaker on complex tasks, but for tagging, classification and short texts it is usually more than enough.

LM Studio or Ollama: which to choose

Both apps run local models, and both connect to !SEMTools. The difference is convenience:

LM StudioOllama
InterfaceWindow with chat, catalog and settingsCommand line
Finding and downloading modelsSearch the catalog, download in one clickollama pull commands
Server for ExcelTurned on with a switch, port 1234Runs in the background, port 11434
Best forPeople who prefer not to use the consolePeople comfortable with the command line

If you already use Ollama, there is no need to switch: see how to connect Ollama to Excel. If you have never run local models, LM Studio is the easier start.

Install LM Studio and download a model

Download the installer from the official website lmstudio.ai and install the app. System requirements according to the LM Studio documentation:

  • Windows — x64 CPU with AVX2 support, or ARM (Snapdragon X Elite);
  • macOS — Apple Silicon only (M1 or newer), macOS 14 or newer; Intel Macs are not supported;
  • Linux — x64 or ARM64, Ubuntu 20.04 or newer;
  • RAM — 16 GB or more recommended, GPU — 4 GB of video memory or more.

Then open model search, find a suitable model and download it. To start, take a model with 4–8 billion parameters in Q4 quantization: it takes a few gigabytes and runs even on a laptop. Test it in the chat window — if the answers make sense, it’s ready for Excel.

Start the LM Studio server

Excel talks to LM Studio through a local server, so it has to be running. Open the Developer tab and turn on Start server. The server works while the app is open. You can also start it from the command line:

lms server start

The add-in connects to the server at http://localhost:1234 — the default LM Studio port. If you changed the port in the server settings, set it back to 1234, otherwise the LM Studio menu in !SEMTools won’t find the server.

One more thing: by default the LM Studio server doesn’t require authentication. If you turned on a required API token in the server settings, the add-in’s requests will be rejected, because they are sent without a key. Turn authentication off for local work with Excel.

Connect LM Studio to Excel with !SEMTools

If you don’t have the !SEMTools tab in Excel yet, first download and install !SEMTools. The menu is on the !SEMTools tab: Web (Scraping, SEO, PPC) → APIs → LM Studio. It has three commands: Choose model, Run selected queries and Run selected with preprompt.

Choose model

Run Choose model. The add-in requests the list of models from the server and shows it in a drop-down. Pick a model and save it — the choice is remembered for next time. If the list shows an error instead of models, the server is off or runs on a different port.

The list may include all downloaded models, not just the ones loaded into memory: that’s how LM Studio works with on-demand (JIT) loading enabled. The model loads on the first request, so the first answer takes noticeably longer than the rest.

Run selected queries

Each selected cell is a ready prompt. The add-in sends the cells to the model one by one and writes the answers in their place. Copy the column before running if you want to keep the source data next to the results.

Run selected with preprompt

This command asks for a unified prompt prefix, for example “Classify the product: electronics, clothing, home, other. Return one word”. The prefix is added to every cell with a colon, so the cells can contain just the data. Without it you would first have to add text to all cells.

Prompt prefixCellModel answer
Classify the review sentiment: positive, negative, neutralDelivered fast, but the box was crushedneutral
Extract the brand, return one wordSamsung Galaxy A55 smartphone 8/256Samsung
Translate into Spanish20% off all shoes20% de descuento en todo el calzado

In the free version of !SEMTools both commands process about 2/3 of the cells; the rest get the text “!SEMTools – available in full version”, and no request is sent to the model for them.

Which local model to choose for spreadsheets

There is no universal answer, but here are some guidelines:

  • 4–8 billion parameters — tagging, classification, extracting a brand or city, short rewrites; runs on most laptops;
  • 12–14 billion — more coherent texts and complex instructions; needs a GPU with 8–12 GB of memory or plenty of RAM;
  • 20 billion and more — closer to cloud models, but very slow without a powerful GPU.

For texts in languages other than English, pick models with good multilingual training, such as the Qwen or Gemma families. And the main tip: test the prompt on 10–20 rows and check the answers yourself before running it on the whole column.

Why LM Studio doesn’t answer in Excel: common errors

  • Error instead of the model list — the server is off or not on port 1234. Turn on Start server on the Developer tab.
  • “No model selected” — open Choose model, pick a model and save it.
  • “Error: 401” — required authentication is on in LM Studio. Turn it off.
  • “Error: 400” on some cells — the text contains double quotes or line breaks, which the LM Studio menu doesn’t escape. Remove them from the cells before running.
  • Timeout error — the model takes more than a minute per request. Use a smaller model, shorten the prompt or ask for a short answer.
  • Answers in the wrong language or format — state the language and format in the prompt (“answer in English, one word”).

Process whole columns with a local AI model right in Excel: one prompt for all cells, answers in place, data never leaves your computer.
!SEMTools solves this and hundreds of other tasks in a couple of clicks!

Summary: when LM Studio beats cloud AI

I hope you found what you were looking for on this page and were able to connect LM Studio to Excel. A local model is the best choice when data can’t go to the cloud, when there are lots of rows, or when you don’t want to pay for every request. For complex tasks and long texts cloud models are still stronger: try Claude or hundreds of models via OpenRouter.