haive.core.models.metadata_mixin¶

Model metadata mixin for LLM configurations.

This module provides a mixin class that adds comprehensive model metadata access to LLM configuration classes, including context windows, pricing, and capability information.

Classes¶

ModelMetadataMixin

Mixin to add comprehensive model metadata methods to LLMConfig classes.

Module Contents¶

class haive.core.models.metadata_mixin.ModelMetadataMixin[source]¶

Mixin to add comprehensive model metadata methods to LLMConfig classes.

This mixin provides access to model capabilities, context window sizes, pricing information, and other metadata from the model catalog.

get_batch_token_pricing()[source]¶

Get the batch token pricing for this model.

Returns:

(input_batch_cost, output_batch_cost)

Return type:

Tuple[float, float]

get_context_window()[source]¶

Get the maximum context window size for this model.

Returns:

Total context window size (input + output tokens)

Return type:

int

get_deprecation_date()[source]¶

Get the deprecation date for this model, if available.

Returns:

Deprecation date in YYYY-MM-DD format, or None if not deprecated

Return type:

Optional[str]

get_max_input_tokens()[source]¶

Get the maximum input tokens for this model.

Returns:

Maximum input tokens the model can accept

Return type:

int

get_max_output_tokens()[source]¶

Get the maximum output tokens for this model.

Returns:

Maximum output tokens the model can generate

Return type:

int

get_model_mode()[source]¶

Get the mode for this model.

Returns:

Model mode (e.g., “chat”, “embedding”, “completion”)

Return type:

str

get_search_context_costs()[source]¶

Get the search context costs for this model.

Returns:

Dictionary mapping context sizes to costs

Return type:

Dict[str, float]

get_supported_endpoints()[source]¶

Get the supported API endpoints for this model.

Returns:

List of supported endpoints

Return type:

List[str]

get_supported_modalities()[source]¶

Get the supported input modalities for this model.

Returns:

List of supported modalities (e.g., “text”, “image”)

Return type:

List[str]

get_supported_output_modalities()[source]¶

Get the supported output modalities for this model.

Returns:

List of supported output modalities

Return type:

List[str]

get_token_pricing()[source]¶

Get the token pricing for this model.

Returns:

(input_cost_per_token, output_cost_per_token)

Return type:

Tuple[float, float]

supports_feature(feature)[source]¶

Check if this model supports a specific feature.

Parameters:

feature (str) – Feature name (e.g., “vision”, “function_calling”)

Returns:

True if the model supports the feature, False otherwise

Return type:

bool

property max_input_tokens: int¶

Get maximum input tokens for this model.

Return type:

int

property max_output_tokens: int¶

Get maximum output tokens for this model.

Return type:

int

property max_tokens: int¶

Get maximum total tokens for this model.

Return type:

int

property supports_audio_input: bool¶

Check if model supports audio input.

Return type:

bool

property supports_audio_output: bool¶

Check if model supports audio output.

Return type:

bool

property supports_function_calling: bool¶

Check if model supports function calling.

Return type:

bool

property supports_native_streaming: bool¶

Check if model supports native streaming.

Return type:

bool

property supports_parallel_function_calling: bool¶

Check if model supports parallel function calling.

Return type:

bool

property supports_pdf_input: bool¶

Check if model supports PDF input.

Return type:

bool

property supports_prompt_caching: bool¶

Check if model supports prompt caching.

Return type:

bool

property supports_reasoning: bool¶

Check if model supports reasoning.

Return type:

bool

property supports_response_schema: bool¶

Check if model supports response schema.

Return type:

bool

property supports_system_messages: bool¶

Check if model supports system messages.

Return type:

bool

property supports_tool_choice: bool¶

Check if model supports tool choice.

Return type:

bool

property supports_vision: bool¶

Check if model supports vision/image inputs.

Return type:

bool

Check if model supports web search.

Return type:

bool