Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计提醒

ollamaOllama 搜索

Agent Skill

ollama 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,481

周安装

148

GitHub Stars

31

下载量

1,220
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ollama(Ollama 搜索)
来源仓库:https://github.com/rawveg/skillsforge-marketplace
仓库路径:skills/ollama
安装命令:
npx skills add https://github.com/rawveg/skillsforge-marketplace --skill ollama
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/rawveg/skillsforge-marketplace --skill ollama

简介

ollama 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 它可辅助 Ollama 相关技术的聚合与初步筛选,提升 Agent 在模型管理阶段的效率。
  • 通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • ollama 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Ollama Skill

Comprehensive assistance with Ollama development - the local AI model runtime for running and interacting with large language models programmatically.

When to Use This Skill

This skill should be triggered when:

  • Running local AI models with Ollama
  • Building applications that interact with Ollama's API
  • Implementing chat completions, embeddings, or streaming responses
  • Setting up Ollama authentication or cloud models
  • Configuring Ollama server (environment variables, ports, proxies)
  • Using Ollama with OpenAI-compatible libraries
  • Troubleshooting Ollama installations or GPU compatibility
  • Implementing tool calling, structured outputs, or vision capabilities
  • Working with Ollama in Docker or behind proxies
  • Creating, copying, pushing, or managing Ollama models

Quick Reference

1. Basic Chat Completion (cURL)

Generate a simple chat response:

curl http://localhost:11434/api/chat -d '{
  "model": "gemma3",
  "messages": [
    {
      "role": "user",
      "content": "Why is the sky blue?"
    }
  ]
}'

2. Simple Text Generation (cURL)

Generate a text response from a prompt:

curl http://localhost:11434/api/generate -d '{
  "model": "gemma3",
  "prompt": "Why is the sky blue?"
}'

3. Python Chat with OpenAI Library

Use Ollama with the OpenAI Python library:

from openai import OpenAI

client = OpenAI(
    base_url='http://localhost:11434/v1/',
    api_key='ollama',  # required but ignored
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            'role': 'user',
            'content': 'Say this is a test',
        }
    ],
    model='llama3.2',
)

4. Vision Model (Image Analysis)

Ask questions about images:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1/", api_key="ollama")

response = client.chat.completions.create(
    model="llava",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What's in this image?"},
                {
                    "type": "image_url",
                    "image_url": "data:image/png;base64,iVBORw0KG...",
                },
            ],
        }
    ],
    max_tokens=300,
)

5. Generate Embeddings

Create vector embeddings for text:

client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")

embeddings = client.embeddings.create(
    model="all-minilm",
    input=["why is the sky blue?", "why is the grass green?"],
)

6. Structured Outputs (JSON Schema)

Get structured JSON responses:

from pydantic import BaseModel
from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")

class FriendInfo(BaseModel):
    name: str
    age: int
    is_available: bool

class FriendList(BaseModel):
    friends: list[FriendInfo]

completion = client.beta.chat.completions.parse(
    temperature=0,
    model="llama3.1:8b",
    messages=[
        {"role": "user", "content": "Return a list of friends in JSON format"}
    ],
    response_format=FriendList,
)

friends_response = completion.choices[0].message
if friends_response.parsed:
    print(friends_response.parsed)

7. JavaScript/TypeScript Chat

Use Ollama with the OpenAI JavaScript library:

import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "http://localhost:11434/v1/",
  apiKey: "ollama",  // required but ignored
});

const chatCompletion = await openai.chat.completions.create({
  messages: [{ role: "user", content: "Say this is a test" }],
  model: "llama3.2",
});

8. Authentication for Cloud Models

Sign in to use cloud models:

# Sign in from CLI
ollama signin

# Then use cloud models
ollama run gpt-oss:120b-cloud

Or use API keys for direct cloud access:

export OLLAMA_API_KEY=your_api_key

curl https://ollama.com/api/generate \
  -H "Authorization: Bearer $OLLAMA_API_KEY" \
  -d '{
    "model": "gpt-oss:120b",
    "prompt": "Why is the sky blue?",
    "stream": false
  }'

9. Configure Ollama Server

Set environment variables for server configuration:

macOS:

# Set environment variable
launchctl setenv OLLAMA_HOST "0.0.0.0:11434"

# Restart Ollama application

Linux (systemd):

# Edit service
systemctl edit ollama.service

# Add under [Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"

# Reload and restart
systemctl daemon-reload
systemctl restart ollama

Windows:

1. Quit Ollama from task bar
2. Search "environment variables" in Settings
3. Edit or create OLLAMA_HOST variable
4. Set value: 0.0.0.0:11434
5. Restart Ollama from Start menu

10. Check Model GPU Loading

Verify if your model is using GPU:

ollama ps

Output shows:

  • 100% GPU - Fully loaded on GPU
  • 100% CPU - Fully loaded in system memory
  • 48%/52% CPU/GPU - Split between both

Key Concepts

Base URLs

  • Local API (default): http://localhost:11434/api
  • Cloud API: https://ollama.com/api
  • OpenAI Compatible: /v1/ endpoints for OpenAI libraries

Authentication

  • Local: No authentication required for http://localhost:11434
  • Cloud Models: Requires signing in (ollama signin) or API key
  • API Keys: For programmatic access to https://ollama.com/api

Models

  • Local Models: Run on your machine (e.g., gemma3, llama3.2, qwen3)
  • Cloud Models: Suffix -cloud (e.g., gpt-oss:120b-cloud, qwen3-coder:480b-cloud)
  • Vision Models: Support image inputs (e.g., llava)

Common Environment Variables

  • OLLAMA_HOST - Change bind address (default: 127.0.0.1:11434)
  • OLLAMA_CONTEXT_LENGTH - Context window size (default: 2048 tokens)
  • OLLAMA_MODELS - Model storage directory
  • OLLAMA_ORIGINS - Allow additional web origins for CORS
  • HTTPS_PROXY - Proxy server for model downloads

Error Handling

Status Codes:

  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 404 - Not Found (model doesn't exist)
  • 429 - Too Many Requests (rate limit)
  • 500 - Internal Server Error
  • 502 - Bad Gateway (cloud model unreachable)

Error Format:

{
  "error": "the model failed to generate a response"
}

Streaming vs Non-Streaming

  • Streaming (default): Returns response chunks as JSON objects (NDJSON)
  • Non-Streaming: Set "stream": false to get complete response in one object

Reference Files

This skill includes comprehensive documentation in references/:

  • llms-txt.md - Complete API reference covering:

- All API endpoints (/api/generate, /api/chat, /api/embed, etc.) - Authentication methods (signin, API keys) - Error handling and status codes - OpenAI compatibility layer - Cloud models usage - Streaming responses - Configuration and environment variables

  • llms.md - Documentation index listing all available topics:

- API reference (version, model details, chat, generate, embeddings) - Capabilities (embeddings, streaming, structured outputs, tool calling, vision) - CLI reference - Cloud integration - Platform-specific guides (Linux, macOS, Windows, Docker) - IDE integrations (VS Code, JetBrains, Xcode, Zed, Cline)

Use the reference files when you need:

  • Detailed API parameter specifications
  • Complete endpoint documentation
  • Advanced configuration options
  • Platform-specific setup instructions
  • Integration guides for specific tools

Working with This Skill

For Beginners

Start with these common patterns:

  1. Simple generation: Use /api/generate endpoint with a prompt
  2. Chat interface: Use /api/chat with messages array
  3. OpenAI compatibility: Use OpenAI libraries with base_url='http://localhost:11434/v1/'
  4. Check GPU usage: Run ollama ps to verify model loading

Read llms-txt.md section on "Introduction" and "Quickstart" for foundational concepts.

For Intermediate Users

Focus on:

  • Embeddings for semantic search and RAG applications
  • Structured outputs with JSON schema validation
  • Vision models for image analysis
  • Streaming for real-time response generation
  • Authentication for cloud models

Check the specific API endpoints in llms-txt.md for detailed parameter options.

For Advanced Users

Explore:

  • Tool calling for function execution
  • Custom model creation with Modelfiles
  • Server configuration with environment variables
  • Proxy setup for network-restricted environments
  • Docker deployment with custom configurations
  • Performance optimization with GPU settings

Refer to platform-specific sections in llms.md and configuration details in llms-txt.md.

Common Use Cases

Building a chatbot:

  1. Use /api/chat endpoint
  2. Maintain message history in your application
  3. Stream responses for better UX
  4. Handle errors gracefully

Creating embeddings for search:

  1. Use /api/embed endpoint
  2. Store embeddings in vector database
  3. Perform similarity search
  4. Implement RAG (Retrieval Augmented Generation)

Running behind a firewall:

  1. Set HTTPS_PROXY environment variable
  2. Configure proxy in Docker if containerized
  3. Ensure certificates are trusted

Using cloud models:

  1. Run ollama signin once
  2. Pull cloud models with -cloud suffix
  3. Use same API endpoints as local models

Troubleshooting

Model Not Loading on GPU

Check:

ollama ps

Solutions:

  • Verify GPU compatibility in documentation
  • Check CUDA/ROCm installation
  • Review available VRAM
  • Try smaller model variants

Cannot Access Ollama Remotely

Problem: Ollama only accessible from localhost

Solution:

# Set OLLAMA_HOST to bind to all interfaces
export OLLAMA_HOST="0.0.0.0:11434"

See "How do I configure Ollama server?" in llms-txt.md for platform-specific instructions.

Proxy Issues

Problem: Cannot download models behind proxy

Solution:

# Set proxy (HTTPS only, not HTTP)
export HTTPS_PROXY=https://proxy.example.com

# Restart Ollama

See "How do I use Ollama behind a proxy?" in llms-txt.md.

CORS Errors in Browser

Problem: Browser extension or web app cannot access Ollama

Solution:

# Allow specific origins
export OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*"

See "How can I allow additional web origins?" in llms-txt.md.

Resources

Official Documentation

Official Libraries

Community

Notes

  • This skill was generated from official Ollama documentation
  • All examples are tested and working with Ollama's API
  • Code samples include proper language detection for syntax highlighting
  • Reference files preserve structure from official docs with working links
  • OpenAI compatibility means most OpenAI code works with minimal changes

Quick Command Reference

# CLI Commands
ollama signin                    # Sign in to ollama.com
ollama run gemma3               # Run a model interactively
ollama pull gemma3              # Download a model
ollama ps                       # List running models
ollama list                     # List installed models

# Check API Status
curl http://localhost:11434/api/version

# Environment Variables (Common)
export OLLAMA_HOST="0.0.0.0:11434"
export OLLAMA_CONTEXT_LENGTH=8192
export OLLAMA_ORIGINS="*"
export HTTPS_PROXY="https://proxy.example.com"

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

25.76%
按下载量换算314

OpenCode

23.02%
按下载量换算281

Cursor

17.14%
按下载量换算209

Gemini CLI

13.19%
按下载量换算161

Antigravity

7.92%
按下载量换算97

windsurf

3.22%
按下载量换算39

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills