Model Selection Framework
When to Use This Skill
Use this skill when:
- Model Selection tasks - Working on select appropriate ai/ml models based on capability matching, benchmarks, cost-performance tradeoffs, and deployment constraints
- Planning or design - Need guidance on Model Selection approaches
- Best practices - Want to follow established patterns and standards
Overview
Model selection is the systematic process of choosing the right AI/ML model based on task requirements, performance characteristics, cost constraints, and deployment considerations. Poor model selection leads to suboptimal performance, excessive costs, or deployment failures.
Model Selection Decision Tree
┌─────────────────────────────────────────────────────────────────┐
│ MODEL SELECTION FRAMEWORK │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. TASK ANALYSIS │
│ What are the core capabilities needed? │
│ ├── Text Generation → LLM │
│ ├── Classification → Traditional ML / Small LM │
│ ├── Code Generation → Code-specialized LLM │
│ ├── Vision → Multimodal / Vision Model │
│ ├── Embeddings → Embedding Model │
│ └── Structured Output → Instruction-tuned LLM │
│ │
│ 2. REQUIREMENTS MAPPING │
│ ├── Quality: Accuracy, coherence, factuality │
│ ├── Latency: Real-time vs batch │
│ ├── Cost: Per-token, per-request budgets │
│ ├── Privacy: Data residency, local deployment │
│ └── Scale: Requests per second, concurrent users │
│ │
│ 3. MODEL EVALUATION │
│ ├── Benchmark analysis │
│ ├── Task-specific testing │
│ └── Cost-performance optimization │
│ │
│ 4. DEPLOYMENT PLANNING │
│ ├── Cloud API vs self-hosted │
│ ├── Hardware requirements │
│ └── Scaling strategy │
│ │
└─────────────────────────────────────────────────────────────────┘
LLM Capability Matrix
General Purpose Models (December 2025)
| Model |
Provider |
Context |
Strengths |
Weaknesses |
| GPT-4o |
OpenAI |
128K |
Multimodal, fast, reliable |
Cost for high volume |
| GPT-4o-mini |
OpenAI |
128K |
Cost-effective, good quality |
Less capable than full |
| Claude 3.5 Sonnet |
Anthropic |
200K |
Long context, coding, analysis |
Availability |
| Claude 3.5 Haiku |
Anthropic |
200K |
Fast, cost-effective |
Less capable |
| Gemini 1.5 Pro |
Google |
1M |
Massive context, multimodal |
Latency variance |
| Gemini 1.5 Flash |
Google |
1M |
Fast, cost-effective |
Quality tradeoffs |
| o1 |
OpenAI |
128K |
Deep reasoning, math, coding |
Slow, expensive |
| o1-mini |
OpenAI |
128K |
Reasoning, cost-effective |
Narrower than o1 |
Specialized Models
| Use Case |
Recommended Models |
Notes |
| Code Generation |
GPT-4o, Claude 3.5 Sonnet, Codex |
Claude excels at refactoring |
| Long Documents |
Claude 3.5, Gemini 1.5 |
200K-1M context |
| Embeddings |
text-embedding-3-large, Cohere embed-v3 |
Quality vs cost |
| Vision |
GPT-4o, Claude 3.5, Gemini 1.5 |
All support images |
| Structured Output |
GPT-4o (JSON mode), Claude |
Schema enforcement |
| Reasoning |
o1, o1-mini |
Chain of thought |
Local/Open Models
| Model |
Parameters |
VRAM Required |
Use Case |
| Llama 3.2 |
1B-90B |
2GB-180GB |
General, local deployment |
| Mistral |
7B-8x22B |
14GB-180GB |
European data residency |
| Phi-3 |
3.8B-14B |
8GB-28GB |
Edge, mobile |
| Qwen 2.5 |
0.5B-72B |
1GB-144GB |
Multilingual |
| CodeLlama |
7B-70B |
14GB-140GB |
Code-specific |
Model Comparison Framework
Benchmark Interpretation
| Benchmark |
Measures |
Weight |
| MMLU |
General knowledge |
Medium |
| HumanEval |
Code generation |
High for coding tasks |
| GSM8K |
Math reasoning |
High for analytical |
| MT-Bench |
Conversation quality |
High for chat |
| GPQA |
Graduate-level QA |
Domain expertise |
| Arena ELO |
Human preference |
Overall quality |
Task-Specific Evaluation
public class ModelEvaluator
{
public async Task<EvaluationReport> EvaluateModels(
List<ModelConfig> candidates,
EvaluationDataset dataset,
CancellationToken ct)
{
var results = new Dictionary<string, ModelMetrics>();
foreach (var model in candidates)
{
var metrics = new ModelMetrics
{
ModelId = model.Id,
Provider = model.Provider
};
// Run task-specific tests
foreach (var testCase in dataset.TestCases)
{
var startTime = Stopwatch.StartNew();
var response = await CallModel(model, testCase.Prompt, ct);
startTime.Stop();
metrics.AddResult(new TestResult
{
TestId = testCase.Id,
LatencyMs = startTime.ElapsedMilliseconds,
InputTokens = CountTokens(testCase.Prompt),
OutputTokens = CountTokens(response),
Score = await EvaluateResponse(response, testCase.Expected),
Cost = CalculateCost(model, testCase.Prompt, response)
});
}
results[model.Id] = metrics;
}
return new EvaluationReport
{
Results = results,
Recommendation = SelectBestModel(results, dataset.Requirements)
};
}
private ModelRecommendation SelectBestModel(
Dictionary<string, ModelMetrics> results,
Requirements requirements)
{
// Score based on requirements weights
var scores = results.Select(r => new
{
Model = r.Key,
Score = CalculateWeightedScore(r.Value, requirements)
}).OrderByDescending(s => s.Score);
return new ModelRecommendation
{
Primary = scores.First().Model,
Fallback = scores.Skip(1).FirstOrDefault()?.Model,
Reasoning = GenerateReasoning(scores, requirements)
};
}
}
Cost-Performance Analysis
Pricing Comparison (December 2025, per 1M tokens)
| Model |
Input Cost |
Output Cost |
Notes |
| GPT-4o |
$2.50 |
$10.00 |
Standard |
| GPT-4o-mini |
$0.15 |
$0.60 |
Budget option |
| Claude 3.5 Sonnet |
$3.00 |
$15.00 |
Premium |
| Claude 3.5 Haiku |
$0.25 |
$1.25 |
Budget |
| Gemini 1.5 Pro |
$1.25 |
$5.00 |
Pay-as-you-go |
| Gemini 1.5 Flash |
$0.075 |
$0.30 |
High volume |
| o1 |
$15.00 |
$60.00 |
Reasoning tasks |
| o1-mini |
$3.00 |
$12.00 |
Reasoning budget |
Cost Optimization Strategies
| Strategy |
Savings |
Trade-off |
| Smaller model for simple tasks |
80-95% |
Quality on complex tasks |
| Prompt caching |
50-90% |
Cache management complexity |
| Batch processing |
50% |
Latency increase |
| Prompt optimization |
20-40% |
Development effort |
| Response length limits |
10-30% |
Potentially truncated output |
ROI Calculator
public class ModelCostCalculator
{
public CostProjection CalculateMonthlyCost(
ModelConfig model,
UsageEstimate usage)
{
var inputCost = usage.MonthlyInputTokens / 1_000_000m
* model.InputPricePerMillion;
var outputCost = usage.MonthlyOutputTokens / 1_000_000m
* model.OutputPricePerMillion;
var cachedSavings = usage.CacheHitRate * inputCost
* model.CacheDiscount;
return new CostProjection
{
GrossInputCost = inputCost,
GrossOutputCost = outputCost,
CacheSavings = cachedSavings,
NetMonthlyCost = inputCost + outputCost - cachedSavings,
CostPerRequest = (inputCost + outputCost - cachedSavings)
/ usage.MonthlyRequests
};
}
public ModelComparison CompareModels(
List<ModelConfig> models,
UsageEstimate usage,
QualityRequirements requirements)
{
var comparisons = models.Select(m => new
{
Model = m,
Cost = CalculateMonthlyCost(m, usage),
MeetsRequirements = EvaluateQuality(m, requirements)
}).Where(c => c.MeetsRequirements)
.OrderBy(c => c.Cost.NetMonthlyCost)
.ToList();
return new ModelComparison
{
CheapestQualified = comparisons.FirstOrDefault()?.Model,
AllOptions = comparisons,
Savings = CalculateSavings(comparisons)
};
}
}
Fine-Tuning Decision Framework
When to Fine-Tune
| Consider Fine-Tuning |
Use Prompting Instead |
| Consistent specific format |
Few-shot examples work |
| Domain vocabulary |
General vocabulary |
| Latency critical (shorter prompts) |
Latency acceptable |
| High volume (amortize cost) |
Low volume |
| Specialized behavior |
Standard behavior |
| Proprietary knowledge |
Public knowledge |
Fine-Tuning ROI Analysis
## Fine-Tuning Decision: [Use Case]
### Current State (Prompting)
- Prompt tokens: [X] tokens
- Output quality: [Score]
- Cost per request: $[X]
- Monthly cost: $[X]
### Projected State (Fine-Tuned)
- Prompt tokens: [Y] tokens (reduced)
- Output quality: [Score] (maintained/improved)
- Fine-tuning cost: $[X] (one-time)
- Inference cost per request: $[Y]
- Monthly cost: $[Y]
### Break-Even Analysis
- Monthly savings: $[X]
- Break-even: [N] months
- 12-month ROI: [X]%
### Recommendation
[Fine-tune / Continue prompting / Hybrid approach]
Deployment Considerations
Cloud vs Self-Hosted Decision
| Factor |
Cloud API |
Self-Hosted |
| Initial cost |
Low (pay-per-use) |
High (infrastructure) |
| Scaling |
Automatic |
Manual |
| Latency |
Network dependent |
Controlled |
| Data privacy |
Limited |
Full control |
| Customization |
Limited |
Full |
| Maintenance |
None |
Significant |
Hardware Requirements (Self-Hosted)
| Model Size |
GPU Memory |
Recommended GPU |
| 7B |
14GB |
RTX 4090, A10 |
| 13B |
26GB |
A100-40GB |
| 30B |
60GB |
2x A100-40GB |
| 70B |
140GB |
2x A100-80GB |
| 8x7B (MoE) |
100GB+ |
Multiple A100s |
Model Selection Template
# Model Selection: [Project Name]
## Task Requirements
- **Primary Use Case**: [Description]
- **Quality Requirements**: [Accuracy/coherence targets]
- **Latency Requirements**: [P95 target]
- **Volume**: [Requests/day]
- **Budget**: [Monthly budget]
## Evaluation Results
| Model | Quality Score | P95 Latency | Monthly Cost | Notes |
|-------|--------------|-------------|--------------|-------|
| [Model A] | [Score] | [ms] | $[X] | [Notes] |
| [Model B] | [Score] | [ms] | $[X] | [Notes] |
| [Model C] | [Score] | [ms] | $[X] | [Notes] |
## Recommendation
**Primary Model**: [Model]
- Rationale: [Why this model]
**Fallback Model**: [Model]
- Use when: [Conditions]
**Cost Projection**: $[X]/month
## Implementation Notes
- [Deployment approach]
- [Monitoring strategy]
- [Scaling considerations]
Validation Checklist
Integration Points
Inputs from:
- Business requirements → Task definition
ml-project-lifecycle skill → Project constraints
Outputs to:
token-budgeting skill → Cost estimation
rag-architecture skill → Embedding model selection
- Application code → Model configuration
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: model-selection3description: Select appropriate AI/ML models based on capability matching, benchmarks, cost-performance tradeoffs, and deployment constraints. Use when this capability is needed.4---56# Model Selection Framework78## When to Use This Skill910Use this skill when:1112- **Model Selection tasks** - Working on select appropriate ai/ml models based on capability matching, benchmarks, cost-performance tradeoffs, and deployment constraints13- **Planning or design** - Need guidance on Model Selection approaches14- **Best practices** - Want to follow established patterns and standards1516## Overview1718Model selection is the systematic process of choosing the right AI/ML model based on task requirements, performance characteristics, cost constraints, and deployment considerations. Poor model selection leads to suboptimal performance, excessive costs, or deployment failures.1920## Model Selection Decision Tree2122```text23┌─────────────────────────────────────────────────────────────────┐24│ MODEL SELECTION FRAMEWORK │25├─────────────────────────────────────────────────────────────────┤26│ │27│ 1. TASK ANALYSIS │28│ What are the core capabilities needed? │29│ ├── Text Generation → LLM │30│ ├── Classification → Traditional ML / Small LM │31│ ├── Code Generation → Code-specialized LLM │32│ ├── Vision → Multimodal / Vision Model │33│ ├── Embeddings → Embedding Model │34│ └── Structured Output → Instruction-tuned LLM │35│ │36│ 2. REQUIREMENTS MAPPING │37│ ├── Quality: Accuracy, coherence, factuality │38│ ├── Latency: Real-time vs batch │39│ ├── Cost: Per-token, per-request budgets │40│ ├── Privacy: Data residency, local deployment │41│ └── Scale: Requests per second, concurrent users │42│ │43│ 3. MODEL EVALUATION │44│ ├── Benchmark analysis │45│ ├── Task-specific testing │46│ └── Cost-performance optimization │47│ │48│ 4. DEPLOYMENT PLANNING │49│ ├── Cloud API vs self-hosted │50│ ├── Hardware requirements │51│ └── Scaling strategy │52│ │53└─────────────────────────────────────────────────────────────────┘54```5556## LLM Capability Matrix5758### General Purpose Models (December 2025)5960| Model | Provider | Context | Strengths | Weaknesses |61|-------|----------|---------|-----------|------------|62| GPT-4o | OpenAI | 128K | Multimodal, fast, reliable | Cost for high volume |63| GPT-4o-mini | OpenAI | 128K | Cost-effective, good quality | Less capable than full |64| Claude 3.5 Sonnet | Anthropic | 200K | Long context, coding, analysis | Availability |65| Claude 3.5 Haiku | Anthropic | 200K | Fast, cost-effective | Less capable |66| Gemini 1.5 Pro | Google | 1M | Massive context, multimodal | Latency variance |67| Gemini 1.5 Flash | Google | 1M | Fast, cost-effective | Quality tradeoffs |68| o1 | OpenAI | 128K | Deep reasoning, math, coding | Slow, expensive |69| o1-mini | OpenAI | 128K | Reasoning, cost-effective | Narrower than o1 |7071### Specialized Models7273| Use Case | Recommended Models | Notes |74|----------|-------------------|-------|75| Code Generation | GPT-4o, Claude 3.5 Sonnet, Codex | Claude excels at refactoring |76| Long Documents | Claude 3.5, Gemini 1.5 | 200K-1M context |77| Embeddings | text-embedding-3-large, Cohere embed-v3 | Quality vs cost |78| Vision | GPT-4o, Claude 3.5, Gemini 1.5 | All support images |79| Structured Output | GPT-4o (JSON mode), Claude | Schema enforcement |80| Reasoning | o1, o1-mini | Chain of thought |8182### Local/Open Models8384| Model | Parameters | VRAM Required | Use Case |85|-------|------------|---------------|----------|86| Llama 3.2 | 1B-90B | 2GB-180GB | General, local deployment |87| Mistral | 7B-8x22B | 14GB-180GB | European data residency |88| Phi-3 | 3.8B-14B | 8GB-28GB | Edge, mobile |89| Qwen 2.5 | 0.5B-72B | 1GB-144GB | Multilingual |90| CodeLlama | 7B-70B | 14GB-140GB | Code-specific |9192## Model Comparison Framework9394### Benchmark Interpretation9596| Benchmark | Measures | Weight |97|-----------|----------|--------|98| MMLU | General knowledge | Medium |99| HumanEval | Code generation | High for coding tasks |100| GSM8K | Math reasoning | High for analytical |101| MT-Bench | Conversation quality | High for chat |102| GPQA | Graduate-level QA | Domain expertise |103| Arena ELO | Human preference | Overall quality |104105### Task-Specific Evaluation106107```csharp108public class ModelEvaluator109{110 public async Task<EvaluationReport> EvaluateModels(111 List<ModelConfig> candidates,112 EvaluationDataset dataset,113 CancellationToken ct)114 {115 var results = new Dictionary<string, ModelMetrics>();116117 foreach (var model in candidates)118 {119 var metrics = new ModelMetrics120 {121 ModelId = model.Id,122 Provider = model.Provider123 };124125 // Run task-specific tests126 foreach (var testCase in dataset.TestCases)127 {128 var startTime = Stopwatch.StartNew();129130 var response = await CallModel(model, testCase.Prompt, ct);131132 startTime.Stop();133134 metrics.AddResult(new TestResult135 {136 TestId = testCase.Id,137 LatencyMs = startTime.ElapsedMilliseconds,138 InputTokens = CountTokens(testCase.Prompt),139 OutputTokens = CountTokens(response),140 Score = await EvaluateResponse(response, testCase.Expected),141 Cost = CalculateCost(model, testCase.Prompt, response)142 });143 }144145 results[model.Id] = metrics;146 }147148 return new EvaluationReport149 {150 Results = results,151 Recommendation = SelectBestModel(results, dataset.Requirements)152 };153 }154155 private ModelRecommendation SelectBestModel(156 Dictionary<string, ModelMetrics> results,157 Requirements requirements)158 {159 // Score based on requirements weights160 var scores = results.Select(r => new161 {162 Model = r.Key,163 Score = CalculateWeightedScore(r.Value, requirements)164 }).OrderByDescending(s => s.Score);165166 return new ModelRecommendation167 {168 Primary = scores.First().Model,169 Fallback = scores.Skip(1).FirstOrDefault()?.Model,170 Reasoning = GenerateReasoning(scores, requirements)171 };172 }173}174```175176## Cost-Performance Analysis177178### Pricing Comparison (December 2025, per 1M tokens)179180| Model | Input Cost | Output Cost | Notes |181|-------|------------|-------------|-------|182| GPT-4o | $2.50 | $10.00 | Standard |183| GPT-4o-mini | $0.15 | $0.60 | Budget option |184| Claude 3.5 Sonnet | $3.00 | $15.00 | Premium |185| Claude 3.5 Haiku | $0.25 | $1.25 | Budget |186| Gemini 1.5 Pro | $1.25 | $5.00 | Pay-as-you-go |187| Gemini 1.5 Flash | $0.075 | $0.30 | High volume |188| o1 | $15.00 | $60.00 | Reasoning tasks |189| o1-mini | $3.00 | $12.00 | Reasoning budget |190191### Cost Optimization Strategies192193| Strategy | Savings | Trade-off |194|----------|---------|-----------|195| Smaller model for simple tasks | 80-95% | Quality on complex tasks |196| Prompt caching | 50-90% | Cache management complexity |197| Batch processing | 50% | Latency increase |198| Prompt optimization | 20-40% | Development effort |199| Response length limits | 10-30% | Potentially truncated output |200201### ROI Calculator202203```csharp204public class ModelCostCalculator205{206 public CostProjection CalculateMonthlyCost(207 ModelConfig model,208 UsageEstimate usage)209 {210 var inputCost = usage.MonthlyInputTokens / 1_000_000m211 * model.InputPricePerMillion;212213 var outputCost = usage.MonthlyOutputTokens / 1_000_000m214 * model.OutputPricePerMillion;215216 var cachedSavings = usage.CacheHitRate * inputCost217 * model.CacheDiscount;218219 return new CostProjection220 {221 GrossInputCost = inputCost,222 GrossOutputCost = outputCost,223 CacheSavings = cachedSavings,224 NetMonthlyCost = inputCost + outputCost - cachedSavings,225 CostPerRequest = (inputCost + outputCost - cachedSavings)226 / usage.MonthlyRequests227 };228 }229230 public ModelComparison CompareModels(231 List<ModelConfig> models,232 UsageEstimate usage,233 QualityRequirements requirements)234 {235 var comparisons = models.Select(m => new236 {237 Model = m,238 Cost = CalculateMonthlyCost(m, usage),239 MeetsRequirements = EvaluateQuality(m, requirements)240 }).Where(c => c.MeetsRequirements)241 .OrderBy(c => c.Cost.NetMonthlyCost)242 .ToList();243244 return new ModelComparison245 {246 CheapestQualified = comparisons.FirstOrDefault()?.Model,247 AllOptions = comparisons,248 Savings = CalculateSavings(comparisons)249 };250 }251}252```253254## Fine-Tuning Decision Framework255256### When to Fine-Tune257258| Consider Fine-Tuning | Use Prompting Instead |259|---------------------|----------------------|260| Consistent specific format | Few-shot examples work |261| Domain vocabulary | General vocabulary |262| Latency critical (shorter prompts) | Latency acceptable |263| High volume (amortize cost) | Low volume |264| Specialized behavior | Standard behavior |265| Proprietary knowledge | Public knowledge |266267### Fine-Tuning ROI Analysis268269```markdown270## Fine-Tuning Decision: [Use Case]271272### Current State (Prompting)273- Prompt tokens: [X] tokens274- Output quality: [Score]275- Cost per request: $[X]276- Monthly cost: $[X]277278### Projected State (Fine-Tuned)279- Prompt tokens: [Y] tokens (reduced)280- Output quality: [Score] (maintained/improved)281- Fine-tuning cost: $[X] (one-time)282- Inference cost per request: $[Y]283- Monthly cost: $[Y]284285### Break-Even Analysis286- Monthly savings: $[X]287- Break-even: [N] months288- 12-month ROI: [X]%289290### Recommendation291[Fine-tune / Continue prompting / Hybrid approach]292```293294## Deployment Considerations295296### Cloud vs Self-Hosted Decision297298| Factor | Cloud API | Self-Hosted |299|--------|-----------|-------------|300| Initial cost | Low (pay-per-use) | High (infrastructure) |301| Scaling | Automatic | Manual |302| Latency | Network dependent | Controlled |303| Data privacy | Limited | Full control |304| Customization | Limited | Full |305| Maintenance | None | Significant |306307### Hardware Requirements (Self-Hosted)308309| Model Size | GPU Memory | Recommended GPU |310|------------|------------|-----------------|311| 7B | 14GB | RTX 4090, A10 |312| 13B | 26GB | A100-40GB |313| 30B | 60GB | 2x A100-40GB |314| 70B | 140GB | 2x A100-80GB |315| 8x7B (MoE) | 100GB+ | Multiple A100s |316317## Model Selection Template318319```markdown320# Model Selection: [Project Name]321322## Task Requirements323- **Primary Use Case**: [Description]324- **Quality Requirements**: [Accuracy/coherence targets]325- **Latency Requirements**: [P95 target]326- **Volume**: [Requests/day]327- **Budget**: [Monthly budget]328329## Evaluation Results330331| Model | Quality Score | P95 Latency | Monthly Cost | Notes |332|-------|--------------|-------------|--------------|-------|333| [Model A] | [Score] | [ms] | $[X] | [Notes] |334| [Model B] | [Score] | [ms] | $[X] | [Notes] |335| [Model C] | [Score] | [ms] | $[X] | [Notes] |336337## Recommendation338339**Primary Model**: [Model]340- Rationale: [Why this model]341342**Fallback Model**: [Model]343- Use when: [Conditions]344345**Cost Projection**: $[X]/month346347## Implementation Notes348- [Deployment approach]349- [Monitoring strategy]350- [Scaling considerations]351```352353## Validation Checklist354355- [ ] Task requirements clearly defined356- [ ] Capability mapping completed357- [ ] Candidate models identified358- [ ] Benchmarks reviewed359- [ ] Task-specific evaluation conducted360- [ ] Cost analysis completed361- [ ] Latency requirements validated362- [ ] Deployment constraints considered363- [ ] Fine-tuning decision made364- [ ] Fallback strategy defined365366## Integration Points367368**Inputs from**:369370- Business requirements → Task definition371- `ml-project-lifecycle` skill → Project constraints372373**Outputs to**:374375- `token-budgeting` skill → Cost estimation376- `rag-architecture` skill → Embedding model selection377- Application code → Model configuration378379---380> Converted and distributed by [TomeVault](https://tomevault.io/claim/dtmc-marketplace) — claim your Tome and manage your conversions.381<!-- tomevault:4.0:skill_md:2026-04-15 -->