detect.ja

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

An automatic detector for finding language-model engines currently running on a Mac. It checks saved settings, common network ports and running processes.

In plain words
What is it for?
Use it to find local engines, check one or more specific addresses, identify the engine behind a shared port, and save newly found engines for quicker later checks.
Why use it?
It removes the need to know which program is running, which port it uses or where it was configured before.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/druide67/asiai/detect.ja.svg)](https://agentmods.dev/commands/druide67/asiai/detect.ja)
Your own site
<a href="https://agentmods.dev/commands/druide67/asiai/detect.ja"><img src="https://agentmods.dev/badge/commands/druide67/asiai/detect.ja.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 740 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.00044 $0.00740
Opus 5 $0.00022 $0.00370
Sonnet 5 $0.00009 $0.00148
Haiku 4.5 $0.00004 $0.00074

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

Security

Grade A, and why

detect.ja 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

  • detect.ko — 100% identical, 50 lines differ
  • detect.zh — 100% identical, 50 lines differ
docs/commands/detect.ja.md · 74 lines

What it actually says

asiai detect

3層カスケードを使用して動作中の推論エンジンを自動検出します。

使用方法

asiai detect                      # 自動検出(3層カスケード)
asiai detect --url http://host:port  # 指定URLのみスキャン

出力

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

仕組み:3層検出

asiai は最速から最も徹底的な3つの検出レイヤーのカスケードを使用します:

レイヤー1:設定(最速、約100ms)

~/.config/asiai/engines.json を読み取り — 過去の実行で検出されたエンジン。非標準ポート(例:oMLXの8800)のエンジンを再スキャンなしで検出。

レイヤー2:ポートスキャン(約200ms)

デフォルトポートと拡張範囲をスキャン:

ポート エンジン
11434 Ollama
1234 LM Studio
8080 mlx-lm または llama.cpp
8000-8009 oMLX または vllm-mlx
52415 Exo

レイヤー3:プロセス検出(フォールバック)

pslsof を使用して任意のポートでリスニングしているエンジンプロセスを検出。完全に予期しないポートで実行されているエンジンも検出。

自動保存

レイヤー2または3で検出されたエンジンは、次回の検出を高速化するために自動的に設定ファイル(レイヤー1)に保存されます。自動検出エントリは7日間の非アクティブ後にプルーニングされます。

複数のエンジンがポートを共有する場合(例:mlx-lmとllama.cppの8080)、asiai はAPIエンドポイントプロービングで正しいエンジンを識別します。

明示的URL

--url 使用時は、指定されたURLのみがスキャンされます。設定の読み書きは行われません — ワンオフチェックに便利です。

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

関連項目

  • config — 永続的なエンジン設定の管理
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 · 44 tokens per session scan A b51dd49f6800

Subscribe to this mod's changes

detect.ja is a command published in the GitHub repository druide67/asiai (11 stars, last pushed 5d ago), licensed Apache-2.0. It adds 44 tokens to every session and 740 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.