[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EFPC0P0R9630AF6YSKJDE8":3,"skill-same:01M6EFPC0P0R9630AF6YSKJDE8":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6EFPC0P0R9630AF6YSKJDE8","ollama",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Follama\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# Ollama\n\n## Overview\n\nOllama makes running large language models locally as simple as `ollama run llama3`. No cloud API, no API keys, no per-token costs — models run entirely on your hardware. It supports LLaMA 3, Mistral, Phi, Gemma, CodeLlama, and dozens of other open models. This skill covers model management, API integration, custom model configuration, GPU setup, and building applications with local LLMs.\n\n## Instructions\n\n### Step 1: Installation\n\n```bash\n# Linux\ncurl -fsSL https:\u002F\u002Follama.com\u002Finstall.sh | sh\n\n# macOS\nbrew install ollama\n\n# Docker\ndocker run -d --gpus all -v ollama_data:\u002Froot\u002F.ollama -p 11434:11434 --name ollama ollama\u002Follama\n\n# Verify\nollama --version\n```\n\n### Step 2: Download and Run Models\n\n```bash\n# Download and start chatting\nollama run llama3.1              # Meta LLaMA 3.1 8B\nollama run mistral               # Mistral 7B\nollama run codellama              # Code-focused LLaMA\nollama run phi3                   # Microsoft Phi-3 (small, fast)\nollama run gemma2                 # Google Gemma 2\nollama run llama3.1:70b           # Larger 70B model (needs ~40GB RAM)\nollama run deepseek-r1:8b         # DeepSeek R1 reasoning model\n\n# List downloaded models\nollama list\n\n# Remove a model\nollama rm mistral\n\n# Model info\nollama show llama3.1\n```\n\n### Step 3: REST API\n\nOllama exposes an OpenAI-compatible API at `http:\u002F\u002Flocalhost:11434`.\n\n```bash\n# Generate completion\ncurl http:\u002F\u002Flocalhost:11434\u002Fapi\u002Fgenerate -d '{\n  \"model\": \"llama3.1\",\n  \"prompt\": \"Explain recursion in one paragraph.\",\n  \"stream\": false\n}'\n\n# Chat completion (OpenAI-compatible)\ncurl http:\u002F\u002Flocalhost:11434\u002Fv1\u002Fchat\u002Fcompletions -d '{\n  \"model\": \"llama3.1\",\n  \"messages\": [\n    {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"What is a closure in JavaScript?\"}\n  ]\n}'\n\n# Generate embeddings\ncurl http:\u002F\u002Flocalhost:11434\u002Fapi\u002Fembed -d '{\n  \"model\": \"llama3.1\",\n  \"input\": \"How to deploy a Node.js app\"\n}'\n```\n\n### Step 4: Node.js Integration\n\n```typescript\n\u002F\u002F lib\u002Flocal-ai.ts — Use Ollama from Node.js via OpenAI-compatible API\n\u002F\u002F Any OpenAI SDK works — just change the base URL\nimport OpenAI from 'openai'\n\nconst ollama = new OpenAI({\n  baseURL: 'http:\u002F\u002Flocalhost:11434\u002Fv1',\n  apiKey: 'ollama',    \u002F\u002F required by SDK but not used by Ollama\n})\n\n\u002F\u002F Chat completion (same API as OpenAI)\nconst response = await ollama.chat.completions.create({\n  model: 'llama3.1',\n  messages: [\n    { role: 'system', content: 'You are a code review assistant.' },\n    { role: 'user', content: 'Review this function:\\n\\nfunction add(a, b) { return a + b; }' },\n  ],\n  temperature: 0.3,\n})\n\nconsole.log(response.choices[0].message.content)\n\n\u002F\u002F Streaming\nconst stream = await ollama.chat.completions.create({\n  model: 'llama3.1',\n  messages: [{ role: 'user', content: 'Write a haiku about coding.' }],\n  stream: true,\n})\n\nfor await (const chunk of stream) {\n  process.stdout.write(chunk.choices[0]?.delta?.content || '')\n}\n```\n\n### Step 5: Python Integration\n\n```python\n# local_chat.py — Use Ollama from Python\nimport ollama\n\n# Simple generation\nresponse = ollama.chat(\n    model='llama3.1',\n    messages=[\n        {'role': 'system', 'content': 'You are a data analysis expert.'},\n        {'role': 'user', 'content': 'Explain the difference between L1 and L2 regularization.'},\n    ],\n)\nprint(response['message']['content'])\n\n# Streaming\nstream = ollama.chat(\n    model='llama3.1',\n    messages=[{'role': 'user', 'content': 'Explain MapReduce.'}],\n    stream=True,\n)\nfor chunk in stream:\n    print(chunk['message']['content'], end='', flush=True)\n\n# Embeddings\nresult = ollama.embed(model='llama3.1', input='How to use PostgreSQL indexes')\nprint(len(result['embeddings'][0]))    # embedding dimensions\n```\n\n### Step 6: Custom Models with Modelfile\n\n```dockerfile\n# Modelfile — Create a custom model with specific behavior\nFROM llama3.1\n\n# System prompt baked into the model\nSYSTEM \"\"\"\nYou are a senior Python developer. You write clean, well-documented code\nfollowing PEP 8. You always include type hints and docstrings.\nWhen asked to write code, provide complete, runnable examples.\n\"\"\"\n\n# Parameters\nPARAMETER temperature 0.3\nPARAMETER top_p 0.9\nPARAMETER num_ctx 8192\n```\n\n```bash\n# Build and use custom model\nollama create python-coder -f Modelfile\nollama run python-coder\n```\n\n### Step 7: GPU Configuration\n\n```bash\n# Check GPU detection\nollama ps    # shows running models and GPU memory usage\n\n# Environment variables for GPU control\nOLLAMA_GPU_LAYERS=35    # number of layers to offload to GPU\nCUDA_VISIBLE_DEVICES=0  # select specific GPU\n\n# Memory requirements (approximate):\n# 7B model:  ~4GB RAM (GPU) or ~8GB RAM (CPU)\n# 13B model: ~8GB RAM (GPU) or ~16GB RAM (CPU)\n# 70B model: ~40GB RAM (GPU) or ~64GB RAM (CPU)\n```\n\n## Examples\n\n### Example 1: Build a private code assistant\n**User prompt:** \"I want a code assistant that runs entirely on my machine — no code sent to the cloud. Should handle Python and TypeScript.\"\n\nThe agent will:\n1. Install Ollama and download `codellama:13b` or `deepseek-coder:6.7b`.\n2. Create a Modelfile with a system prompt optimized for coding.\n3. Build a simple CLI or web interface using the OpenAI-compatible API.\n4. All inference runs locally — zero data leaves the machine.\n\n### Example 2: Run a local RAG pipeline\n**User prompt:** \"Index my company's internal docs and let employees query them with an AI — but we can't send data to OpenAI due to compliance.\"\n\nThe agent will:\n1. Set up Ollama with `llama3.1` for generation and embeddings.\n2. Chunk documents and store embeddings in a local vector database (ChromaDB).\n3. Build a retrieval pipeline: query → embed → search → generate answer.\n4. Deploy as an internal web app. All processing stays on-premises.\n\n## Guidelines\n\n- Model selection by hardware: 7B models run well on 8GB+ RAM machines; 13B needs 16GB+; 70B needs 64GB+ or a high-end GPU. Start with the smallest model that meets quality requirements.\n- Ollama's API is OpenAI-compatible — the OpenAI SDK, LangChain, LlamaIndex, and most AI frameworks work by just changing the base URL to `http:\u002F\u002Flocalhost:11434\u002Fv1`.\n- Use GPU acceleration whenever available — inference is 5-10x faster on GPU than CPU. Ollama auto-detects NVIDIA GPUs with CUDA and Apple Silicon's Metal.\n- Create custom Modelfiles for specific use cases — baking a system prompt and temperature into the model saves tokens and ensures consistent behavior.\n- For production deployments, run Ollama behind a reverse proxy (nginx, Traefik) with authentication. The default API has no auth.\n- Keep models updated (`ollama pull model_name`) — the community frequently releases improved quantizations and fine-tunes.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Follama",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill ollama",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill ollama",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill ollama","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Follama\u002FSKILL.md",true,[],[46,55,64,73,79,85],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[52,53,54],"model","model hierarchy","model hierarchy skill",{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[61,62,63],"MCP","zoom","zoom mcp",{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[70,71,72,62],"sdk","zoom apps sdk","apps",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[75],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[87]]