npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-local-vision

v0.1.1

Published

Private local image understanding for text-only OpenCode models through Ollama

Readme

OpenCode Local Vision

Keep OpenCode's main model text-only while pasted images are described by a local Ollama vision model.

Paste image into OpenCode
        |
        v
OpenCode message-transform hook
        |
        +--> localhost:11434/api/chat --> local vision model
        |
        v
Raw image parts removed
        |
        v
Text description sent to the main model

The plugin does not create an OpenCode sub-session. Ollama receives only a short safety prompt, the current user question, and the image bytes.

Compatibility

  • OpenCode 1.18.x (V1 plugin API)
  • Ollama with any installed model whose /api/show response reports the vision capability
  • macOS, Linux, and Windows
  • PNG, JPEG, and WebP; up to 4 images and 25 MB total per message

OpenCode's message transform hook is experimental. OpenCode V2 uses a different plugin API and is not supported by this release.

Quick start

  1. Install Ollama.

  2. Pull a vision model. The team default below is small enough for most developer machines:

    ollama pull qwen2.5vl:3b
  3. Add the pinned npm package to opencode.jsonc:

    {
      "plugin": ["[email protected]"]
    }
  4. Remove other image-routing plugins, including @showlotus/opencode-image-vision, and old file:///.../local-vision.mjs entries from opencode.jsonc.

  5. Restart OpenCode. Paste an image and ask a question normally. There is no command or model switch.

Do not put a GitHub or raw-file URL in OpenCode's plugin setting. OpenCode installs the npm package into its cache automatically. Keep unrelated plugins unchanged.

The plugin automatically selects the first installed model that reports vision. To standardize a team or choose among multiple local models, set:

export LOCAL_VISION_MODEL=qwen2.5vl:3b

Windows PowerShell:

setx LOCAL_VISION_MODEL "qwen2.5vl:3b"

Restart OpenCode after changing environment variables.

Model choices

The plugin has no model-name allowlist. These are examples, not dependencies:

| Use case | Ollama model | | --- | --- | | Team default | qwen2.5vl:3b | | Low-memory machines | qwen3-vl:2b | | General vision | gemma3:4b | | MiniCPM-V | any installed MiniCPM-V tag reporting vision |

Verify a model before rollout:

ollama show qwen2.5vl:3b
curl -s http://127.0.0.1:11434/api/show \
  -d '{"model":"qwen2.5vl:3b"}'

The JSON response should include "vision" in capabilities.

Configuration

| Variable | Default | Purpose | | --- | --- | --- | | LOCAL_VISION_MODEL | auto-detect | Exact Ollama model tag | | LOCAL_VISION_BASE_URL | http://127.0.0.1:11434 | Ollama endpoint; loopback HTTP only | | LOCAL_VISION_TIMEOUT_MS | 120000 | Request timeout | | LOCAL_VISION_MAX_TOKENS | 2048 | Maximum description tokens |

The endpoint intentionally rejects remote hosts and HTTPS proxies. This prevents configuration drift from turning a local-only workflow into a remote upload path.

Privacy behavior

  • Every image attachment in the assembled conversation, including historical user messages, is replaced before the main-model request.
  • Ollama failures produce the fixed text LOCAL_VISION_ERROR; raw images are still removed.
  • Local file paths and Ollama response bodies are logged locally but are not included in the main-model prompt.
  • Image text is marked as untrusted evidence in both the vision prompt and the main-model system context.
  • Other OpenCode plugins run in plugin order. Remove other image-routing plugins; a plugin that runs earlier can inspect an image before this plugin removes it.

Team rollout

Use the copyable AI setup prompt and rollout checklist in docs/team-rollout.md.

Update and uninstall

Update by changing the pinned npm version in opencode.jsonc and restarting OpenCode.

Uninstall by removing opencode-local-vision from the plugin array and restarting OpenCode.

Development

npm test
npm run check
npm pack --dry-run

No runtime dependencies are required.