Overview
A client-mode connector for a curated slice of the Ollama API focused on IIoT / edge alarm text into local LLMs (no cloud):
Default
BASE_ADDRESS is http://127.0.0.1:11434 with USE_SSL "false" (no trailing slash). For an HTTPS reverse proxy, set USE_SSL "true" and point BASE_ADDRESS at https://your-host. Topics use ai/ollama/<object>/<verb>. REQUEST_TIMEOUT is 120 for cold model load + inference.
See the base guide: REST API Connectors.
Auth: none required for local Ollama. A reverse proxy may require
Authorization: Bearer <token> — add that header and map Hub secrets into MQTT api_token if needed.Basic Syntax
OllamaRestApi.lot in the factory package (no ADD METADATA).
Topics
Configuration
- Run Ollama locally (e.g.
docker run -d -p 11434:11434 ollama/ollama) and pull a model (ollama pull tinyllama). - Set
BASE_ADDRESStohttp://127.0.0.1:11434(or your LAN/Docker host). KeepUSE_SSL "false"for plain HTTP; use HTTPS +USE_SSL "true"behind a reverse proxy. - For edge alarm classification: publish to
ai/ollama/generate/postwith"stream": falseand optional"format": "json"/ JSON schema. - For chat-style prompts: publish to
ai/ollama/chat/postwith amessagesarray and"stream": false. - Use
GetTagsas a cheap health / model-list smoke before production workloads. - Optional OpenAI-shaped clients can use
GetModels/PostChatCompletionsunder/v1/....

