model-selection

Automate LLM model and provider selection with registry-driven configuration.

2|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill model-selection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-selection
Source: https://github.com/ricardoroche/ricardos-claude-code/tree/main/.claude/skills/model-selection
Command: npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill model-selection

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydantic.

What problem does it solve?

This Skill guides the complex process of selecting and managing LLM models and providers, addressing challenges like cost overruns, performance bottlenecks, and vendor lock-in. It ensures optimal model choice for specific tasks, improves reliability through fallbacks, and helps control operational expenses.

Core Features & Use Cases

  • Model Registry: Centralizes metadata for various LLMs (Anthropic, OpenAI, Google), including capabilities, pricing, and recommended use cases.
  • Model Router: Implements logic to dynamically route prompts to the most appropriate model based on task complexity, length, or specific requirements.
  • Fallback Chain: Provides patterns for implementing robust fallback mechanisms, ensuring continuous service even if a primary model or provider fails.
  • Cost Optimization: Offers tools to estimate and analyze LLM costs, helping identify the cheapest model for a given task and compare expenses across different models.
  • Use Case: An LLM application needs to handle diverse user requests, from simple Q&A to complex code generation. This skill helps implement a ModelRouter to send simple queries to a fast, cheap model (e.g., Haiku) and complex requests to a flagship model (e.g., Sonnet), while a FallbackChain ensures resilience.

Quick Start

Set up a ModelRegistry with Claude Sonnet and Haiku models, including their capabilities and pricing.

Frequently Asked Questions about model-selection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between different LLM models based on cost and performance?

Model selection automates choosing the best LLM by comparing capabilities, pricing, and performance across providers like OpenAI, Anthropic, and Google. Set up a registry with model metadata—context length, streaming support, vision capabilities—then route requests to the cheapest or fastest model that meets your task requirements, reducing costs while maintaining quality.

What's the best way to implement fallback patterns across multiple LLM providers?

A fallback chain ensures service continuity by routing to alternative models or providers if the primary one fails. Define a priority sequence of models with different providers, then configure automatic routing to the next option when errors occur, preventing application downtime and distributing risk across vendors.

Can I route different requests to different models based on complexity or task type?

Model routing dynamically directs prompts to appropriate models based on task complexity, context length, or specific requirements like vision or function calling. Simple queries go to cheaper, faster models like Haiku; complex tasks use flagship models like Sonnet, optimizing both cost and performance within a single application.

How do I estimate and compare LLM costs across different models and providers?

Cost optimization tools analyze pricing metadata from your model registry to estimate expenses for different models on the same task. Compare total costs across OpenAI, Anthropic, Google, and local deployments to identify the cheapest option for your workload and track spending patterns.

What capabilities should I track when selecting models for specific use cases?

Track context length, streaming support, vision capabilities, and function calling availability in your model registry. These capabilities determine which models can handle your task—long documents need extended context, real-time applications need streaming, and complex reasoning may require specific model families.

How do I avoid vendor lock-in when using multiple LLM providers?

A registry-driven configuration abstracts model and provider selection from application logic. Define capabilities and constraints independently of specific vendors, implement routing rules that work across OpenAI, Anthropic, and Google, and swap providers without rewriting code by updating registry metadata.