AI Model Host Classifier (telemetry/model-host.ts)

CopilotKit · packages/shared/src/telemetry/model-host.ts · typescript · MIT
ai, analytics, security

Categorizes LLM providers for telemetry while scrubbing sensitive base URLs. Use this to maintain privacy in analytics without losing vendor-specific insights.

// Source: https://github.com/CopilotKit/CopilotKit.git | License: MIT | Copyright Atai Barkai
// Provided via justclaw.it.com; keep this notice with the code.
// Which endpoint the runtime sends completions to, as a closed vocabulary.
//
// The AI SDK's provider label cannot answer this. A model built by
// `createOpenAI` reports only its wire API: `openai.responses` for both
// api.openai.com and Azure (whose own migration guide tells customers to use
// exactly that client), and `openai.chat` for OpenRouter and a laptop running
// Ollama alike. So the provider field reports the wire protocol, and the host
// reports the vendor.
//
// Only the classification travels. A base URL like
// `myresource.openai.azure.com` carries the customer's Azure resource name,
// which identifies them, so 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key