LLM connections
The Agent answers questions with a language model (LLM). That model is a plant-local, OpenAI-compatible endpoint, by default Ollama on the same host. You set it with environment variables on the mi-agent service.
- LLM connection (this page): the model the Agent's own chat uses. Set on the
mi-agentservice. There is no setting for it in the Console UI. - AI connections (Settings → AI connections): external assistants such as Claude that connect to the Console over MCP. They bring their own model. See MCP server.
How it works
The Agent sends the conversation and the plant data it needs to the endpoint you configure. If that endpoint is inside the plant, nothing leaves it. The design is plant-local and works without internet access.
The Agent sends whatever URL you configure. If you set MI_AGENT_LLM_BASE_URL to a cloud service, plant data in the prompts goes there. Egress rules from Governance apply to what the Console returns to the Agent, but they cannot control a model server you choose. Keep the endpoint on the plant network.
Step by step
-
Run an OpenAI-compatible server in the plant. With Ollama:
ollama serveollama pull qwen2.5:3b -
Set these variables on the
mi-agentservice:MI_AGENT_LLM_BASE_URL=http://127.0.0.1:11434/v1MI_AGENT_LLM_API_KEY=ollamaMI_AGENT_LLM_MODEL=qwen2.5:3bMI_CONSOLE_URL=http://127.0.0.1:8080 -
Restart
mi-agent. -
Open Plant → Agent → Chat and ask "How many devices do we have?". Counts and lists are answered by built-in fast paths; ask a question about a value or an alarm to test the model itself.
Settings reference
| Variable | Default | Notes |
|---|---|---|
MI_AGENT_LLM_BASE_URL | http://127.0.0.1:11434/v1 | The Agent calls chat/completions under this base URL. Fallback variable: OPENAI_BASE_URL. |
MI_AGENT_LLM_API_KEY | ollama | Fallbacks in order: OPENAI_API_KEY, then the file named by MI_AGENT_LLM_API_KEY_FILE. Prefer the file for real keys. |
MI_AGENT_LLM_MODEL | qwen2.5:3b | Model name as the server knows it. |
MI_CONSOLE_URL | http://127.0.0.1:8080 | Console the Agent reads from. |
MI_AGENT_LISTEN | :8095 | Listen address. |
MI_AGENT_DATA_DIR | /var/lib/mi-agent | Graph links, proposals, audit. |
Timeouts: a model call may take up to 10 minutes, a Console call 45 seconds. One chat turn uses at most 8 tool rounds.
Choosing a model
The product ships with qwen2.5:3b as the default and tests against it. Beyond that, these are general rules, not measured results for MakeIntelligent:
| Need | Guidance |
|---|---|
| Short lookups and counts | A small model is enough; the fast paths do not need a model at all. |
| Explaining alarms, comparing periods, multi-step questions | Use a larger model. The Agent can call up to 8 tools per question, and small models tend to lose track. |
| Turkish and English | The chat handles both; choose a model that supports your language well. |
| Hardware | A larger model needs a GPU or plenty of RAM on the model host. Size it before you roll it out; the model host is not part of the MakeIntelligent images. |
| Tool use | The model must be served through an OpenAI-compatible chat API that supports tool calling. Test with a real question before you rely on it. |
Limits and good practice
- The model never writes to the plant. Changes become proposals that a person approves. See Approvals and safe write.
- Whatever the model says, check numbers against See and the unit and quality shown there.
- Keep the model server on the plant network, bound to a plant address, and do not expose it to the internet.
- The Agent does not offer a model picker in the UI. Changing the model means changing the variable and restarting the service.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Chat never answers | Model server down or wrong MI_AGENT_LLM_BASE_URL. | Open the URL from the mi-agent host; include /v1. |
| Answers are cut off or empty | Model too small, or the model is still loading. | Warm the model or use a larger one. |
| "Agent service is unavailable" | mi-agent not running. | Check the service. |
| 401 from the model server | Wrong MI_AGENT_LLM_API_KEY. | Set the key the server expects. |