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-moonshot-compatibility

v1.0.0

Published

OpenCode plugin that forces temperature to 1 for Moonshot AI / Kimi models

Readme

🌙 OpenCode Moonshot Compatibility Plugin

Tired of the invalid temperature: only 1 is allowed for this model error?
This tiny plugin fixes it automatically — no need to change your agents! 🚀


✨ What It Does

When you use Moonshot AI (Kimi) models with OpenCode, the API only accepts temperature: 1.
But OpenCode agents (like @developer) usually set lower temperatures (e.g. 0.3) for better code quality.

This plugin hooks into every LLM call and silently forces temperature = 1 only when the active model is a Moonshot / Kimi one.

Your other agents and models stay completely untouched! 🎯


🔧 How It Works

OpenCode Agent (developer.md)
         │
         ▼
    temperature: 0.3   ← stays in the file
         │
         ▼
  ┌─────────────────────┐
  │  🌙 This Plugin     │  ← intercepts chat.params
  │  detects Moonshot   │
  │  and forces temp=1  │
  └─────────────────────┘
         │
         ▼
    temperature: 1   ← sent to Moonshot API

Zero side effects on other providers like OpenAI, Anthropic, Ollama, etc.


📦 Installation

Option 1: Quick Copy (Recommended)

  1. Download index.js from this repo
  2. Place it in your OpenCode plugins folder:
    mkdir -p ~/.config/opencode/plugins
    cp index.js ~/.config/opencode/plugins/moonshot-temperature.js
  3. Add to your ~/.config/opencode/opencode.json:
    {
      "plugin": [
        "file:///Users/YOUR_USERNAME/.config/opencode/plugins/moonshot-temperature.js"
      ]
    }

Option 2: npm (Coming Soon)

npm install opencode-moonshot-compatibility

Then in opencode.json:

{
  "plugin": [
    "opencode-moonshot-compatibility"
  ]
}

🧪 Supported Models

| Provider | Models | |----------|--------| | moonshotai | kimi-k2, kimi-k2.5, kimi-k2.6, kimi-k2-thinking, ... | | Any provider | Any model ID containing "kimi" |


🛠️ Development

git clone https://github.com/iamvaleriofantozzi/opencode-moonshot-compatibility.git
cd opencode-moonshot-compatibility

The plugin is a single ESM file that exports a default async function returning hooks:

export default async function () {
  return {
    "chat.params": async (input, output) => {
      // input.model.providerID  → "moonshotai"
      // input.model.id           → "kimi-k2.6"
      // output.temperature       → writable!
    },
  };
}

Learn more about OpenCode plugins: https://opencode.ai/docs/plugins


🐛 Troubleshooting

Plugin not loading?

  • Check that the file:// path in opencode.json is absolute
  • Restart OpenCode completely (plugins are loaded at startup)
  • Look for [opencode-moonshot-temperature] PLUGIN LOADED in the logs

Still getting the temperature error?

  • Make sure you're using the latest version of this plugin
  • Check that your model ID contains "kimi" or provider is "moonshotai"

💡 Why This Exists

I love using different models for different tasks in OpenCode.
Switching to Kimi for coding is awesome, but the temperature mismatch was annoying.
I didn't want to create separate agents just for Moonshot, so I built this universal fix! 🎉


📄 License

MIT — do whatever you want! 🏄‍♂️


👤 Author

Made with ❤️ by Valerio Fantozzi

Happy coding with Kimi! 🌙✨