Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Helicone Helicone Providers Index

From Leeroopedia
Revision as of 12:57, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Helicone_Helicone_Providers_Index.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains LLM Gateway, Service Registry, TypeScript
Last Updated 2026-02-14 00:00 GMT

Overview

Concrete provider registry mapping provider name strings to singleton BaseProvider instances, provided by the packages/cost/models/providers/index.ts module.

Description

The providers constant is a frozen object literal (as const) that maps each supported provider's canonical string key to a stateless singleton instance of its BaseProvider subclass. The ModelProviderName type is derived directly from the keys of this object, ensuring that every provider referenced elsewhere in the codebase is validated at compile time.

The module also exports two additional arrays, ContextEditingEnabledProviders and ResponsesAPIEnabledProviders, which declare provider-level feature flags for capabilities like context editing and the OpenAI Responses API format support.

Currently the registry contains 21 providers: anthropic, azure, baseten, bedrock, canopywave, cerebras, chutes, deepinfra, deepseek, fireworks, google-ai-studio, groq, helicone, mistral, nebius, novita, openai, openrouter, perplexity, vertex, and xai.

Usage

Use this module when you need to:

  • Look up a provider handler by its string name during request routing
  • Reference the ModelProviderName type for compile-time provider name validation
  • Register a new provider by adding an import and entry to the providers object

Code Reference

Source Location

  • Repository: Helicone
  • File: packages/cost/models/providers/index.ts (lines 24-48)

Signature

export const providers = {
  baseten: new BasetenProvider(),
  anthropic: new AnthropicProvider(),
  azure: new AzureOpenAIProvider(),
  bedrock: new BedrockProvider(),
  canopywave: new CanopyWaveProvider(),
  cerebras: new CerebrasProvider(),
  chutes: new ChutesProvider(),
  deepinfra: new DeepInfraProvider(),
  deepseek: new DeepSeekProvider(),
  fireworks: new FireworksProvider(),
  "google-ai-studio": new GoogleProvider(),
  groq: new GroqProvider(),
  helicone: new HeliconeProvider(),
  mistral: new MistralProvider(),
  nebius: new NebiusProvider(),
  novita: new NovitaProvider(),
  openai: new OpenAIProvider(),
  openrouter: new OpenRouterProvider(),
  perplexity: new PerplexityProvider(),
  vertex: new VertexProvider(),
  xai: new XAIProvider(),
} as const;

export type ModelProviderName = keyof typeof providers;

Import

import { providers, ModelProviderName } from "packages/cost/models/providers";

I/O Contract

Inputs

Name Type Required Description
key ModelProviderName Yes The canonical string name of the provider to look up (e.g., "anthropic", "openai")

Outputs

Name Type Description
providers[key] BaseProvider (concrete subclass) The singleton provider handler instance for the given name
ModelProviderName TypeScript union type Compile-time union of all valid provider name strings, derived from the registry keys

Usage Examples

Basic Usage

import { providers, ModelProviderName } from "packages/cost/models/providers";

// Look up a provider by name
const providerName: ModelProviderName = "anthropic";
const provider = providers[providerName];

// Use the provider to build a URL
const url = provider.buildUrl(endpoint, requestParams);

// Use the provider to authenticate
const authResult = provider.authenticate(authContext, endpoint);

// Adding a new provider:
// 1. Create NewProvider extends BaseProvider in providers/newprovider.ts
// 2. Import and add to the providers object:
//    import { NewProvider } from "./newprovider";
//    export const providers = {
//      ...existing,
//      "new-provider": new NewProvider(),
//    } as const;

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment