ollama
Ollama 本地大模型调用技能。支持通过 API 与 Ollama 实例交互进行文本生成。 Use when: (1) 需要调用本地或远程 Ollama 模型 (2) 需要执行 LLM 推理任务 (3) 需要通过 Python 脚本与特定 Ollama 实例 (如 qwen3.5:9b) 交互。
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ayflying/ollama-2What This Skill Does
The ollama skill acts as a bridge between the OpenClaw AI agent framework and local or remote Ollama instances. By leveraging the Ollama API, this skill allows users to execute powerful Large Language Model (LLM) inference tasks directly within their local or private network environment. It eliminates the need for expensive cloud tokens, providing a cost-effective and privacy-focused approach to text generation, summarization, and reasoning tasks. The skill handles the complexities of request formatting, authentication (if configured via environment variables), and model selection, allowing developers to focus on the prompt engineering rather than the underlying network communication.
Installation
To integrate the ollama skill into your OpenClaw workspace, ensure you have the npx utility available on your machine. Execute the following command in your terminal:
npx skills add ayflying/ai-skills --skill ollama
Alternatively, you can utilize the clawhub registry:
clawhub install openclaw/skills/skills/ayflying/ollama-2
Ensure that you have the Ollama service running on your machine or designated server before attempting the first execution. You must also satisfy the Python dependencies by running pip install requests in your virtual environment. Don't forget to configure your specific endpoints in the provided .env file.
Use Cases
- Offline Reasoning: Perform complex logical tasks without requiring an active internet connection to public cloud APIs.
- Data Privacy: Keep sensitive company documents or personal prompts contained within your local infrastructure.
- Model Comparison: Rapidly switch between different model variants (e.g., qwen2.5, llama3) to evaluate output quality for specific tasks.
- Automated Workflows: Embed LLM reasoning as a step within larger automated script chains by calling the query script programmatically.
Example Prompts
- "查询并简述一下量子纠缠的物理原理,请用通俗易懂的语言解释。"
- "使用 qwen2.5:7b 模型帮我分析以下这段代码的性能瓶颈:[代码片段]"
- "请基于我提供的文档内容,写一份针对该项目的技术评估报告。"
Tips & Limitations
- Model Availability: You must manually pull models using
ollama pull <model_name>before the skill can invoke them. If you attempt to call a model that isn't pulled, the skill will return an error. - Hardware Constraints: Large models (like 9b or higher) require significant RAM/VRAM. Ensure your hardware matches the model's requirements to avoid high latency or system crashes.
- Environment Variables: Always verify that
OLLAMA_HOSTis correctly set if you are connecting to a remote server; incorrect configuration is the most common cause of connection timeouts. - Security: Since this skill performs network requests, ensure that your Ollama server instance is protected by a firewall if exposed to a wider network, as the current implementation assumes a trusted environment.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ayflying-ollama-2": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, code-execution