detect.pt

detect.pt is a command for coding agents from druide67/asiai. It costs 37 tokens per session (623 once invoked), scanned A, original, Apache-2.0.

A command that finds local large-language-model engines running on a Mac, such as Ollama or LM Studio. It checks saved settings, common network ports, and running processes.

In plain words
What is it for?
Use it to discover available local model services, check a specific engine URL, and see which models are running when the tool reports them.
Why use it?
It removes the need to know which local engine is running or which port it uses. It can also find engines running on non-standard ports.

Command

Install

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.

agentmods
npx agentmods add commands/druide67/asiai/detect.pt
Clone the repo
git clone --depth 1 https://github.com/druide67/asiai

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for detect.pt

README.md
[![agentmods](https://agentmods.dev/badge/commands/druide67/asiai/detect.pt.svg)](https://agentmods.dev/commands/druide67/asiai/detect.pt)
Your own site
<a href="https://agentmods.dev/commands/druide67/asiai/detect.pt"><img src="https://agentmods.dev/badge/commands/druide67/asiai/detect.pt.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 623 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00037 $0.00623
Opus 5 $0.00018 $0.00311
Sonnet 5 $0.00007 $0.00125
Haiku 4.5 $0.00004 $0.00062

Measured 4d ago against content hash 64f544078e4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

detect.pt 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 4d 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.

docs/commands/detect.pt.md · 74 lines

What it actually says

asiai detect

Auto-detecta motores de inferência usando uma cascata em 3 camadas.

Uso

asiai detect                      # Auto-detectar (cascata 3 camadas)
asiai detect --url http://host:port  # Verificar apenas URL(s) específica(s)

Saída

Detected engines:

  ● ollama 0.17.4
    URL: http://localhost:11434

  ● lmstudio 0.4.5
    URL: http://localhost:1234
    Running: 1 model(s)
      - qwen3.5-35b-a3b  MLX

  ● omlx 0.9.2
    URL: http://localhost:8800

Como funciona: detecção em 3 camadas

O asiai usa uma cascata de três camadas de detecção, da mais rápida à mais abrangente:

Camada 1: Config (mais rápida, ~100ms)

~/.config/asiai/engines.json — motores descobertos em execuções anteriores. Isso encontra motores em portas não padrão (ex: oMLX na 8800) sem precisar re-escanear.

Camada 2: Varredura de portas (~200ms)

Verifica portas padrão mais um range estendido:

Porta Motor
11434 Ollama
1234 LM Studio
8080 mlx-lm ou llama.cpp
8000-8009 oMLX ou vllm-mlx
52415 Exo

Camada 3: Detecção de processos (fallback)

Usa ps e lsof para encontrar processos de motores ouvindo em qualquer porta. Encontra motores rodando em portas completamente inesperadas.

Auto-persistência

Qualquer motor descoberto nas Camadas 2 ou 3 é automaticamente salvo no arquivo de configuração (Camada 1) para detecção mais rápida na próxima vez. Entradas auto-descobertas são removidas após 7 dias de inatividade.

Quando múltiplos motores compartilham uma porta (ex: mlx-lm e llama.cpp na 8080), o asiai usa probing de endpoints de API para identificar o motor correto.

URLs explícitas

Ao usar --url, apenas as URLs especificadas são verificadas. Nenhuma configuração é lida ou escrita — útil para verificações pontuais.

asiai detect --url http://192.0.2.10:11434,http://localhost:8800

Veja também

  • config — Gerencie configuração persistente de motores
Changes

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.

  1. 4d ago First seen · 74 lines · 37 tokens per session scan A 64f544078e4e

Subscribe to this mod's changes

detect.pt is a command published in the GitHub repository druide67/asiai (11 stars, last pushed 5d ago), licensed Apache-2.0. It adds 37 tokens to every session and 623 once invoked, about $0.0002 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.