model-selection
Skill28 starsChanged 5 months agoMITView on GitHub
Use when choosing which LLM to use for a task. Covers matching capability to task, cost and latency trade-offs, routing between models, benchmark skepticism, and evaluating on your own data.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- AI-Hydro/Skillstheir own version, first seen Oct 2, 2026
- yuanhao667/Skillstheir own version, first seen Sep 26, 2026
- han69611/math-modeling-skillstheir own version, first seen Jul 7, 2026
- github/gh-awtheir own version, first seen May 27, 2026
- Victoriakaey/build-reliable-agentstheir own version, first seen Apr 3, 2026
- aemerson-commits/shareable-skillstheir own version, first seen Mar 30, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- github/gh-aw★ 5.3ksame name
- microsoft/Generative-AI-for-beginners-dotnet★ 3.1ksame name
- awslabs/agent-plugins★ 910same name
- han69611/math-modeling-skills★ 12same name
- yuanhao667/Skills★ 10same name
- AI-Hydro/Skills★ 2same name
- aemerson-commits/shareable-skills★ 1same name
- Victoriakaey/build-reliable-agents★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- aws-cdkSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 57
Test the failure mode, not just the accuracy.
- Distinctive: line 58
Do not hard-code the model name across the codebase.
- Distinctive: line 115
When a provider releases a new model, the correct response is to run your evaluation set against it, not to migrate on the announcement.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Model Selection
Purpose
Choose the model that meets the task's requirements at the lowest cost and latency. Most production LLM features run on a model several times more expensive than the task requires, because nobody measured the cheaper one.
When to Use
- Choosing a model for a new feature.
- Reducing the cost or latency of an existing feature.
- Evaluating whether a newly released model is worth migrating to.
- Designing a routing strategy across several models.
Capabilities
- Task-to-capability matching.
- Cost and latency modeling at real volume.
- Routing: cheap model first, escalate on difficulty.
- Benchmark interpretation and its limits.
- Migration and re-evaluation.
Inputs
- The task, and the accuracy it genuinely requires.
- Volume, latency budget, and cost budget.
- An evaluation set — without one, this is guesswork.
Outputs
- A model choice justified by measurement on your data.
- A cost and latency projection at real volume.
- A routing strategy, where one is warranted.
Workflow
- Start with the cheapest plausible model — Not the best one. Measure it on your evaluation set. Escalate only if it fails, and only as far as necessary.
- Measure on your data, not on benchmarks — A model that leads on MMLU may be worse at your specific extraction task. Public benchmarks measure general capability, and your task is not general.
- Model the cost at real volume — A per-call cost difference that looks trivial becomes the dominant line item at a million calls a month. Do the arithmetic before choosing.
- Consider routing — Send everything to a small model; escalate the cases it flags as low-confidence to a larger one. This frequently captures most of the accuracy at a fraction of the cost.
- Re-evaluate on model updates — Provider models change under the same name. A prompt tuned six months ago on a model that has since been updated may no longer be optimal.
Best Practices
- The most common mistake is defaulting to the most capable model for everything. Classification, extraction, and routing tasks are usually solved by a small model at a tenth of the cost and a fifth of the latency.
- Public benchmarks are contaminated and gamed. They are a rough capability ordering, not a prediction of performance on your task.
- Latency matters more than cost for user-facing features, and cost matters more than latency for batch processing. Optimize for the one that binds.
- A cheaper model with better prompting often beats a more expensive model with worse prompting. Improve the prompt before upgrading the model.
- Test the failure mode, not just the accuracy. A small model that fails loudly is safer than a large one that fails plausibly.
- Do not hard-code the model name across the codebase. Configure it, so migration is a config change rather than a search-and-replace.
Examples
Measuring rather than assuming:
Task: extract structured fields from support emails. 800,000/month.
Model Accuracy p95 latency Cost/1k calls Monthly cost
----------- -------- ----------- ------------- ------------
Small 91.2% 340ms $0.42 $336
Medium 96.8% 890ms $3.10 $2,480
Large 97.4% 2,100ms $15.00 $12,000
The large model buys 0.6 accuracy points over the medium for 5x the cost and
2.4x the latency. It is not a serious candidate.
The real question is whether 91.2% is sufficient. It is not — the failures
concentrate on emails with attachments and multi-issue threads.
Routing solution:
- Small model handles everything, and returns a confidence score.
- The 14% of cases below the confidence threshold escalate to medium.
Effective accuracy: 96.5% (within 0.3 points of medium-for-everything)
Monthly cost: $336 + (0.14 x $2,480) = $683
p95 latency: 410ms (most requests never touch the medium model)
Chosen: routing. 96.5% accuracy at $683/month, versus 96.8% at $2,480.Routing implemented:
async def extract(email: str) -> Extraction:
result = await small_model.extract(email)
# Escalate on the model's own uncertainty, or on a structural signal
# that we know correlates with failure.
needs_escalation = (
result.confidence < 0.75
or email_has_attachment(email)
or count_distinct_issues(email) > 1
)
if needs_escalation:
metrics.increment("extraction.escalated")
return await medium_model.extract(email)
return resultNotes
- The routing threshold should be tuned on the evaluation set by plotting accuracy against escalation rate. There is usually a knee where a small increase in escalation buys most of the remaining accuracy.
- Structural escalation signals (has an attachment, exceeds a length, contains a table) are often better predictors of failure than the model's own confidence score, and they are free to compute.
- When a provider releases a new model, the correct response is to run your evaluation set against it, not to migrate on the announcement. Sometimes the newer model is worse at your specific task.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

