MONKEYTESTERDOCS
Docs / Use

Vision model providers

The vision model is the MonkeyTester-Plugin-AI plugin, and the plugin — not the viewer — decides who answers: a local model on the Mac, a remote OpenAI-compatible server, or GitHub Copilot.

Where it lives

The runner always posts to the plugin's /v1/chat/completions with the pairing token. The plugin's address is set in Settings → Plugins, the AI row's Configure panel (Plugin address field), and saved in Run/config.json as visual_plugin_url — the one source for viewer and runner. The viewer checks it first: GET /health must be the AI plugin and GET /config must accept the pairing token, otherwise nothing is saved.

Without saved settings the runner uses VISION_MODEL_API_URL and VISUAL_MODEL_API_KEY from the environment. Old configs that saved visual_endpoint/visual_model still work and log a deprecation; a Run/config.json still saying visual_provider: "copilot" stops the runner at start until you save in the panel. A copilot_config.json from before Copilot moved into the plugin is no longer read — delete it (it holds a GitHub token).

The three providers

All chosen in the panel's Configuration section, applied with the single Save changes button (the panel stages every edit; greyed means nothing differs from the saved state).

Local model (default)

Qwen2.5-VL through the plugin's private Ollama copy (Metal on Apple silicon). Everything stays on the Mac. The model list comes from GET /models; switch models from the panel without restarting. MTAI_MODEL only picks the starting model; if a saved model is no longer installed the service falls back to it.

Remote server

For a model running elsewhere — typically llama.cpp's llama-server on a GPU box (e.g. http://192.168.125.70:8080), or vLLM, or another Ollama's /v1. Maps to POST /config keys:

Panel controlConfig keyNotes
Addressremote_urlhttp(s)://host:port, optionally with a path; a trailing /, /v1 or /v1/chat/completions is stripped. Saved only if GET <address>/v1/models answers within 5 s; the model list comes from there.
Modelremote_modelOne of the ids that server lists.
Resize screenshots for Qwen2.5-VLremote_resizeOn by default. Keep it on when the remote model is Qwen2.5-VL (it answers in pixels of the resized image). Turn it off for models that answer in pixels of the image they were sent (GPT-class, Gemma, most others) — the request then passes through unchanged except the model.
API keyremote_api_keyFor a server started with --api-key. Sent as Authorization: Bearer to that server only, stored in .runtime/remote.json (mode 600), write-only: you only see "configured · …last4". A server that refuses it says "the remote server rejected the API key".

Clearing the address switches back to Local. /health reports a remote provider ready when address + model are set without contacting the server. Traffic is plain HTTP unless you give an https:// address.

GitHub Copilot

  • Sign in with GitHub's device flow: the panel shows a short code to enter at github.com/login/device; the plugin checks the account really has Copilot before storing anything. The sign-in lives in .runtime/copilot.json (mode 600) and no route returns it. Remove deletes it and falls back to Local.
  • Know what you're opting into: with Copilot selected, every screenshot the test asks about goes to GitHub's Copilot API. It uses the OAuth client of GitHub's editor plugins (there is no official public Copilot API), so GitHub can change or block it at any time; Local is unaffected.
  • Copilot requests pass through unchanged except the model: no resizing, no coordinate rescaling (GPT-class models answer in pixels of the image sent).

Provider, per-provider model, remote address and the resize switch are saved in .runtime/settings.json and survive restarts.

The pairing token

The service owns and generates it; the viewer keeps a copy so it can call the service over the LAN and only reads it back as {configured, last4}. Generate one with openssl rand -hex 32, export as MTAI_TOKEN before service install --lan, and paste it into the panel's Token block (Set / Replace / Remove are staged selects, executed by the one Save). Rotation via the plugin returns new_token exactly once.

Traffic between the viewer and the plugin is unencrypted HTTP on the LAN. Bind the plugin with --lan only on a network you trust.

Tuning

  • MTAI_MAX_PIXELS (default 1,000,000): the largest image the model sees. Raising it helps with tiny icons but is slower and uses more memory; stay under ~3M.
  • VISION_TIMEOUT_SECS on the runner is 310 s — longer than the plugin's own 300 s limit, so the plugin's answer arrives first. The plugin retries nothing; the runner's client retries a refused connection or 502/503/504 twice, because a restarting model recovers by itself.
  • The model reloads after 30 minutes idle; the viewer's Test only waits 15 s, so a cold model can time out. Check status shows it loaded.