MCPcopy
hub / github.com/coder/mux / isValidModelFormat

Function isValidModelFormat

src/common/utils/ai/models.ts:27–30  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

25 * Supports colons in the model ID (e.g., "ollama:gpt-oss:20b").
26 */
27export function isValidModelFormat(model: string): boolean {
28 const colonIndex = model.indexOf(":");
29 return colonIndex > 0 && colonIndex < model.length - 1;
30}
31
32/**
33 * Normalize gateway model strings to canonical provider:model format when possible.

Calls

no outgoing calls

Tested by

no test coverage detected