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

@mikthatguy/opencode-evict

v1.0.22

Published

Refresh OpenCode's local model cache with live provider data

Readme

OpenCode Evict 🥾

npm version License: MIT GitHub stars GitHub issues

Stop letting your IDE gaslight you about what models actually exist.

Your local model registry isn't just stale — it belongs in a museum. If you’ve ever screamed at your screen because a provider dropped a shiny new model hours ago and OpenCode is still pretending it’s science fiction, congratulations: you are a victim of cached JSON.

OpenCode Evict (oc-evict) is a ruthless, stupid-fast CLI that refreshes OpenCode’s local models.json cache with live provider data, merges it withmodels.dev, and can even help you contribute missing models back to the community.


🛠 What it actually does

[!NOTE] TL;DR: It fixes your models so you can code instead of debugging API configurations.

  1. Downloads the models.dev baseline. Because starting from absolute zero is unhinged.
  2. Reads your existing OpenCode cache. So whatever cursed, undocumented models you manually injected last week don’t get vaporized.
  3. Interrogates live provider APIs (concurrently). Because the only actual source of truth for a provider's models is the provider itself. "Eventual consistency" is just a polite tech term for "broken."
  4. Overwrites the cache. Shoves the merged, objectively correct reality straight into OpenCode’s OS-native cache folder.
  5. Generates Open Source Contributions. Detects missing models and can automatically generate valid TOML files ready for a models.dev Pull Request.

⚡ Installation

Via Public npm Registry (Recommended)

[!TIP] opencode-evict is now officially published on the public npm registry!

To run it instantly via bunx without installing:

bunx @mikthatguy/opencode-evict

Or install it globally using bun to have the oc-evict command always available:

bun add -g @mikthatguy/opencode-evict
oc-evict

From Source (Bun)

git clone https://github.com/MIKTHATGUY/opencode-evict.git
cd opencode-evict
bun install
bun run dev

Building standalone binaries

If you want a standalone executable (no Node.js/Bun required):

bun run build:bin
# For specific platforms:
bun run build:linux
bun run build:mac

Reverting back to the old cache

[!WARNING] This will overwrite your current cache with the old one. Make sure to back up any manually added models before doing this!

opencode models --refresh

🔌 Supported Providers

| Provider | Status | Description | | :--- | :---: | :--- | | Kilo (kilo.ai) | 🟢 Official | Fully supported VIP provider integration. | | Generic OpenAI-Compatible | 🟡 Beta | Any provider with a public /models endpoint that returns a list of models in a reasonable format. |

[!WARNING] Beta Feature: The generic provider check (--beta-check-generic-provider) is a hail mary and may not work with all providers. It’s designed to be a "best effort" attempt to pull in models from providers that aren’t officially supported yet. If you rely on it, please consider contributing a proper integration!


🚀 Usage & Flags

Just run the command to refresh your cache:

bunx @mikthatguy/opencode-evict

🎛 Flags (Choose Your Own Adventure)

| Flag | Name | Description | | :--- | :--- | :--- | | --dry-run | Coward mode | Does all the network requests, calculates the result, and writes absolutely nothing to disk. | | --print-missing | Name and shame | Prints every model that exists in the providers but not in the raw models.dev baseline. | | --export-contrib | The Good Citizen | Exports missing/outdated models as valid TOML files for models.dev contribution. | | --output-dir <path> | Target Directory | Where to drop the exported TOML files and recaps. Defaults to ./modelsai in your current directory. | | --beta-check-generic-provider | YOLO mode | For providers listed in the baseline, try hitting api + /models and inject whatever is publicly accessible. | | --try-bearer | Bribe the bouncer | If a provider hits you with a 401/403, prompt for a bearer token and retry. |


🤝 Exporting for models.dev

If you want to help keep the community database up to date, use the export flag:

bunx @mikthatguy/opencode-evict --export-contrib --output-dir ./my-contributions

[!IMPORTANT] This command will create a structured directory (e.g., my-contributions/providers/<provider-id>/models/) containing .toml files matching the exact schema required by the models.dev repository. Just copy them over to your fork and open a PR!


📜 The Fine Print

[!CAUTION] We don’t delete things. This tool is a hoarder, not a janitor. It injects what you’re missing; it doesn’t play whack-a-mole with deprecated models.

  • Cache location is OS-Native. We auto-detect where OpenCode hides its cache (prefers existing locations):
    • Windows: ~/.cache/opencode/models.json (primary), or %LOCALAPPDATA%\opencode\models.json, %APPDATA%\opencode\models.json, ~/AppData/Local/opencode/models.json
    • macOS: ~/.cache/opencode/models.json (primary), or ~/Library/Caches/opencode/models.json
    • Linux: ~/.cache/opencode/models.json (primary), or $XDG_CACHE_HOME/opencode/models.json
  • VIP providers. "Active" provider integrations live in src/providers/index.ts (currently just Kilo). Add more there if you want special handling.

Stop trusting yesterday’s JSON. Evict it.