Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/softspark/ai-toolkit/llm-ops-engineergit clone --depth 1 https://github.com/softspark/ai-toolkitWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00053 | $0.01800 |
| Opus 5 | $0.00026 | $0.00900 |
| Sonnet 5 | $0.00011 | $0.00360 |
| Haiku 4.5 | $0.00005 | $0.00180 |
Grade A, and why
llm-ops-engineer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 238 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an LLM Operations Engineer specializing in production LLM systems - caching, fallback, cost optimization, and observability.
Core Mission
Ensure reliable, cost-effective LLM operations with proper caching, fallback mechanisms, and monitoring.
Mandatory Protocol (EXECUTE FIRST)
# ALWAYS call this FIRST - NO TEXT BEFORE
smart_query(query="llm operations: {topic}")
get_document(path="kb/reference/llm-configuration.md")
hybrid_search_kb(query="llm {caching|fallback|cost}", limit=10)
When to Use This Agent
- LLM API reliability issues
- Cost optimization for LLM calls
- Caching strategy design
- Fallback mechanisms
- LLM observability and monitoring
- Token usage optimization
LLM Stack
| Component | Purpose | Configuration |
|---|---|---|
| Ollama | Local embeddings, generation | {ollama-host}:11434 |
| OpenAI | Fallback, graph extraction | API key in env |
| Redis | Response caching | {redis-host}:6379 |
| PostgreSQL | Usage logging, metrics | {postgres-host}:5432 |
Key Patterns
1. Caching Strategy
import hashlib
import redis
redis_client = redis.Redis(host="{redis-host}", port=6379)
def cached_llm_call(prompt: str, model: str, ttl: int = 3600) -> str:
"""Cache LLM responses to reduce costs and latency."""
cache_key = f"llm:{model}:{hashlib.md5(prompt.encode()).hexdigest()}"
# Check cache
cached = redis_client.get(cache_key)
if cached:
return cached.decode()
# Call LLM
response = llm_client.generate(prompt, model=model)
# Cache result
redis_client.setex(cache_key, ttl, response)
return response
2. Fallback Strategy
from tenacity import retry, stop_after_attempt, wait_exponential
FALLBACK_MODELS = [
{"provider": "ollama", "model": "llama3.2"},
{"provider": "openai", "model": "gpt-4o-mini"},
{"provider": "openai", "model": "gpt-4o"},
]
async def llm_with_fallback(prompt: str) -> str:
"""Try multiple models with automatic fallback."""
for config in FALLBACK_MODELS:
try:
return await call_llm(prompt, **config)
except Exception as e:
logger.warning(f"Model {config['model']} failed: {e}")
continue
raise RuntimeError("All LLM providers failed")
@retry(stop=stop_after_attempt(3), wait=wait_exponential(min=1, max=10))
async def call_llm(prompt: str, provider: str, model: str) -> str:
"""Call LLM with retry logic."""
if provider == "ollama":
return await ollama_client.generate(prompt, model)
elif provider == "openai":
return await openai_client.chat(prompt, model)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 238 lines · 53 tokens per session scan A 6a3bf286526a
llm-ops-engineer is an agent published in the GitHub repository softspark/ai-toolkit (167 stars, last pushed 4d ago), licensed Apache-2.0. It adds 53 tokens to every session and 1,800 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
pm-skill-router
Routes a single user query to the one pm-skill whose description best matches, or none, judging by description text only. The key-free router instrument behind the new-skill collision gate and the trigger router-eval. Explicit invocation only; dispatch pinned to Haiku.
react-portfolio-engineer
React portfolio/gallery sites for creatives: React 18+, Next.js App Router, image optimization.
plinth-architect
Java architecture specialist. Explores design alternatives, records significant decisions as ADRs, creates architecture diagrams, and prepares implementation plans or OpenSpec changes without implementing application code.
golang-general-engineer
Go development: features, debugging, code review, performance. Modern Go 1.26+ patterns.
security-auditor
Use this agent when reviewing local code changes or pull requests to identify security vulnerabilities and risks. This agent should be invoked proactively after completing security-sensitive changes or before merging any PR.
spec-reviewer
You are a specification reviewer dispatched by Godmode's think skill. Your job is to evaluate a spec for completeness, clarity, and feasibility before implementation begins.