agentleFS
strikersamstrikersam/autonomous-ai-agency/.agents/skills/local-ai-query/SKILL.md

local-ai-query

Skill9 starsChanged 3 months agoMITView on GitHub

If this fails, start the stack: cd docker/local-ai-stack && docker compose up -d Pull a model if needed: Simple generation: Chat format (multi-turn): With system prompt: When chromadb is also running:

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If this fails, start the stack: cd docker/local-ai-stack && docker compose up -d

    line 22
  2. Very specific:

    When chromadb is also running:

    line 91
  3. Distinctive:

    All data stays on your machine — no cloud API calls

    line 113
  4. Distinctive:

    No telemetry sent externally

    line 116

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: local-ai-query

Purpose

Route prompts to a locally running Ollama instance instead of cloud AI APIs. Use this for privacy-sensitive tasks, offline work, or cost reduction. Pairs with the Docker stack in docker/local-ai-stack/.

When to Use

  • Processing sensitive/proprietary code or data that shouldn't leave the machine
  • Offline or air-gapped environments
  • Rapid iteration where cloud latency matters
  • Cost-conscious experimentation with large prompts

Prerequisites

  • Ollama running locally (see docker/local-ai-stack/README.md)
  • At least one model pulled: docker exec ollama ollama pull llama3.2:latest

Steps

1. Verify Ollama is available

curl -s http://localhost:11434/api/tags | jq '.models[].name'

If this fails, start the stack: cd docker/local-ai-stack && docker compose up -d

2. Choose appropriate model

TaskRecommended Model
Code generationdeepseek-coder-v2:latest or codellama:latest
General chatllama3.2:latest
Summarizationllama3.2:latest
Embeddings/RAGnomic-embed-text:latest
Fast/smallphi3:mini

Pull a model if needed:

docker exec ollama ollama pull <model-name>

3. Send query to local model

Simple generation:

curl http://localhost:11434/api/generate \
  -d '{
    "model": "llama3.2:latest",
    "prompt": "<YOUR_PROMPT>",
    "stream": false
  }' | jq -r .response

Chat format (multi-turn):

curl http://localhost:11434/api/chat \
  -d '{
    "model": "llama3.2:latest",
    "messages": [
      {"role": "user", "content": "<YOUR_MESSAGE>"}
    ],
    "stream": false
  }' | jq -r '.message.content'

With system prompt:

curl http://localhost:11434/api/chat \
  -d '{
    "model": "llama3.2:latest",
    "messages": [
      {"role": "system", "content": "You are a senior software engineer. Be concise and technical."},
      {"role": "user", "content": "<YOUR_MESSAGE>"}
    ],
    "stream": false
  }' | jq -r '.message.content'

4. Generate embeddings (for RAG)

curl http://localhost:11434/api/embeddings \
  -d '{
    "model": "nomic-embed-text:latest",
    "prompt": "<TEXT_TO_EMBED>"
  }' | jq '.embedding | length'

5. List running models

curl -s http://localhost:11434/api/ps | jq '.models[].name'

Integration with ChromaDB (RAG)

When chromadb is also running:

import chromadb
import requests

# Embed with Ollama
def embed(text: str) -> list[float]:
    r = requests.post("http://localhost:11434/api/embeddings",
                      json={"model": "nomic-embed-text:latest", "prompt": text})
    return r.json()["embedding"]

# Store in ChromaDB
client = chromadb.HttpClient(host="localhost", port=8000)
collection = client.get_or_create_collection("knowledge")
collection.add(documents=["Your doc here"], embeddings=[embed("Your doc here")], ids=["doc1"])

# Query
results = collection.query(query_embeddings=[embed("search query")], n_results=3)

Privacy Notes

  • All data stays on your machine — no cloud API calls
  • Models run entirely in your Docker containers
  • ChromaDB vectors are stored in chroma_data Docker volume
  • No telemetry sent externally

Limitations

  • Slower than cloud APIs (depends on hardware)
  • Smaller context windows on some models
  • Quality varies by model — use larger models for complex tasks

Related Skills

  • research — use local-ai-query for private research tasks
  • brain-dump — process sensitive braindumps locally
  • debug-tracer — analyze proprietary code locally

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.