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

@openpets/llm-models

v1.0.1

Published

LLM model discovery and comparison plugin - search and compare models from models.dev across multiple providers

Downloads

22

Readme

LLM Models Discovery Plugin

A comprehensive OpenCode plugin for discovering, searching, and comparing LLM models across multiple providers using the models.dev API. Find the perfect model for your use case with advanced filtering, cost analysis, and capability comparison.

Table of Contents

  1. Features
  2. Quick Start
  3. Available Tools
  4. Usage Examples
  5. Configuration
  6. API Reference
  7. Advanced Filtering
  8. Cost Analysis
  9. Model Comparison

Features

🔍 Model Discovery: Search across 17+ LLM providers 💰 Cost Analysis: Find free models or filter by cost 🎯 Capability Filtering: Search by reasoning, tool calling, multimodal support 📊 Model Comparison: Compare up to 5 models side-by-side 🌐 Provider Information: Get detailed provider and model documentation ⚡ Performance: 1-hour API response caching for fast queries 🔒 No API Keys Required: Uses public models.dev API


Quick Start

1. Installation

# Navigate to the openpets directory
cd /Users/andrewmaguire/LOCAL/Github/raggle-code/raggle-repo/core/openpets

# The plugin is already set up in pets/llm-models
cd pets/llm-models

# Install dependencies (if needed)
npm install

2. Basic Usage

# List all LLM providers
opencode run "list all LLM providers"

# Find free models
opencode run "get all free models"

# Search for reasoning models
opencode run "search for models with reasoning capability"

# Get details about a specific model
opencode run "get details for openai gpt-4"

Available Tools

1. list-llm-providers

List all available LLM model providers from models.dev.

Parameters:

  • includeDoc (optional, default: true): Include documentation URLs

Example:

opencode run "list all LLM providers"
opencode run "list providers without documentation"

2. search-llm-models

Search for models with advanced filtering options.

Parameters:

  • provider (optional): Filter by provider ID
  • free (optional): Only show free models
  • openWeights (optional): Only show open-weight models
  • reasoning (optional): Only show models with reasoning capability
  • toolCall (optional): Only show models with tool/function calling
  • structuredOutput (optional): Only show models with structured output support
  • modality (optional): Filter by modality (text, image, audio, video, pdf)
  • minContext (optional): Minimum context window size
  • maxCostInput (optional): Maximum input cost per token
  • maxCostOutput (optional): Maximum output cost per token
  • limit (optional, default: 20): Maximum number of results

Examples:

# Search for free models
opencode run "search for free models"

# Search for models with tool calling
opencode run "search for models with tool calling"

# Search for multimodal models
opencode run "search for models with image modality"

# Search for models with large context windows
opencode run "search for models with minimum context 100000"

# Search for cheap models
opencode run "search for models with max input cost 0.5"

3. get-free-llm-models

Get all free LLM models, optionally filtered by provider.

Parameters:

  • provider (optional): Filter by provider ID
  • limit (optional, default: 50): Maximum number of results

Examples:

# Get all free models
opencode run "get all free models"

# Get free models from Groq
opencode run "get free models from groq"

# Get free models from GitHub Copilot
opencode run "get free models from github-copilot"

4. get-reasoning-models

Get all models with reasoning capabilities.

Parameters:

  • provider (optional): Filter by provider ID
  • limit (optional, default: 20): Maximum number of results

Examples:

# Get all reasoning models
opencode run "get reasoning models"

# Get reasoning models from OpenAI
opencode run "get reasoning models from openai"

5. get-multimodal-models

Get all multimodal models (supporting 2+ modalities).

Parameters:

  • provider (optional): Filter by provider ID
  • limit (optional, default: 20): Maximum number of results

Examples:

# Get all multimodal models
opencode run "get multimodal models"

# Get multimodal models from specific provider
opencode run "get multimodal models from google"

6. get-model-details

Get detailed information about a specific model.

Parameters:

  • providerId (required): Provider ID (e.g., 'openai', 'anthropic')
  • modelId (required): Model ID (e.g., 'gpt-4', 'claude-3-opus')

Examples:

# Get details for GPT-4
opencode run "get details for openai gpt-4"

# Get details for Claude
opencode run "get details for anthropic claude-3-opus"

# Get details for Llama
opencode run "get details for groq llama-3-70b"

7. compare-models

Compare multiple models side-by-side.

Parameters:

  • models (required): Array of 2-5 models to compare
    • Each model needs: providerId and modelId

Examples:

# Compare GPT-4 and Claude
opencode run "compare models: openai gpt-4 and anthropic claude-3-opus"

# Compare multiple models
opencode run "compare gpt-4, claude-3-opus, and gemini-pro"

# Compare free models
opencode run "compare groq llama-3-70b and mistral mistral-large"

Usage Examples

Scenario 1: Finding Free Models

# List all free models
opencode run "get all free models"

# Filter free models by provider
opencode run "get free models from groq"
opencode run "get free models from github-copilot"

# Find free models with specific capabilities
opencode run "search for free models with tool calling"
opencode run "search for free models with reasoning"

Scenario 2: Cost Analysis

# Find the cheapest models
opencode run "search for models with max input cost 0.1"

# Find models under a specific price point
opencode run "search for models with max output cost 1.0"

# Compare costs across providers
opencode run "compare pricing for openai gpt-4 and anthropic claude-3-opus"

Scenario 3: Capability Discovery

# Find models with reasoning
opencode run "get reasoning models"

# Find models with tool calling
opencode run "search for models with tool calling"

# Find models with structured output
opencode run "search for models with structured output"

# Find multimodal models
opencode run "get multimodal models"

Scenario 4: Context Window Search

# Find models with large context windows
opencode run "search for models with minimum context 100000"

# Find models with specific context size
opencode run "search for models with minimum context 200000"

Scenario 5: Provider-Specific Search

# Get all models from a provider
opencode run "search for openai models"
opencode run "search for anthropic models"
opencode run "search for groq models"

# Get free models from provider
opencode run "get free models from groq"

# Get reasoning models from provider
opencode run "get reasoning models from openai"

Configuration

Environment Variables

This plugin requires no API keys as it uses the public models.dev API.

Optional configuration in .env:

# Logging level: debug, info, warn, error
LOG_LEVEL=info

# Cache duration for API responses in milliseconds (default: 3600000 = 1 hour)
CACHE_DURATION=3600000

# Custom models.dev API URL (if using a mirror or local instance)
MODELS_DEV_API_URL=https://models.dev/api.json

API Reference

Provider List Format

{
  "id": "openai",
  "name": "OpenAI",
  "modelCount": 25,
  "doc": "https://platform.openai.com/docs"
}

Model Format

{
  "id": "gpt-4",
  "name": "GPT-4",
  "provider": "OpenAI",
  "providerId": "openai",
  "context": 128000,
  "max_output": 4096,
  "knowledge": "2023-12",
  "modalities": ["text", "image"],
  "reasoning": false,
  "tool_call": true,
  "structured_output": true,
  "open_weights": false,
  "cost": {
    "input": 3.0,
    "output": 6.0
  }
}

Cost Format

Costs are in fractional cents per token:

  • 0.1 = $0.001 per token
  • 1.0 = $0.01 per token
  • 10.0 = $0.10 per token

Advanced Filtering

Combining Filters

# Free models with reasoning
opencode run "search for free models with reasoning"

# Open-weight models with large context
opencode run "search for open weight models with minimum context 32000"

# Multimodal models with tool calling
opencode run "search for models with image modality and tool calling"

# Low-cost reasoning models
opencode run "search for reasoning models with max input cost 1.0"

Provider-Specific Filtering

# Free models from specific provider
opencode run "get free models from groq"

# Reasoning models from specific provider
opencode run "get reasoning models from openai"

# Models with capabilities from provider
opencode run "search for anthropic models with tool calling"

Cost Analysis

Understanding Pricing

The plugin shows costs in dollars per token:

Input: $0.000030/token  = 3¢ per 1M tokens
Output: $0.000060/token = 6¢ per 1M tokens

Cost Comparison Examples

# Compare costs across providers
opencode run "compare models: openai gpt-4, anthropic claude-3-opus, google gemini-pro"

# Find cheapest models with specific capability
opencode run "search for reasoning models with max input cost 0.5"

# Find free alternatives
opencode run "get all free models"

Cost Calculation

For a 10K token input and 2K token output:

Cost = (10,000 × input_cost) + (2,000 × output_cost)

Example with GPT-4:

Cost = (10,000 × $0.000030) + (2,000 × $0.000060)
     = $0.30 + $0.12
     = $0.42

Model Comparison

Comparison Table Format

When comparing models, you'll see:

| Feature | Model 1 | Model 2 | Model 3 | |---------|---------|---------|---------| | Provider | OpenAI | Anthropic | Google | | Context | 128,000 | 200,000 | 128,000 | | Max Output | 4,096 | 4,096 | 8,192 | | Input Cost | $0.000030 | $0.000015 | $0.000007 | | Output Cost | $0.000060 | $0.000075 | $0.000021 | | Reasoning | No | Yes | No | | Tool Calling | Yes | Yes | Yes | | Modalities | text, image | text | text, image | | Open Weights | No | No | No |

Comparison Examples

# Compare flagship models
opencode run "compare models: openai gpt-4, anthropic claude-3-opus, google gemini-pro"

# Compare free models
opencode run "compare models: groq llama-3-70b, github-copilot gpt-4"

# Compare reasoning models
opencode run "compare models: openai o1, anthropic claude-3-opus"

# Compare multimodal models
opencode run "compare models: openai gpt-4-vision, google gemini-pro-vision"

Use Cases

1. Cost Optimization

Find the cheapest models that meet your requirements:

# Find free alternatives
opencode run "get all free models"

# Find low-cost models with tool calling
opencode run "search for models with tool calling and max input cost 0.5"

# Compare costs across providers
opencode run "compare pricing for similar models"

2. Capability Discovery

Find models with specific capabilities:

# Models with reasoning
opencode run "get reasoning models"

# Models with vision
opencode run "search for models with image modality"

# Models with function calling
opencode run "search for models with tool calling"

3. Open Source Projects

Find open-weight models for self-hosting:

# All open-weight models
opencode run "search for open weight models"

# Open-weight models with large context
opencode run "search for open weight models with minimum context 32000"

4. Provider Evaluation

Compare offerings across providers:

# List all providers
opencode run "list all LLM providers"

# Get provider-specific models
opencode run "search for anthropic models"
opencode run "search for openai models"

# Compare flagship models
opencode run "compare models from different providers"

Integration Examples

Using from Other Projects

Add the plugin to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "/absolute/path/to/openpets/pets/llm-models/index.ts"
  ]
}

Programmatic Usage

import { ModelsDevAPI } from 'openpets/models-dev'

const api = new ModelsDevAPI()

// Search for models
const freeModels = await api.getFreeModels()
const reasoningModels = await api.getReasoningModels()

// Get specific model
const model = await api.getModel('openai', 'gpt-4')

// Advanced search
const models = await api.searchModels({
  free: true,
  reasoning: true,
  minContext: 100000
})

Supported Providers

Current providers in models.dev:

  • OpenAI
  • Anthropic
  • Google (Gemini)
  • Mistral
  • Groq
  • GitHub Copilot
  • xAI
  • Alibaba
  • Nvidia
  • Upstage
  • Vercel AI Gateway
  • Nebius
  • Vultr
  • And more...

Data Source

This plugin uses the models.dev API, which provides:

  • Real-time data: Updated model information
  • Comprehensive coverage: 17+ providers, 100+ models
  • Detailed specs: Pricing, capabilities, context windows
  • Public access: No API key required

Performance

  • Response caching: 1-hour cache for API responses
  • Fast queries: Cached searches return instantly
  • Efficient filtering: Client-side filtering for speed
  • Minimal overhead: Single API call per cache cycle

Troubleshooting

Common Issues

Issue: No results found Solution: Check your filter parameters, they might be too restrictive

Issue: Outdated model information Solution: Wait for the cache to expire (1 hour) or restart OpenCode

Issue: Provider not found Solution: Check the provider ID spelling (use list-llm-providers to see valid IDs)


Contributing

Found an issue or want to contribute?

  1. Check the models.dev GitHub for data issues
  2. Submit PRs to the OpenPets repository for plugin improvements

License

MIT - Free to use and modify


Links

  • models.dev API: https://models.dev/api.json
  • models.dev GitHub: https://github.com/sst/models.dev
  • OpenPets Repository: https://github.com/raggle-ai/pets

Happy model hunting! 🚀