ollama
БесплатноБез исполняемых скриптовНе проверенRuns LLMs locally with Ollama. Use when a user asks to run AI models locally, self-host a language model, use Gemma, Qwen, Llama or Mistral on their machine…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Ollama
Overview
Ollama runs open-weight language models on your own hardware: ollama run gemma4 downloads a model and opens a chat. A local server on http://localhost:11434 serves a native API (/api/*) plus OpenAI-compatible (/v1/chat/completions, /v1/responses, /v1/embeddings) and Anthropic-compatible (/v1/messages) endpoints, with no API key and no per-token cost. This skill covers installation, model management, API integration from Node.js and Python, structured output, custom models, and context/GPU configuration.
Instructions
Step 1: Installation
# macOS (Homebrew formula: CLI + server; `brew services start ollama` runs it in the background)
brew install ollama
# Docker, CPU only
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
# Docker with NVIDIA GPUs (needs the NVIDIA Container Toolkit on the host)
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
# Linux without Docker: download the release archive, verify it, then extract (needs the zstd package)
curl -fsSLO https://github.com/ollama/ollama/releases/latest/download/ollama-linux-amd64.tar.zst
curl -fsSLO https://github.com/ollama/ollama/releases/latest/download/sha256sum.txt
sha256sum --ignore-missing -c sha256sum.txt # must print "./ollama-linux-amd64.tar.zst: OK"
sudo tar --zstd -xf ollama-linux-amd64.tar.zst -C /usr
ollama serve # foreground; see docs.ollama.com/linux for the systemd unit
# Verify
ollama -v
ARM64 Linux uses ollama-linux-arm64.tar.zst; AMD GPUs additionally need ollama-linux-amd64-rocm.tar.zst (Docker: the ollama/ollama:rocm tag). macOS and Windows desktop installers are at https://ollama.com/download.
Step 2: Download and Run Models
ollama run gemma4 # Google Gemma 4 — downloads on first use, then opens a chat (/bye to exit)
ollama run gpt-oss:20b # OpenAI open-weight reasoning model
ollama run deepseek-r1:8b # DeepSeek R1 reasoning model
ollama run llama3.2 # small Meta model (~2 GB)
ollama pull embeddinggemma # embedding model, download only
ollama run gemma4 "Summarize: $(cat CHANGELOG.md)" # one-shot prompt, prints and exits
ollama run gemma4 --format json "List three HTTP methods as JSON"
ollama list # downloaded models (alias: ollama ls)
ollama show gemma4 # architecture, context length, capabilities, parameters
ollama ps # loaded models, CPU/GPU split, context size
ollama stop gemma4 # unload from memory now
ollama rm llama3.2 # delete a downloaded model
Tags select a size or variant (gemma4:e2b, llama3.1:70b); browse them at https://ollama.com/library.
Step 3: REST API
The native API lives under /api, the OpenAI-compatible one under /v1. The local server needs no authentication.
# Chat (native). Without "stream": false the reply is a stream of JSON lines.
curl http://localhost:11434/api/chat -d '{
"model": "gemma4",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is a closure in JavaScript?"}
],
"stream": false,
"options": {"temperature": 0.3, "num_ctx": 8192}
}'
# → {"model":"gemma4","message":{"role":"assistant","content":"..."},"done":true,"done_reason":"stop",...}
# Chat (OpenAI-compatible)
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "gemma4", "messages": [{"role": "user", "content": "Explain recursion in one paragraph."}]}'
# Embeddings — use an embedding model, not a chat model
curl http://localhost:11434/api/embed -d '{
"model": "embeddinggemma",
"input": ["How to deploy a Node.js app", "Rotate the database password"]
}'
# → {"model":"embeddinggemma","embeddings":[[...768 floats...],[...]],...}
# Thinking models: "think": true|false (or a level such as "low" for gpt-oss);
# reasoning arrives in message.thinking, the answer in message.content
curl http://localhost:11434/api/chat -d '{
"model": "deepseek-r1:8b",
"messages": [{"role": "user", "content": "How many r are in strawberry?"}],
"think": true, "stream": false
}'
Step 4: Node.js Integration
// lib/local-ai.ts — Use Ollama from Node.js via the OpenAI-compatible API
// npm install openai (the native client is `npm install ollama`)
import OpenAI from 'openai'
const ollama = new OpenAI({
baseURL: 'http://localhost:11434/v1',
apiKey: 'ollama', // required by the SDK, ignored by Ollama
})
const response = await ollama.chat.completions.create({
model: 'gemma4',
messages: [
{ role: 'system', content: 'You are a code review assistant.' },
{ role: 'user', content: 'Review this function:\n\nfunction add(a, b) { return a + b; }' },
],
temperature: 0.3,
})
console.log(response.choices[0].message.content)
// Streami
Установить ollama в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ollama?
Runs LLMs locally with Ollama. Use when a user asks to run AI models locally, self-host a language model, use Gemma, Qwen, Llama or Mistral on their machine, run offline AI, build a local chatbot, avoid sending data to cloud AI providers, generate text without API costs, customize local models, or set up a private AI inference server. Covers model management, the native and OpenAI-compatible APIs, structured output, embeddings, Modelfile customization, context length and GPU configuration.
Как установить скилл ollama?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ollama запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic