Most teams who try a local language model start with LM Studio. It is a desktop app for Mac, Windows and Linux that downloads open models, runs them on your laptop’s GPU or CPU, and, with one switch, serves them through an OpenAI-compatible HTTP API. If you already run a self-hosted Ethora server, that API is all you need to put an AI agent in your chat rooms that never sends a word to a cloud model.

This tutorial does exactly that. It is the LM Studio variant of our Ollama example: the same four environment variables, a different local server.

What you need

  • A self-hosted Ethora install with the AI service enabled. The AI service talks to any OpenAI-compatible endpoint; that is the whole trick.
  • A Postgres database with the pgvector extension for the agent’s knowledge base. The Ollama example repo ships a compose file that starts one and creates the documents table; reuse it as is.
  • LM Studio 0.3 or newer on a machine the Ethora server can reach. For a first run, the same machine is simplest.
  • Two models downloaded in LM Studio: a chat model and an embedding model. A 3B to 8B instruct model (Qwen 2.5, Llama 3.x or Gemma) runs on most laptops; for embeddings pick a model that can return 256-dimension vectors, such as nomic-embed-text, because the Ethora AI service asks for 256 dimensions to match its vector column.

Step 1: start the LM Studio server

Open LM Studio, load the chat model, then switch on the local server from the Developer tab. By default it listens on port 1234 and exposes the OpenAI routes: /v1/models, /v1/chat/completions and /v1/embeddings. Load the embedding model as well so both routes answer.

Prefer a terminal or a headless machine? The lms CLI that ships with LM Studio does the same:


lms server start
lms load qwen2.5-7b-instruct
lms load nomic-embed-text-v1.5
curl http://localhost:1234/v1/models

The last command lists the loaded models. Their ids are what you put in the Ethora configuration.

If LM Studio runs on a different machine from the Ethora server, enable “serve on local network” in the server settings and use that machine’s address instead of localhost. Keep it inside your network: the server has no authentication of its own.

Step 2: point the Ethora AI service at it

On the Ethora server, add four lines to the AI service environment file, the same four the Ollama example uses, and restart the service:


AI_API_URL=http://localhost:1234/v1
AI_API_KEY=lm-studio
AI_CHAT_MODEL=qwen2.5-7b-instruct
AI_EMBEDDING_MODEL=nomic-embed-text-v1.5

The key can be any string; LM Studio ignores it, but the client sends one. The model ids must match what /v1/models returned.

Verify the two calls the service makes:


curl -s http://localhost:1234/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model":"qwen2.5-7b-instruct","messages":[{"role":"user","content":"Say hello in five words."}]}'
curl -s http://localhost:1234/v1/embeddings -H 'Content-Type: application/json' \
  -d '{"model":"nomic-embed-text-v1.5","input":"test","dimensions":256}' | grep -o '"embedding":\[[^]]*' | tr ',' '\n' | wc -l

You want a sentence back from the first and 256 from the second. If the embedding count is 768 or 1024, the model or the server ignored the dimensions parameter; choose an embedding model that honours it, or the knowledge base inserts will fail.

Step 3: give the agent a persona and a knowledge base

Open the Ethora admin panel, create or edit an AI agent, write its persona in the system prompt and crawl your website or upload documents into its knowledge base. Then start the agent and send it a message in a room.

Do not skip the knowledge base. Small local models invent answers when they have nothing to ground on. In our Ollama tests, a 3B model asked “What is Ethora?” with an empty knowledge base described a cryptocurrency exchange. With the website crawled, it answered correctly.

What to expect

Measured with the Ollama setup on a 4 vCPU, 8 GB Linux VM without a GPU, a 3B model answered in 6 to 8 seconds per short reply after a 33-second first reply while the model loaded. On an Apple M-series laptop the raw model calls take under half a second once warm. LM Studio on the same hardware lands in the same range; a GPU brings 7B models into the one-to-two-second band.

The model setting is service-wide. Ethora lets you choose a model name per agent, but every agent talks to the same endpoint, so run one LM Studio server with the models you need loaded.

When to move past LM Studio

LM Studio is the quickest way to try a local model and the right tool for a single developer or a small internal pilot. For a server that many people depend on, move the same configuration to Ollama (our example repo) or to vLLM for throughput on a GPU box; the Ethora side does not change because all three speak the same API.

Why bother

Because the conversation never leaves your infrastructure. For a clinic, a bank or any team under a data processing agreement, a local model plus a self-hosted chat server means the prompts, the documents and the answers stay on hardware you control. Read more about the trade-offs in our guide to self-hosted LLM chatbots and in the glossary entries for local LLM and private LLM.