MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / normalizeModelId

Function normalizeModelId

src/zenModels.ts:78–87  ·  view source on GitHub ↗
(modelId: string)

Source from the content-addressed store, hash-verified

76}
77
78function normalizeModelId(modelId: string): string {
79 const trimmed = modelId.trim();
80 assert(trimmed.length > 0, "Model identifier cannot be empty.");
81
82 if (trimmed.startsWith(OPENCODE_PREFIX)) {
83 return trimmed.slice(OPENCODE_PREFIX.length);
84 }
85
86 return trimmed;
87}
88
89function inferEndpoint(modelId: string): "responses" | "anthropic" | "chat" {
90 const lower = modelId.toLowerCase();

Callers 1

getZenLanguageModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected