Skip to content

Purpose Profiles

Every call to recommend() needs filters, criteria, and weights. A PurposeProfile bundles all three into a reusable object: “find me the best coding model” or “find me the cheapest option” in a single argument.

pickai ships six profiles via the Purpose constant. Weights are relative. See Scoring & Ranking for how weights and criteria produce scores.

Filter: none

CriterionWeight
costEfficiency7
recency1

Filter: none

CriterionWeight
costEfficiency1
recency1
contextCapacity1
outputCapacity1
knowledgeFreshness1

Filter: none

CriterionWeight
recency5
knowledgeFreshness3
contextCapacity2
outputCapacity2
costEfficiency1

Filter: toolCall: true

CriterionWeight
recency4
knowledgeFreshness3
contextCapacity3
outputCapacity2
costEfficiency1

Filter: none

CriterionWeight
contextCapacity4
recency3
knowledgeFreshness2
outputCapacity1
costEfficiency1

Filter: reasoning: true

CriterionWeight
recency5
knowledgeFreshness3
outputCapacity2
contextCapacity2
costEfficiency1

A profile is just an object with filter and criteria fields. Use built-in criteria, custom criteria, or mix both:

import {
fromModelsDev,
recommend,
costEfficiency,
contextCapacity,
recency,
OPENROUTER_PROVIDERS,
type PurposeProfile,
type ScoringCriterion,
} from "pickai";
const models = await fromModelsDev();
// Custom criterion: prefer models with vision support
const supportsVision: ScoringCriterion = (model) =>
model.modalities.input.includes("image") ? 1 : 0;
const VisionAgent: PurposeProfile = {
filter: {
providers: [...OPENROUTER_PROVIDERS],
toolCall: true,
maxCostInput: 10,
},
criteria: [
{ criterion: supportsVision, weight: 4 },
{ criterion: recency, weight: 3 },
{ criterion: contextCapacity, weight: 2 },
{ criterion: costEfficiency, weight: 1 },
],
};
const results = recommend(models, VisionAgent, { limit: 3 });

When you call recommend(), you can pass both a profile filter and an options filter. They combine with AND logic:

import { recommend, Purpose, DIRECT_PROVIDERS } from "pickai";
// Profile filter: requires toolCall (from Purpose.Coding)
// Options filter: narrows to direct-API providers
const results = recommend(models, Purpose.Coding, {
filter: { providers: [...DIRECT_PROVIDERS] },
limit: 3,
});

You can narrow further to a single provider, or extend the list with your own:

// Just Google models
const google = recommend(models, Purpose.Coding, {
filter: { providers: ["google"] },
limit: 3,
});
// Direct providers plus a local setup
const withLocal = recommend(models, Purpose.Coding, {
filter: { providers: [...DIRECT_PROVIDERS, "ollama-cloud"] },
limit: 3,
});

This lets you reuse the same profile across different contexts without creating a new one each time. See Provider Constants for the available lists.