Ollama
The robomotion ollama CLI connects to a local Ollama instance for running LLMs on your own hardware. It supports text generation, chat completions with history, embedding generation, model listing, and model management (pull/delete).
When to use
- Generate text using local models (Llama, Mistral, etc.)
- Run multi-turn chat conversations locally
- Generate text embeddings for semantic search
- List, pull, or delete Ollama models
Prerequisites
robomotionCLI installed- Package installed:
robomotion install ollama - Ollama running locally or on an accessible server
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install ollama - Connect with session:
robomotion ollama ollama_connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion ollama ollama_generate --client-id "<client-id>" --model llama3 --prompt <text> --session-id "<session-id>" --output json - Disconnect when done:
robomotion ollama ollama_disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion ollama connect_ollama --session --output jsonConnect to Ollama server and create a client session for local LLM operationsrobomotion ollama disconnect_ollama --client-id --session-id "<session-id>" --output jsonDisconnect from Ollama server and release the client sessionrobomotion ollama generate_completion --client-id --model --prompt [--options] [--host-url] --session-id "<session-id>" --output jsonGenerate text completion using a local Ollama modelrobomotion ollama generate_chat_completion --client-id --model --messages [--options] [--host-url] --session-id "<session-id>" --output jsonGenerate chat responses using a local Ollama model with conversation historyrobomotion ollama list_models --client-id [--host-url] --session-id "<session-id>" --output jsonList all locally available Ollama modelsrobomotion ollama show_model_info --client-id --model [--host-url] --session-id "<session-id>" --output jsonGet detailed information about a local Ollama modelrobomotion ollama delete_model --client-id --model [--host-url] --session-id "<session-id>" --output jsonDelete a local Ollama modelrobomotion ollama pull_model --client-id --model [--host-url] --session-id "<session-id>" --output jsonDownload a model from the Ollama library to local storagerobomotion ollama generate_embeddings --client-id --model --prompt [--host-url] --session-id "<session-id>" --output jsonGenerate vector embeddings for text using a local Ollama model
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)