Implementation:Helicone Helicone ModelConfig AuthorMetadata
| Knowledge Sources | |
|---|---|
| Domains | Model Registry, Type System, TypeScript |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
Concrete TypeScript type definitions for model specifications and author metadata, provided by the packages/cost/models/types.ts module.
Description
The ModelConfig interface captures a model's intrinsic properties: its display name, author, description, context length, maximum output tokens, creation date, input/output modality, tokenizer family, and an optional pinned version reference. It is used in per-model model.ts files within the packages/cost/models/authors/ directory hierarchy.
The AuthorMetadata interface describes an author organization: model count, support status, and optional fields for name, slug, description, website, and API URL.
Supporting types include AuthorName (a union derived from the AUTHORS const array plus "passthrough"), InputModality and OutputModality (unions of "text" | "image" | "audio" | "video"), Modality (an object with input and output arrays), and Tokenizer (a union of all supported tokenizer families).
The currently recognized authors are: anthropic, openai, google, meta-llama, mistral, amazon, microsoft, nvidia, deepseek, qwen, xai, moonshotai, perplexity, alibaba, zai, and baidu.
Usage
Use these types when:
- Creating a new
model.tsfile for a new model underpackages/cost/models/authors/ - Building UI components that display model specifications
- Filtering or grouping models by author, modality, or tokenizer
Code Reference
Source Location
- Repository: Helicone
- File:
packages/cost/models/types.ts(lines 3-11, 34-59, 154-164)
Signature
export interface AuthorMetadata {
modelCount: number;
supported: boolean;
name?: string;
slug?: string;
description?: string;
website?: string;
apiUrl?: string;
}
export interface ModelConfig {
name: string;
author: AuthorName;
description: string;
contextLength: number;
maxOutputTokens: number;
created: string;
modality: Modality;
tokenizer: Tokenizer;
pinnedVersionOfModel?: string;
}
export type AuthorName = (typeof AUTHORS)[number] | "passthrough";
export type InputModality = "text" | "image" | "audio" | "video";
export type OutputModality = "text" | "image" | "audio" | "video";
export interface Modality {
inputs: InputModality[];
outputs: OutputModality[];
}
export type Tokenizer =
| "Claude" | "GPT" | "Llama" | "Llama3" | "Llama4"
| "Gemini" | "Mistral" | "MoonshotAI" | "Qwen"
| "DeepSeek" | "Cohere" | "Grok" | "Tekken" | "Zai" | "Baidu";
Import
import type { ModelConfig, AuthorMetadata, AuthorName, Modality, Tokenizer } from "packages/cost/models/types";
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | string |
Yes | Display name of the model (e.g., "Anthropic: Claude Opus 4") |
| author | AuthorName |
Yes | Author identifier from the AUTHORS const array |
| description | string |
Yes | Human-readable description of the model's capabilities |
| contextLength | number |
Yes | Maximum context window size in tokens |
| maxOutputTokens | number |
Yes | Maximum number of tokens the model can generate per response |
| created | string |
Yes | ISO 8601 creation date string |
| modality | Modality |
Yes | Supported input and output modalities |
| tokenizer | Tokenizer |
Yes | Tokenizer family used by the model |
| pinnedVersionOfModel | string |
No | If this model is a version-pinned alias, the canonical model name it points to |
Outputs
| Name | Type | Description |
|---|---|---|
| ModelConfig | TypeScript interface | Type-checked model specification object |
| AuthorMetadata | TypeScript interface | Type-checked author metadata object |
Usage Examples
Basic Usage
import type { ModelConfig } from "packages/cost/models/types";
// Define a new model's intrinsic properties
export const models = {
"claude-opus-4": {
name: "Anthropic: Claude Opus 4",
author: "anthropic",
description:
"Our previous flagship model with very high intelligence and capability...",
contextLength: 200000,
maxOutputTokens: 32000,
created: "2025-05-14T00:00:00.000Z",
modality: { inputs: ["text", "image"], outputs: ["text"] },
tokenizer: "Claude",
},
} satisfies Record<string, ModelConfig>;