Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #5363

ollama-stack

Skill này làm gì

Công cụ này cho phép bạn chạy các mô hình ngôn ngữ lớn (AI) trực tiếp trên máy tính của mình, riêng tư và không cần internet. Bạn có thể dùng các mô hình như Llama 3 hoặc CodeLlama cho nhiều tác vụ khác nhau.

Khi nào nên dùng

  • ✓Khi muốn dùng AI mà không cần kết nối internet.
  • ✓Khi muốn thử nghiệm mô hình AI trước khi dùng trong các dự án lớn.
  • ✓Khi muốn giữ dữ liệu và mô hình AI an toàn trên máy tính riêng.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ollama-stack/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ollama-stack/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thiết lập một mô hình AI trên máy tính của tôi để trả lời các câu hỏi lập trình.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn cài Ollama, một chương trình để chạy AI. Sau đó, bạn tải các mô hình AI mong muốn và có thể dùng chúng qua lệnh hoặc giao diện web.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Ollama Stack

Deploy a local LLM stack for offline and privacy-first workflows.

When to Use This Skill

Use this skill when:

  • Setting up private/local LLM inference for development
  • Building air-gapped AI environments
  • Running models on personal hardware (Mac, Linux, Windows with GPU)
  • Creating team-shared inference endpoints
  • Prototyping before committing to cloud LLM APIs

Prerequisites

  • 8 GB+ RAM (16 GB+ recommended for 7B+ models)
  • For GPU acceleration: NVIDIA GPU with 6 GB+ VRAM, or Apple Silicon Mac
  • Docker (for containerized deployment)
  • 20 GB+ disk for model storage

Quick Start

# Install Ollama
curl -fsSL https://ollama.com/install.sh -o /tmp/install-ollama.sh && sh /tmp/install-ollama.sh && rm /tmp/install-ollama.sh

# Start the server
ollama serve

# Pull and run a model
ollama pull llama3.1:8b
ollama run llama3.1:8b "Explain Kubernetes pods in one paragraph"

# List available models
ollama list

# Pull specific quantization
ollama pull llama3.1:8b-instruct-q4_K_M

Model Selection Guide

Model Size VRAM Best For
llama3.1:8b 4.7 GB 6 GB General chat, coding
llama3.1:70b 40 GB 48 GB Complex reasoning
codellama:13b 7.4 GB 10 GB Code generation
mistral:7b 4.1 GB 6 GB Fast general tasks
mixtral:8x7b 26 GB 32 GB High-quality MoE
nomic-embed-text 274 MB 1 GB Embeddings for RAG
llava:13b 8 GB 10 GB Vision + text
deepseek-coder-v2:16b 9 GB 12 GB Code generation
qwen2.5:14b 9 GB 12 GB Multilingual, reasoning

Docker Compose — Full Stack

# docker-compose.yml
services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    restart: unless-stopped
    ports:
      - "11434:11434"
    volumes:
      - ollama_data:/root/.ollama
    environment:
      - OLLAMA_HOST=0.0.0.0
      - OLLAMA_NUM_PARALLEL=4
      - OLLAMA_MAX_LOADED_MODELS=2
      - OLLAMA_FLASH_ATTENTION=1
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
      interval: 30s
      timeout: 10s
      retries: 3

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    restart: unless-stopped
    ports:
      - "3000:8080"
    volumes:
      - webui_data:/app/backend/data
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
      - WEBUI_AUTH=true
      - WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY:-change-me-in-production}
      - DEFAULT_MODELS=llama3.1:8b
    depends_on:
      ollama:
        condition: service_healthy

  litellm:
    image: ghcr.io/berriai/litellm:main-latest
    container_name: litellm
    restart: unless-stopped
    ports:
      - "4000:4000"
    volumes:
      - ./litellm-config.yaml:/app/config.yaml
    command: ["--config", "/app/config.yaml"]
    depends_on:
      ollama:
        condition: service_healthy

volumes:
  ollama_data:
  webui_data:

LiteLLM Proxy Config

# litellm-config.yaml
model_list:
  - model_name: llama3
    litellm_params:
      model: ollama/llama3.1:8b
      api_base: http://ollama:11434
  - model_name: codellama
    litellm_params:
      model: ollama/codellama:13b
      api_base: http://ollama:11434
  - model_name: embeddings
    litellm_params:
      model: ollama/nomic-embed-text
      api_base: http://ollama:11434

general_settings:
  master_key: sk-local-dev-key
  max_budget: 0  # unlimited for local

API Usage

Ollama exposes an OpenAI-compatible API:

# Chat completion
curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.1:8b",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": false
  }'

# Embeddings
curl http://localhost:11434/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nomic-embed-text",
    "input": "The quick brown fox"
  }'

# List models
curl http://localhost:11434/api/tags

Python Client

# pip install ollama
import ollama

# Chat
response = ollama.chat(
    model="llama3.1:8b",
    messages=[{"role": "user", "content": "Explain Docker in 3 sentences"}],
)
print(response["message"]["content"])

# Streaming
for chunk in ollama.chat(
    model="llama3.1:8b",

…
Câu hỏi thường gặp

Tôi có cần máy tính mạnh không?

Tùy vào mô hình AI. Với các mô hình nhỏ, 8GB RAM là đủ. Với mô hình lớn hơn hoặc để dùng card đồ họa (GPU), bạn cần nhiều RAM và VRAM hơn.

Hệ điều hành nào hoạt động được?

Nó hoạt động trên Mac, Linux và Windows, miễn là bạn đã cài Docker.

“Quantizations” như q4_K_M là gì?

Đây là các phiên bản nhỏ hơn, nhanh hơn của mô hình AI, dùng ít bộ nhớ và dung lượng đĩa hơn, đổi lại chất lượng giảm nhẹ.

Chi tiết

Mô tả gốc của tác giả

Run local LLM workloads with Ollama, Open WebUI, and GPU-aware tuning for private development environments.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5363
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự