MCPcopy
hub / github.com/superagent-ai/grok-cli / normalizeModelId

Function normalizeModelId

src/grok/models.ts:82–88  ·  view source on GitHub ↗
(modelId: string)

Source from the content-addressed store, hash-verified

80export const DEFAULT_MODEL = MODELS.find((model) => model.id === "grok-4.3")?.id ?? MODELS[0]?.id ?? "grok-4.3";
81
82export function normalizeModelId(modelId: string): string {
83 const trimmed = modelId.trim();
84 if (!trimmed) return trimmed;
85
86 const withoutProviderPrefix = trimmed.replace(PROVIDER_PREFIX_RE, "");
87 return aliasMap.get(withoutProviderPrefix.toLowerCase()) ?? withoutProviderPrefix;
88}
89
90export function getModelInfo(modelId: string): ModelInfo | undefined {
91 const normalized = normalizeModelId(modelId);

Callers 15

runBackgroundDelegationFunction · 0.90
resolveConfigFunction · 0.90
parseSubAgentsRawListFunction · 0.90
saveUserSettingsFunction · 0.90
saveProjectSettingsFunction · 0.90
getCurrentModelFunction · 0.90
getModeSpecificModelFunction · 0.90
resolveModelRuntimeFunction · 0.90
models.test.tsFile · 0.90
AppFunction · 0.90
ModelPickerModalFunction · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected