Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

opencode-plugin-litellm

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opencode-plugin-litellm

OpenCode plugin for LiteLLM proxy support with auto-detection and dynamic model discovery

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
100
-32.89%
Maintainers
1
Weekly downloads
 
Created
Source

opencode-litellm

npm version CI License: MIT

OpenCode plugin for LiteLLM proxy support with auto-detection and dynamic model discovery.

Inspired by opencode-lmstudio.

npm package name: opencode-plugin-litellm (the unscoped opencode-litellm name was taken on npm). Repo name and plugin export remain opencode-litellm.

Features

  • Auto-detection — finds a LiteLLM proxy running on common ports (4000, 8000, 8080)
  • Dynamic model discovery — queries /v1/models so you never hand-maintain a model list
  • OpenAI-compatible — registers under OpenCode as @ai-sdk/openai-compatible
  • Vendor-aware — extracts litellm_provider (or the provider/model prefix) into organizationOwner
  • Smart formatting — turns anthropic/claude-3-5-sonnet into Claude 3 5 Sonnet in the picker
  • Categorization — chat / embedding / image / audio modalities are inferred from the model mode or id
  • Non-blocking — discovery is capped at 5s so a slow proxy never blocks OpenCode startup

Installation

npm install opencode-plugin-litellm
# or
bun add opencode-plugin-litellm

Usage

If a LiteLLM proxy is already running on localhost:4000, just add the plugin:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-plugin-litellm@latest"]
}

The plugin will detect the proxy, query /v1/models, and inject every model into your provider list automatically.

Manual configuration

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-plugin-litellm@latest"],
  "provider": {
    "litellm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LiteLLM (proxy)",
      "options": {
        "baseURL": "http://localhost:4000/v1",
        "apiKey": "{env:LITELLM_API_KEY}"
      }
    }
  }
}

Any models you predefine under provider.litellm.models are kept as-is; the plugin only adds models it discovers that aren't already configured.

Authentication

If your LiteLLM proxy requires a master key, expose it via either:

  • apiKey field inside provider.litellm.options, or
  • the LITELLM_API_KEY (or LITELLM_MASTER_KEY) environment variable.

How it works

  • On OpenCode startup the config hook fires.
  • If a litellm provider is configured, its baseURL is used. Otherwise the plugin probes localhost:4000, :8000, :8080.
  • Health check via GET /v1/models. If unreachable, the hook is a no-op.
  • Models from /v1/models are turned into OpenCode model entries with sensible name, organizationOwner, and modalities fields.
  • Discovered models are merged on top of any user-configured ones.

Requirements

  • OpenCode with plugin support (@opencode-ai/plugin ^1.0.166)
  • A running LiteLLM proxy (pip install 'litellm[proxy]' && litellm --config config.yaml)

License

MIT

Keywords

opencode

FAQs

Package last updated on 27 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts