MCPcopy Create free account
hub / github.com/EvoMap/evolver / detectModelsProvider

Function detectModelsProvider

src/proxy/router/models_route.js:10–16  ·  view source on GitHub ↗
(headers = {})

Source from the content-addressed store, hash-verified

8// Not traced: it is a metadata probe, not an LLM call.
9
10function detectModelsProvider(headers = {}) {
11 const lower = {};
12 for (const [k, v] of Object.entries(headers || {})) lower[String(k).toLowerCase()] = v;
13 // anthropic-version (and anthropic-beta) are sent by every Anthropic SDK request and by nothing else.
14 if (lower['anthropic-version'] || lower['anthropic-beta']) return 'anthropic';
15 return 'openai';
16}
17
18function buildModelsHandler({ anthropicProxy, openAIProxy, logger } = {}) {
19 if (typeof anthropicProxy !== 'function' || typeof openAIProxy !== 'function') {

Callers 1

buildModelsHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected