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

@devboost/opencode-litellm-provider-config-generator

v0.1.0

Published

Generate OpenCode LiteLLM provider model configuration from LiteLLM model metadata.

Readme

OpenCode LiteLLM Provider Config Generator

Generate OpenCode LiteLLM provider model configuration from LiteLLM model metadata and models.dev fallback data.

Requirements

  • Node.js 22 or newer
  • an OpenCode configuration with a LiteLLM provider entry
  • an API auth entry for the selected provider in the local OpenCode auth file
  • Network access to https://models.dev/api.json during generation

Run With npx

Generate model configuration for an OpenCode provider backed by a remote LiteLLM instance:

npx @devboost/opencode-litellm-provider-config-generator --provider <provider-id>

The installed command name is defined by the package bin entry:

opencode-litellm-provider-config-generator --provider <provider-id>

OpenCode Configuration

The CLI reads the provider from the OpenCode configuration file selected by OPENCODE_CONFIG or the default paths:

  • ~/.config/opencode/opencode.jsonc
  • ~/.config/opencode/opencode.json

Example provider entry:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "litellm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LiteLLM",
      "options": {
        "baseURL": "https://litellm.example.com"
      },
      "models": {}
    }
  }
}

The selected provider must define options.baseURL. The CLI requests <baseURL>/v1/model/info from LiteLLM.

The matching API key is read from the OpenCode auth file at ~/.local/share/opencode/auth.json:

{
  "litellm": {
    "type": "api",
    "key": "sk-example"
  }
}

Usage

Limit generated models to aliases that contain a name filter:

npx @devboost/opencode-litellm-provider-config-generator --provider <provider-id> --include-model gpt --include-model claude

Exclude aliases that contain a name filter:

npx @devboost/opencode-litellm-provider-config-generator --provider <provider-id> --exclude-model embedding --exclude-model deprecated

Replace the selected provider's model list directly in the OpenCode configuration file:

npx @devboost/opencode-litellm-provider-config-generator --provider <provider-id> --inplace

The short sed-style flag is also supported:

npx @devboost/opencode-litellm-provider-config-generator --provider <provider-id> -i

The CLI reads the selected OpenCode provider and auth entry, requests <baseURL>/v1/model/info from LiteLLM, enriches missing model fields from https://models.dev/api.json, and writes an OpenCode model configuration object to stdout by default. The JSON object keys remain the LiteLLM model aliases so OpenCode can still route requests through LiteLLM.

Use -i or --inplace to replace provider.<provider-id>.models in the OpenCode configuration file selected by OPENCODE_CONFIG or the default OpenCode config path. Existing models for that provider are completely replaced; other providers and unrelated configuration entries are not changed. The planned file content is parsed as JSONC and validated against the full OpenCode JSON schema from https://opencode.ai/config.json before the file is overwritten. If schema loading or validation fails, the original file is left unchanged. Comments and formatting outside the replaced models block are preserved where JSONC editing allows it.

Use --include-model <name-filter> to keep only LiteLLM aliases whose model_name contains at least one include filter. Use --exclude-model <name-filter> to remove LiteLLM aliases whose model_name contains an exclude filter. Both parameters are repeatable, use case-insensitive substring matching, and can be combined. When both are provided, include filters are applied first and exclude filters remove matches from that included set. Unknown CLI options are rejected with a usage error instead of being ignored.

Example output:

{
  "private-gpt-4o": {
    "name": "GPT-4o",
    "family": "gpt",
    "limit": {
      "context": 128000,
      "output": 16384
    },
    "cost": {
      "input": 2.5,
      "output": 10,
      "cache_read": 1.25,
      "cache_write": 1.25
    },
    "tool_call": true,
    "reasoning": false,
    "attachment": true,
    "modalities": {
      "input": ["text", "image", "pdf"],
      "output": ["text"]
    }
  }
}