MCPcopy
hub / github.com/Doorman11991/smallcode / getModelTargetForModel

Function getModelTargetForModel

bin/config.js:211–220  ·  view source on GitHub ↗
(config, modelName, preferredTier = 'default')

Source from the content-addressed store, hash-verified

209}
210
211function getModelTargetForModel(config, modelName, preferredTier = 'default') {
212 if (config?.models) {
213 for (const tier of ['fast', 'default', 'medium', 'strong']) {
214 const entry = coerceModelEntry(config.models[tier]);
215 if (entry.name && entry.name === modelName) return getModelTarget(config, tier);
216 }
217 }
218 const fallback = getModelTarget(config, preferredTier);
219 return { ...fallback, model: modelName || fallback.model, name: modelName || fallback.name };
220}
221
222function withModelTarget(config, target) {
223 return {

Callers 1

chatCompletionFunction · 0.85

Calls 2

coerceModelEntryFunction · 0.85
getModelTargetFunction · 0.85

Tested by

no test coverage detected