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 instructions/tadmstr/ollama-queue-proxy/agents-mdgit clone --depth 1 https://github.com/TadMSTR/ollama-queue-proxyWhat 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.00792 | $0.00792 |
| Opus 5 | $0.00396 | $0.00396 |
| Sonnet 5 | $0.00158 | $0.00158 |
| Haiku 4.5 | $0.00079 | $0.00079 |
Grade A, and why
ollama-queue-proxy AGENTS.md 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 yesterday.
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 — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ollama-queue-proxy
FastAPI reverse proxy for Ollama with priority queuing, per-client API key auth, embedding response caching, OpenAI-compatible API translation, and multi-host routing.
What it does
Sits in front of one or more Ollama instances and provides: authenticated access, request prioritization, per-client concurrency limits, embedding caching, and an OpenAI-compatible API surface.
Structure
src/ollama_queue_proxy/
main.py FastAPI app + lifespan — wires together all managers
config.py Config dataclass, load_config() from YAML
auth.py AuthManager — per-client API key validation
queue.py PriorityQueueManager — priority queue, TTL, pause/resume
proxy.py dispatch_request() — forwards requests to selected Ollama host
routing.py RoutingTable — model-to-host assignment
hosts.py HostManager — Ollama host pool, health checks
concurrency.py ClientConcurrencyManager — per-client request limits
cache.py EmbeddingCache — response cache for /api/embeddings
openai_compat.py OpenAI → Ollama path rewriting and response wrapping
middleware.py RequestContextMiddleware — injects client_id, priority
injection.py AppState singleton for dependency injection
webhooks.py WebhookManager — posts queue events to a webhook URL
routes/
queue.py Queue management endpoints (/queue/status, /queue/pause, etc.)
status.py Health and metrics endpoints
tests/ pytest tests
config.example.yml Reference configuration
Dockerfile Docker image
Source files
| File | Role |
|---|---|
main.py |
App entrypoint, lifespan startup/shutdown, manager wiring |
config.py |
YAML config loading; all tunables defined here |
auth.py |
Per-client key lookup and validation |
queue.py |
Async priority queue, TTL expiry, pause/resume per client |
proxy.py |
Upstream dispatch, timeout, error handling |
routing.py |
Maps model names to target host(s) |
hosts.py |
Host pool management and health polling |
openai_compat.py |
Path rewriting and response schema wrapping for OpenAI clients |
webhooks.py |
SSRF-validated webhook delivery for queue events |
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.
- yesterday First seen · 73 lines · 792 tokens per session scan A ce2d153fd75c
ollama-queue-proxy AGENTS.md is an instructions file published in the GitHub repository TadMSTR/ollama-queue-proxy (2 stars, last pushed 2mo ago), licensed MIT. It adds 792 tokens to every session, about $0.0040 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-31.
Other instructions, from other repositories
ollama AGENTS.md
AGENTS.md instructions for ollama/ollama, covering agents.md and building.
ollama CLAUDE.md
Claude Code instructions for ollama/ollama: See AGENTS.md for the shared agent instructions for this repository.
pocketpaw CLAUDE.md
Instructions for pocketpaw/pocketpaw, covering claude.md, project overview, knowledge base, search the kb from terminal and show a specific module's wiki.
MaxKB CLAUDE.md
Claude Code instructions for 1Panel-dev/MaxKB, covering claude.md, project overview, development commands, database / static and architecture.
codexia AGENTS.md
Instructions for milisp/codexia, covering agents.md, project info, project tech, common commands and project structure.
ai4j CLAUDE.md
Instructions for LnYo-Cly/ai4j: 本项目以 AGENTS.md 作为 coding agent 指令的唯一权威入口。.