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-lmstudio

v0.3.0

Published

OpenCode plugin for enhanced LM Studio support with auto-detection and dynamic model discovery

Readme

opencode-lmstudio

OpenCode plugin for enhanced LM Studio support with auto-detection and dynamic model discovery.

Features

  • Auto-detection: Automatically detects LM Studio running on common ports (1234, 8080, 11434)
  • Dynamic Model Discovery: Queries LM Studio's /v1/models endpoint to discover available models
  • Smart Model Formatting: Automatically formats model names for better readability (e.g., "Qwen3 30B A3B" instead of "qwen/qwen3-30b-a3b")
  • Organization Owner Extraction: Extracts and sets organizationOwner field from model IDs
  • Health Check Monitoring: Verifies LM Studio is accessible before attempting operations
  • Automatic Configuration: Auto-creates lmstudio provider if detected but not configured
  • Model Merging: Intelligently merges discovered models with existing configuration
  • Comprehensive Caching: Reduces API calls with intelligent caching system
  • Error Handling: Smart error categorization with auto-fix suggestions

Installation

npm install opencode-lmstudio
# or
bun add opencode-lmstudio

Usage

Add the plugin to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "opencode-lmstudio@latest"
  ],
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio (local)",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1"
      }
    }
  }
}

Auto-detection

If you don't configure the lmstudio provider, the plugin will automatically detect LM Studio if it's running on one of the common ports and create the provider configuration for you.

Manual Configuration

You can also manually configure the provider with specific models:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "opencode-lmstudio@latest"
  ],
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio (local)",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1"
      },
      "models": {
        "google/gemma-3n-e4b": {
          "name": "Gemma 3n-e4b (local)"
        }
      }
    }
  }
}

The plugin will automatically discover and add any additional models available in LM Studio that aren't already configured.

How It Works

  1. On OpenCode startup, the plugin's config hook is called
  2. If an lmstudio provider is found, it checks if LM Studio is accessible
  3. If not configured, it attempts to auto-detect LM Studio on common ports
  4. If accessible, it queries the /v1/models endpoint
  5. Discovered models are merged into your configuration
  6. The enhanced configuration is used for the current session

Requirements

  • OpenCode with plugin support
  • LM Studio running locally (default port: 1234)
  • LM Studio server API accessible at http://127.0.0.1:1234/v1

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.